Commit Graph

3931 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Di Lu
58bfe539aa Merge "Add unit test for IpSecService" 2017-07-20 07:27:16 +00:00
Di Lu
e073f8ae6a Merge "Add unit test for IpSecManager" am: 64d4939d07 am: 9ca5b3e1de
am: eb7bc05b32

Change-Id: I399513b63dd5c06bab2946be315cc5c5689dff29
2017-07-20 06:04:11 +00:00
Di Lu
9ca5b3e1de Merge "Add unit test for IpSecManager"
am: 64d4939d07

Change-Id: I56c336eb8234b31154b6a7defd95ce76ea0800d8
2017-07-20 05:52:10 +00:00
Di Lu
64d4939d07 Merge "Add unit test for IpSecManager" 2017-07-20 05:42:53 +00:00
ludi
b413bb0105 Add unit test for IpSecService
Test: runtest frameworks-net

Bug:38259578
Change-Id: I4a049d5fdec79e36692e3b12306bd0758c19ad75
2017-07-20 04:26:24 +00:00
Steven Moreland
bdf39c32ea Merge "frameworks/base: use proper nativehelper headers" am: 80c9a74da8 am: d4a4d12451
am: c840945a78

Change-Id: I654e14f0d1b495450db81592a2e564e308746350
2017-07-20 03:05:02 +00:00
Steven Moreland
d4a4d12451 Merge "frameworks/base: use proper nativehelper headers"
am: 80c9a74da8

Change-Id: I36f10ff4d963284a313f1cc5b368f82549a4adb2
2017-07-20 02:50:53 +00:00
Treehugger Robot
80c9a74da8 Merge "frameworks/base: use proper nativehelper headers" 2017-07-20 02:42:49 +00:00
ludi
50c2767142 Add unit test for IpSecManager
Test: runtest frameworks-net

Bug:38259578
Change-Id: Idb76aab899ccb7145bef2b7dce36e115c25fa6ca
2017-07-19 18:59:12 -07:00
Steven Moreland
b9e50d94d1 frameworks/base: use proper nativehelper headers
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.

Test: modules using frameworks/base find headers
Bug: 63762847
Change-Id: I0f9f231acdebe460f279135462f43d3e32eff64d
2017-07-19 10:06:40 -07:00
Hugo Benichi
fecebf94a2 Merge "ConnectivityServiceTest: fix testNetworkInfoOfTypeNone" am: 1f0d765378 am: 9efd050236
am: b1894abbc5

Change-Id: I458a0fdae874039e0f1d5cd38ed8ad0a1754bba9
2017-07-19 08:15:12 +00:00
Hugo Benichi
9efd050236 Merge "ConnectivityServiceTest: fix testNetworkInfoOfTypeNone"
am: 1f0d765378

Change-Id: I4be1d2ce67871c1e01364beca886fdd3af374321
2017-07-19 08:04:48 +00:00
Treehugger Robot
1f0d765378 Merge "ConnectivityServiceTest: fix testNetworkInfoOfTypeNone" 2017-07-19 07:54:45 +00:00
Hugo Benichi
a6fe35a841 ConnectivityServiceTest: fix testNetworkInfoOfTypeNone
This patch fixes a couple of flakyness issues with
testNetworkInfoOfTypeNone. It also fixes some typos and naming issues.

Bug: 62918393, 62918393
Test: runtest frameworks-net
Change-Id: I1c56557ab113d3ef57dbc06a6e882634d03c5b09
2017-07-19 15:08:49 +09:00
Robert Quattlebaum
6b6c6d45e2 Merge "NetworkCapabilities: Unhide TRANSPORT_LOWPAN" am: 1d4be0ece6 am: d1ce5a4ca7
am: dbc78509ae

Change-Id: I017036f8c63ea1e9c1934daad55ef087b3a83012
2017-07-18 23:51:04 +00:00
Robert Quattlebaum
d1ce5a4ca7 Merge "NetworkCapabilities: Unhide TRANSPORT_LOWPAN"
am: 1d4be0ece6

Change-Id: I3ae9566ca52b9dae87cace18b1e97897eb8de0ad
2017-07-18 23:33:08 +00:00
Treehugger Robot
1d4be0ece6 Merge "NetworkCapabilities: Unhide TRANSPORT_LOWPAN" 2017-07-18 23:09:58 +00:00
Hugo Benichi
afa6509e39 resolve merge conflicts of 4f2a0fe213e5 to stage-aosp-master am: df167a5d02
am: 164ff8a2ed

Change-Id: I08195e119f866acc9fe1795b892fe45cea3c7f47
2017-07-14 00:46:49 +00:00
Hugo Benichi
df167a5d02 resolve merge conflicts of 4f2a0fe213e5 to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I61cfb2d4798350f28f1bb36aed67ee8f18895031
2017-07-14 07:25:51 +09:00
Hugo Benichi
57224928a7 IpManager: define InitialConfiguration
This patch adds a InitialConfiguration class to IpManager for specifying
IP information in IpManager ProvisioningConfiguration at IpManager
startup.

At the moment this InitialConfiguration is not used, but is validated in
startProvsiioning if ProvisioningConfiguration includes one. It will be
integrated into IpManager IP provisioning logic in follow-up patches.

This patch also includes an example of data driven unit tests using a
table of test case. The highlights of this methodology are:
  1) easy extensibility for new test case,
  2) rich and informative error messages,
Unfortunately Java support for inlined data structure literals is poor
and some companion static methods for data generation are required for
enabling this methodology.

Bug: 62988545
Test: added new test in FrameworksNetTests,
      $ runtest frameworks-net
      $ runtest frameworks-wifi
Merged-In: I060b02603af7d73a6407df89344bf0c000574af2

(cherry pick of commit c8a0b1b80c)

Change-Id: I48dbf89232d7758f1b07ed4d76ce93281e5c6b53
2017-07-14 04:26:42 +09:00
Andreas Gampe
9c87a80662 Merge "Connectivity: Fix format arguments" am: ba8ab362ad am: df94ba0ad7
am: ce4c57fd0e

Change-Id: Ia789f019394b7870994fcce8e64dee3b0501f7c1
2017-07-12 05:00:56 +00:00
Andreas Gampe
df94ba0ad7 Merge "Connectivity: Fix format arguments"
am: ba8ab362ad

Change-Id: I844c7d1faea3dcc90cf9816cae984277d7525f15
2017-07-12 04:48:10 +00:00
Andreas Gampe
f1c0a31065 Connectivity: Fix format arguments
Fix missing argument.

Bug: 19797138
Test: m
Change-Id: I5fdd2a453c0d7422e8c3e79c8dce2d0800ec45e9
2017-07-11 18:21:15 -07:00
Robert Quattlebaum
4e64b627bb NetworkCapabilities: Unhide TRANSPORT_LOWPAN
This commit simply unhides the constant `TRANSPORT_LOWPAN` in the class
`android.net.NetworkCapabilities`, adding it to the public API.

Bug: b/63600204
Change-Id: I794635814c0bd3891cd22fcc1e31614e4d6ac654
2017-07-11 18:16:09 -07:00