Commit Graph

4339 Commits

Author SHA1 Message Date
Hugo Benichi
10d78759e3 Merge "Merge "NetworkCapabilities: fix describeImmutableDifferences" into oc-dr1-dev am: 1b3877a965 -s ours" into oc-dr1-dev-plus-aosp
am: 8047f7acad  -s ours

Change-Id: I5d3fe083ccbec5baa7f53beca4cb938312877a9e
2017-08-07 06:07:13 +00:00
Hugo Benichi
08b48ba699 Merge "NetworkCapabilities: fix describeImmutableDifferences" into oc-dr1-dev am: 1b3877a965
am: 6ecf87a88a  -s ours

Change-Id: I082ad1d8426245e26a1301c9b82d7e62cd3e4b33
2017-08-07 05:57:27 +00:00
Hugo Benichi
6ecf87a88a Merge "NetworkCapabilities: fix describeImmutableDifferences" into oc-dr1-dev
am: 1b3877a965

Change-Id: I50748aa0c9332787797f91265afccf82ceabf332
2017-08-07 05:49:25 +00:00
Hugo Benichi
4ba82b261f Merge "NetworkCapabilities: fix describeImmutableDifferences" into oc-dr1-dev
am: 1b3877a965  -s ours

Change-Id: I42723162b29e8a8c966201e1b4da811e2d266f00
2017-08-07 05:49:17 +00:00
Hugo Benichi
dec642b9b3 NetworkCapabilities: fix describeImmutableDifferences
This patch fixes the mask used in describeImmutableDifferences which did
not correctly turn NET_CAPABILITY_NOT_METERED into bit flag.

Bug: 63326103
Test: added unit tests, runtest frameworks-net
Merged-In: Ib6b390b1daef5912859302692af7dcd6cfd3e39a
Merged-In: If38efacdeec8476880835657938e435f9b598525
Merged-In: Ieccad46fcffcaf748f5644b04617e9a82527000e
Merged-In: I533ef8fe369cec19d283ff2950314fce6e28cffd
Merged-In: I12636c6699ff60487a28570208e819ea0b66fa2e
Merged-In: Ie5df14e0ea1c12e0cfabe87978ac6c9b744353b2

(cherry picked from commit 2ecb9408f4102687f20f9ca19c13071ac6098cc6)

Change-Id: I74ecf34a2c079c74152d00caea2c220e9c6d1fa5
2017-08-05 11:37:10 +09:00
Hugo Benichi
8112bf0dd4 Merge "NetworkCapabilities: fix describeImmutableDifferences" am: 7575ec2240 am: 9d951bf6f3 am: 7dac4ce465
am: 09cb221afb

Change-Id: I12636c6699ff60487a28570208e819ea0b66fa2e
2017-08-05 01:28:01 +00:00
Hugo Benichi
09cb221afb Merge "NetworkCapabilities: fix describeImmutableDifferences" am: 7575ec2240 am: 9d951bf6f3
am: 7dac4ce465

Change-Id: I533ef8fe369cec19d283ff2950314fce6e28cffd
2017-08-05 01:14:30 +00:00
Hugo Benichi
7dac4ce465 Merge "NetworkCapabilities: fix describeImmutableDifferences" am: 7575ec2240
am: 9d951bf6f3

Change-Id: Ieccad46fcffcaf748f5644b04617e9a82527000e
2017-08-05 01:01:04 +00:00
Hugo Benichi
9d951bf6f3 Merge "NetworkCapabilities: fix describeImmutableDifferences"
am: 7575ec2240

Change-Id: If38efacdeec8476880835657938e435f9b598525
2017-08-05 00:54:43 +00:00
Hugo Benichi
99806e5606 NetworkCapabilities: fix describeImmutableDifferences
This patch fixes the mask used in describeImmutableDifferences which did
not correctly turn NET_CAPABILITY_NOT_METERED into bit flag.

Bug: 63326103
Test: added unit tests, runtest frameworks-net
Change-Id: Ib6b390b1daef5912859302692af7dcd6cfd3e39a
2017-08-04 15:17:40 +09:00
Android Build Merger (Role)
778a16ae34 Merge changes from topic 'am-94906183e52945938953177851714b42' into oc-mr1-dev-plus-aosp
* changes:
  Merge changes I49a76582,Iac4b75bc into cw-f-dev am: f18599a15b am: 9295f58d26 am: 502986f72a am: 5223106231 am: 995d020232
  DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff  -s ours am: 552b3aae6e  -s ours am: e22c6cd56a  -s ours am: ae00616f2f  -s ours am: b1701a2d29  -s ours
2017-08-01 15:29:55 +00:00
Hugo Benichi
bc1b8c2d6b DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours am: 552b3aae6e -s ours am: e22c6cd56a -s ours am: ae00616f2f -s ours
am: 9e1d815206  -s ours

Change-Id: I9554a163f16bfb5030128d7184c06b6dae23dce5
2017-08-01 15:24:37 +00:00
Hugo Benichi
4e9604460f DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours am: 552b3aae6e -s ours am: e22c6cd56a -s ours am: ae00616f2f -s ours
am: b1701a2d29  -s ours

Change-Id: I95fed2b7514f5d27b1091fc2176ec3d7413b2747
2017-08-01 15:24:00 +00:00
Hugo Benichi
8b00864acf DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours am: 552b3aae6e -s ours am: e22c6cd56a -s ours am: ef32008853 -s ours
am: e7dcb3ad66  -s ours

Change-Id: Iecd2b076021a844f688f8221e204c22300ed1c93
2017-08-01 15:14:02 +00:00
Hugo Benichi
9e1d815206 DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours am: 552b3aae6e -s ours am: e22c6cd56a -s ours
am: ae00616f2f  -s ours

Change-Id: Ie1a18b001d85450f6458f33b75b0f2f3965a81a9
2017-08-01 15:12:15 +00:00
Hugo Benichi
b1701a2d29 DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours am: 552b3aae6e -s ours am: e22c6cd56a -s ours
am: ae00616f2f  -s ours

Change-Id: I5b252535638054e87fb3cc6069d51a6c4da7dce0
2017-08-01 15:10:35 +00:00
Hugo Benichi
e7dcb3ad66 DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours am: 552b3aae6e -s ours am: e22c6cd56a -s ours
am: ef32008853  -s ours

Change-Id: Idf2184eb808068366384031694c7fa89fe49c8bb
2017-08-01 15:03:31 +00:00
Hugo Benichi
ae00616f2f DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours am: 552b3aae6e -s ours
am: e22c6cd56a  -s ours

Change-Id: Ia38655a26410e9ea78e394e5c59e052739f041a6
2017-08-01 14:55:26 +00:00
Hugo Benichi
e9c2b802e5 DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours am: 552b3aae6e -s ours
am: e22c6cd56a  -s ours

Change-Id: Ic8e234914839f9e98fed944638d85c2e795c0c9d
2017-08-01 14:55:23 +00:00
Hugo Benichi
ef32008853 DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours am: 552b3aae6e -s ours
am: e22c6cd56a  -s ours

Change-Id: Idc2217a66f60caa783957fd6caeaafa1ff1615bc
2017-08-01 14:50:36 +00:00
Hugo Benichi
e22c6cd56a DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler am: 1681f064ff -s ours
am: 552b3aae6e  -s ours

Change-Id: I6d788c5b7cd5c6877799e5a3e0ad865996147b70
2017-08-01 14:37:06 +00:00
Hugo Benichi
552b3aae6e DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler
am: 1681f064ff  -s ours

Change-Id: Ie54e0712dc83514ff3ddcd6cee1b0bd2e80c73ad
2017-08-01 14:30:02 +00:00
Hugo Benichi
43f7dfa3fc Merge "Logging improvements when NetworkCapabilities change" am: 59e6fc6d27 am: ba6bae1db3 am: 88a572da7d -s ours
am: ce2547965f  -s ours

Change-Id: Ia69626f61d00be9a6da3655111999f70423325c9
2017-07-31 02:13:17 +00:00
Hugo Benichi
ce2547965f Merge "Logging improvements when NetworkCapabilities change" am: 59e6fc6d27 am: ba6bae1db3
am: 88a572da7d  -s ours

Change-Id: I5f6e3a2109236f30d0e09bde8a2c63b32e62f772
2017-07-31 02:07:12 +00:00
Hugo Benichi
ba6bae1db3 Merge "Logging improvements when NetworkCapabilities change"
am: 59e6fc6d27

Change-Id: I886e39db8969eb1ac1dfe06c6f448e53a90fd92c
2017-07-31 01:50:38 +00:00
Treehugger Robot
59e6fc6d27 Merge "Logging improvements when NetworkCapabilities change" 2017-07-31 01:38:29 +00:00
Hugo Benichi
e06963a7ff Logging improvements when NetworkCapabilities change
This patch improves the wtf() logging in updateCapabilities to
better distinguish between the cases of a changed specifiers, changed
transports, or changed capabilities. The case of NOT_METERED being added
or removed is ignored.

Bug: 63326103
Test: runtest frameworks-net, runtest frameworks-wifi
Merged-In: I05c6e78891e1eac658f1cf883223af520a9a4f8f
Merged-In: I4f6cbc0adb461cef6610460daeba72ca38b8f10c
Merged-In: I165a8bbe8362100f1e2bb909459fb45b1c68d5ae
Merged-In: Iec6d92e9a3a12bab87c5adfaf17f776465077060
Merged-In: I633d6347a7f852c27c03fc96b36ca2a60f70c73c
Merged-In: I38739184fc0db105bfd3b4c02cce01e803739e5d
Merged-In: Ia58b877056e2442136cc8b145ac8f4e6560cfc2c

(cherry pick from commit d9806e8014)

Change-Id: Id32ca66068c8ff549627e8e8c0e50897ef928c58
2017-07-31 09:25:37 +09:00
Android Build Merger (Role)
8c92a383a7 Merge "Merge "Logging improvements when NetworkCapabilities change" into oc-dr1-dev am: 8a8c295879 am: 00709696a9" into oc-mr1-dev-plus-aosp 2017-07-29 00:06:58 +00:00
Hugo Benichi
c35956e5c3 Merge "Logging improvements when NetworkCapabilities change" into oc-dr1-dev am: 8a8c295879
am: 00709696a9

Change-Id: I633d6347a7f852c27c03fc96b36ca2a60f70c73c
2017-07-29 00:03:33 +00:00
Hugo Benichi
8563e2100a Merge "Logging improvements when NetworkCapabilities change" into oc-dr1-dev am: 8a8c295879
am: 3d722e38f3

Change-Id: Iec6d92e9a3a12bab87c5adfaf17f776465077060
2017-07-29 00:03:27 +00:00
Hugo Benichi
00709696a9 Merge "Logging improvements when NetworkCapabilities change" into oc-dr1-dev
am: 8a8c295879

Change-Id: I165a8bbe8362100f1e2bb909459fb45b1c68d5ae
2017-07-28 23:54:05 +00:00
Hugo Benichi
3d722e38f3 Merge "Logging improvements when NetworkCapabilities change" into oc-dr1-dev
am: 8a8c295879

Change-Id: I4f6cbc0adb461cef6610460daeba72ca38b8f10c
2017-07-28 23:54:03 +00:00
Hugo Benichi
8a8c295879 Merge "Logging improvements when NetworkCapabilities change" into oc-dr1-dev 2017-07-28 23:42:59 +00:00
Hugo Benichi
d9806e8014 Logging improvements when NetworkCapabilities change
This patch improves the wtf() logging in updateCapabilities to
better distinguish between the cases of a changed specifiers, changed
transports, or changed capabilities. The case of NOT_METERED being added
or removed is ignored.

Bug: 63326103
Test: runtest frameworks-net, runtest frameworks-wifi
Change-Id: I05c6e78891e1eac658f1cf883223af520a9a4f8f
2017-07-28 15:25:54 +09:00
Android Build Merger (Role)
4753f74e83 Merge "Merge "NetworkNotificationManager: correctly handle existing notifications" into oc-dr1-dev am: a03bf7acd1 -s ours am: ec9236f68f -s ours" into oc-mr1-dev-plus-aosp 2017-07-28 04:49:25 +00:00
Hugo Benichi
c62c792171 Merge "NetworkNotificationManager: correctly handle existing notifications" into oc-dr1-dev am: a03bf7acd1
am: 7ae02714ae  -s ours

Change-Id: I98c775f946704f49d1986502aab97799e9ce15f6
2017-07-28 04:46:54 +00:00
Hugo Benichi
091bfd8471 Merge "NetworkNotificationManager: correctly handle existing notifications" into oc-dr1-dev am: a03bf7acd1 -s ours
am: ec9236f68f  -s ours

Change-Id: I3919b9b9f1f94fc7e8137dbd7ff1d71b2ca297b3
2017-07-28 04:46:54 +00:00
Hugo Benichi
7ae02714ae Merge "NetworkNotificationManager: correctly handle existing notifications" into oc-dr1-dev
am: a03bf7acd1

Change-Id: I4ca3dcc293be5408a6f207e1ac1a7229a915723a
2017-07-28 04:39:14 +00:00
Hugo Benichi
ec9236f68f Merge "NetworkNotificationManager: correctly handle existing notifications" into oc-dr1-dev
am: a03bf7acd1  -s ours

Change-Id: I13204ae131642c95df242245764689294b0fd85f
2017-07-28 04:38:25 +00:00
Hugo Benichi
1681f064ff DO NOT MERGE ANYWHERE ConnectivityService: move reportNetworkConnectivity to handler
This patch moves reportNetworkConnectivity onto the handler of
ConnectivityService.

This allows:
  - to inspect NetworkAgentInfo on the ConnectivityService handler,
    which is always more correct than doing so on a Binder thread.
  - to improve locking policies around NetworkAgentInfo.

Test: $ runtest frameworks-net
Bug: 37119619, 36902662
Change-Id: I49a765826e65c29a1995242290e5e7544112c94e
2017-07-27 20:18:03 -07:00
Hugo Benichi
57af1a02a6 DO NOT MERGE ANYWHERE ConnectivityService: safer locking
This path changes a dangerous lock path in reportNetworkConnectivity().
This methods is called outside of the main ConnectivityService handler
and takes a lock on a specific NetworkAgentInfo whose connectivity
status is being reported.

While this lock is held, reportNetworkConnectivity() goes on and query
the network policy state for that network, which may ends into
NetworkPolicyManagerService.

Instead, the lock on NetworkAgentInfo is only held long enough to make a
copy of LinkProperties, which is then passed to
NetworkPolicyManagerService without that lock.

Bug: 36902662
Test: could not repro b/36902662, reportNetworkConnectivity() works.
      $ runtest frameworks-net

Change-Id: Iac4b75bcecbdddb0ac695c8b1a87ae755f62f47f
2017-07-27 20:17:25 -07:00
Hugo Benichi
900a3dbcc0 NetworkNotificationManager: correctly handle existing notifications
This patch corrects a regression added by commit fd35080555 that did
not take into account the case of multiple notifications shown for a
single network id. Given how network notifications are triggered, it can
happen that NO_INTERNET and SIGN_IN notifications are both triggered for
the same network when captive portal detection is slow.

Contrary to the situation before commit fd35080555, a notification
priority order is introduced so that SIGN_IN always overrides
NO_INTERNET, and NO_INTERNET is ignored if SIGN_IN is already present.

Bug: 63676954
Bug: 62503737
Test: runtest frameworks-net, added new unit tests
Merged-In: Ib8658601e8d4dc6c41b335ab7dd8caa0cccd9531
Merged-In: I4432f66067ea1ab02e1d2dfe42530bcdafa52df6
Merged-In: I74631b0bfd14daf18a1641ed7f2ec323d636ebbf
Merged-In: I73cc879e910d503946facdba498b300337f349fd
Merged-In: Ieed9e3e7755e0c5f89dc41ef66f47d4dbf4c66a9
Merged-In: I0aa590170f1bd4c37175c7e35e54d52f1fb21347

(cherry picked from commit 5fcd050e0ecd5985cf184f55ea3df4434da8f824)

Change-Id: I41675768ab59e9b23ca4275edf297b82595e5730
2017-07-28 09:17:20 +09:00
Hugo Benichi
8419aca5fe Merge "NetworkNotificationManager: correctly handle existing notifications" am: 3451fb6156 am: 7e994d3eaa am: 5cbf7e2dc8
am: b43581504b

Change-Id: Ieed9e3e7755e0c5f89dc41ef66f47d4dbf4c66a9
2017-07-27 15:08:19 +00:00
Hugo Benichi
b43581504b Merge "NetworkNotificationManager: correctly handle existing notifications" am: 3451fb6156 am: 7e994d3eaa
am: 5cbf7e2dc8

Change-Id: I73cc879e910d503946facdba498b300337f349fd
2017-07-27 14:58:32 +00:00
Hugo Benichi
7e994d3eaa Merge "NetworkNotificationManager: correctly handle existing notifications"
am: 3451fb6156

Change-Id: I4432f66067ea1ab02e1d2dfe42530bcdafa52df6
2017-07-27 14:43:48 +00:00
Hugo Benichi
1fc19b9823 NetworkNotificationManager: correctly handle existing notifications
This patch corrects a regression added by commit fd35080555 that did
not take into account the case of multiple notifications shown for a
single network id. Given how network notifications are triggered, it can
happen that NO_INTERNET and SIGN_IN notifications are both triggered for
the same network when captive portal detection is slow.

Contrary to the situation before commit fd35080555, a notification
priority order is introduced so that SIGN_IN always overrides
NO_INTERNET, and NO_INTERNET is ignored if SIGN_IN is already present.

Bug: 63676954
Bug: 62503737
Test: runtest frameworks-net, added new unit tests
Change-Id: Ib8658601e8d4dc6c41b335ab7dd8caa0cccd9531
2017-07-27 21:20:20 +09:00
Di Lu
a37e02acb6 Merge "Add unit test for IpSecService" am: 58bfe539aa am: 3f5f9e1492 am: 345db82674
am: 7547060657

Change-Id: I788e4e8466a76f80d1f15330e6d3b91b73be1d32
2017-07-20 08:42:27 +00:00
Di Lu
c045847be4 Merge "Add unit test for IpSecManager" am: 64d4939d07 am: 9ca5b3e1de am: eb7bc05b32
am: e073f8ae6a

Change-Id: Iecf36183010f78920ef4112b9b0a0febf4ece82c
2017-07-20 08:38:36 +00:00
Di Lu
7547060657 Merge "Add unit test for IpSecService" am: 58bfe539aa am: 3f5f9e1492
am: 345db82674

Change-Id: Ia4d85bcf5c42774d7b48cb1cd648754b6dd16b69
2017-07-20 07:50:21 +00:00
Di Lu
3f5f9e1492 Merge "Add unit test for IpSecService"
am: 58bfe539aa

Change-Id: I16fb89239e641ac39a8a7adeafd72b7fe03935ed
2017-07-20 07:36:19 +00:00