Commit Graph

2412 Commits

Author SHA1 Message Date
Chalard Jean
9a14a06ae5 Merge "Allow testing of signal strength" am: 836df36aee am: 926dbce337
Change-Id: Ib00611c70d9b8fc3e4ee5338980344f5e2167fa1
2020-04-13 17:50:19 +00:00
Chalard Jean
6edf06afb0 Merge "Add instrumentation to test NetworkAgent." am: eb1d6593c5 am: 6dcb6a943c
Change-Id: Ief4f6bd95ba513e08c5d2e9e8fef9d0c426b4478
2020-04-13 15:22:45 +00:00
Chalard Jean
6b59b8fbcc Allow testing of signal strength
- Let any process with NETWORK_SETTINGS register for signal strength
  wakeup.
- Allow agents registering test networks to assign them a signal
  strength.

Test: NetworkAgentTest
Bug: 139268426
Change-Id: I2b4b89be3e69f4853fd6978d2c8f5c8eb4271f21
2020-04-13 21:55:32 +09:00
Chalard Jean
be9447be58 Add instrumentation to test NetworkAgent.
Test: NetworkAgentTest, new tests using this API
Bug: 139268426
Change-Id: Ia83b1c896df63bb18e2aa4b74d6cc09eba990eb5
2020-04-13 15:44:07 +09:00
Treehugger Robot
b9db69f623 Fix a theoretical NPE
Test: NetworkAgentTests
Bug: 153718627

Change-Id: I955b6dac6de48b12696dc640f131f5983ac552df
Merged-In: I08f57cce0cd85d5cd66e9a0ef948224290e9200e
(cherry picked from commit 31492c708746a51f70c74913a4d6cd97bf06ae63, aosp/1284575)
2020-04-11 03:26:27 +00:00
Treehugger Robot
e75cd4b458 Merge "Fix a theoretical NPE" am: e21dccde6b am: 49021c2c68
Change-Id: Ibf814e81ca984b47b9be1e423e2cde908cf7f193
2020-04-10 17:08:04 +00:00
Chalard Jean
35a06972cc Fix a theoretical NPE
Test: NetworkAgentTests
Bug: 153718627
Change-Id: I08f57cce0cd85d5cd66e9a0ef948224290e9200e
2020-04-10 23:08:00 +09:00
Treehugger Robot
50756739b5 Fix a stupid NPE
Okay so this is really not a behavior change as it converts an
NPE into an illegal argument exception, but still, that's what
should happen (and that's what the upcoming test actually tests
for).

Test: upcoming NetworkAgentTest
Bug: 139268426
Change-Id: I0d9b8cb8f8dcb587b9430b486b863efb9e9e77ef
Merged-In: I3e17211c03bc74426bf5e2e414ec322d73b0060b
(cherry picked from commit 827d7ceea1e83cca9ba3f6189e20b6780c0194ed, aosp/1277595)
2020-04-07 07:29:10 +00:00
Treehugger Robot
57e2a625f5 Merge "Fix a stupid NPE" am: 16f4882784 am: b3f7f04518
Change-Id: I68e5702008a82d93c634fd45c2bd83a33fdf0cd2
2020-04-07 06:18:28 +00:00
Treehugger Robot
16f4882784 Merge "Fix a stupid NPE" 2020-04-07 05:53:10 +00:00
Chalard Jean
26fc3f31ff Fix a bug where the legacy extra info is reset on connect.
Bug: 149459996
Test: NetworkAgentTest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests

Change-Id: I3e437f0fe2eb28f1d621551a8daf164a06af83fc
Merged-In: I3e437f0fe2eb28f1d621551a8daf164a06af83fc
(cherry picked from commit a3fdb94a32eda40e322b7dbdaf3fad9b42bfbbb9, originally aosp/1277602)
2020-04-06 11:14:59 +00:00
Chalard Jean
a6e848328a Merge "Fix a bug where the legacy extra info is reset on connect." am: 7e2d55206e am: 9f964ebc15
Change-Id: I127bf621caa39a24265f30cd4c781248410e5348
2020-04-06 06:34:09 +00:00
Chalard Jean
56c327341e Fix a bug where the legacy extra info is reset on connect.
Bug: 149459996
Test: NetworkAgentTest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I5f8f6d962ee3317e101d19518c767b3c327c0c47
2020-04-06 12:46:19 +09:00
TreeHugger Robot
147d1574b1 Merge "Only apply VPN isolation if it's fully routed" into rvc-dev 2020-04-04 03:44:46 +00:00
Lorenzo Colitti
53e0564ca4 Merge "Added a new capability for temporarily unmetered network." into rvc-dev am: 0edabc5e4e
Change-Id: I4d43b28d25529d4dd9e4304c4edf95edb5c5110b
2020-04-03 05:07:20 +00:00
Jack Yu
71863e9604 Added a new capability for temporarily unmetered network.
Added a new network capability TEMOPORARILY_NOT_METERED to support
the case that a network can temporarily become unmetered. This
allows carriers to deploy unmetered 5G network. When devices
camp on 5G network, this capability will be dynamically added
to the network and will be removed once leaving 5G coverage.

Bug: 153081494
Test: Manual
Change-Id: I10e26cb0852e67f614e7b9c4e49f95e078602e21
2020-04-02 19:28:41 -07:00
Chalard Jean
380318053b Fix a stupid NPE
Okay so this is really not a behavior change as it converts an
NPE into an illegal argument exception, but still, that's what
should happen (and that's what the upcoming test actually tests
for).

Test: upcoming NetworkAgentTest
Bug: 139268426
Change-Id: I3e17211c03bc74426bf5e2e414ec322d73b0060b
2020-04-03 07:17:13 +09:00
Lorenzo Colitti
7fb7c3e0bf Only apply VPN isolation if it's fully routed
VPN is considered fully routed if both IPv4 and IPv6 have
either a default route or a prohibit route.

Bug: 145332510
Test: atest FrameworksNetTests
Merged-In: I59cf48552bca98092d1212e3d718fd420add5458
Change-Id: I59cf48552bca98092d1212e3d718fd420add5458
2020-04-02 10:36:19 +00:00
Chalard Jean
9122e56202 Merge changes from topics "api-fix-networkagent", "satisfiedby"
* changes:
  Rename satisfiedBy into canBeSatisfiedBy
  Address further API council comments.
2020-04-02 05:51:02 +00:00
Lorenzo Colitti
62d2333abd Merge "Only apply VPN isolation if it's fully routed" am: 5c5d1a1282 am: d24e7fb5a1
Change-Id: I9230f1a73698344eb40ae3e0ebc5d73cc259f2d0
2020-04-02 04:50:41 +00:00
Lorenzo Colitti
5c5d1a1282 Merge "Only apply VPN isolation if it's fully routed" 2020-04-02 04:10:12 +00:00
Chalard Jean
c62f9a53d8 Rename satisfiedBy into canBeSatisfiedBy
Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Change-Id: I076876a6662bde143ef7d315ce3767acafff93c1
Merged-In: I076876a6662bde143ef7d315ce3767acafff93c1
2020-04-01 20:38:30 +08:00
Rubin Xu
ab8cf306ea Only apply VPN isolation if it's fully routed
VPN is considered fully routed if both IPv4 and IPv6 have
either a default route or a prohibit route.

Bug: 145332510
Test: atest FrameworksNetTests
Change-Id: I59cf48552bca98092d1212e3d718fd420add5458
2020-04-01 09:36:29 +01:00
Chalard Jean
691a34d96b Address further API council comments.
Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Copy from ag/10866511
Change-Id: I8a785ae0e74e659c317deaaa28c203356c7766ed
Merged-In: I8a785ae0e74e659c317deaaa28c203356c7766ed
2020-04-01 16:01:04 +08:00
Aaron Huang
f210e24871 Merge changes from topics "networkagent_api", "networkprovider_api"
* changes:
  Update the NetworkProvider API for council comments
  Update NetworkAgentConfig API for council comments
  Update the NetworkAgent API for council comments
2020-04-01 05:33:28 +00:00
Cody Kesting
84cfd6c6e4 Merge "Clarify comments for Connectivity Diagnostics reports." am: 87ce14f328 am: 1d99c7333f
Change-Id: I4e6452b4875a8c3e3739dea4d3bc281a006156eb
2020-03-31 18:17:26 +00:00
Cody Kesting
ad6fd5bfc8 Merge "Sort administrator UIDs for NetworkCapabilities." am: c350963548 am: 8d84479831
Change-Id: I453f81bcb7c426ab4b529acce5c32c502a29331b
2020-03-31 18:17:14 +00:00
Cody Kesting
975c5c699a Merge "Add combine() and equals() for NetworkCapabilities admin UIDs." am: e4df39ba4b am: e0463c56eb
Change-Id: Ic8fc22f0eb47836053fc6b9423018c16ae46ef46
2020-03-31 18:16:18 +00:00
Cody Kesting
87ce14f328 Merge "Clarify comments for Connectivity Diagnostics reports." 2020-03-31 17:43:44 +00:00
Cody Kesting
c350963548 Merge "Sort administrator UIDs for NetworkCapabilities." 2020-03-31 17:43:02 +00:00
Cody Kesting
e4df39ba4b Merge "Add combine() and equals() for NetworkCapabilities admin UIDs." 2020-03-31 17:42:18 +00:00
Chalard Jean
5f12f81206 Update the NetworkProvider API for council comments
Bug: 152238712
Test: FrameworksNetTests NetworkStackTests
Copy from ag/10826397
Change-Id: I6b086572cfc72a0727f4510351cff0e74cbc4302
Merged-In: I6b086572cfc72a0727f4510351cff0e74cbc4302
2020-03-31 11:57:59 +00:00
Chalard Jean
aea539a13e Update NetworkAgentConfig API for council comments
Bug: 152238712
Test: FrameworksNetTests NetworkStackTests
Copy from ag/10826396
Change-Id: Idca9f243a5c955f4caa30921ee520e1a93b0d11a
Merged-In: Idca9f243a5c955f4caa30921ee520e1a93b0d11a
2020-03-31 11:51:05 +00:00
Chalard Jean
f5d1bfd77f Update the NetworkAgent API for council comments
Bug: 152238712
Test: FrameworksNetTests NetworkStackTests
Copy from ag/10824609
Change-Id: I9a2691f783f4449348c3f767568e05620f0b9df5
Merged-In: I9a2691f783f4449348c3f767568e05620f0b9df5
2020-03-31 11:34:42 +00:00
Cody Kesting
22f3171c07 Merge "Invoke onConnectivityReport on registering ConnectivityDiagnostics." am: a365c81bfa am: 7439991aec
Change-Id: Ib65d67f8d9a6e44d03f745cdcb27d7535fd40c58
2020-03-31 00:54:30 +00:00
Cody Kesting
7d4ef21010 Clarify comments for Connectivity Diagnostics reports.
Clarify when
ConnectivityDiagnosticsCallback#onConnectivityReportAvailable will be
invoked. Clarify when NetworkAgentInfo#mConnectivityReport will be null
vs non-null.

Bug: 147849853
Test: atest FrameworksNetTests
Change-Id: I748bd9ded72a34d89f13bd4362d6d4da62b910b8
Merged-In: I748bd9ded72a34d89f13bd4362d6d4da62b910b8
(cherry picked from commit 604dd40cf077f42c2d4b6ff80ff41d89cfbcacee)
2020-03-30 17:14:56 -07:00
Cody Kesting
9c341963ac Sort administrator UIDs for NetworkCapabilities.
Administrator UIDs stored in NetworkCapabilities should be sorted. This
allows for easier equals checks and hashCode computation. Additionally,
duplicate UIDs should be prevented.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: Ia5387ca2ce7c3fcbd04dc7fbff5266f7bcc71694
Merged-In: Ia5387ca2ce7c3fcbd04dc7fbff5266f7bcc71694
(cherry picked from commit 2091bd9059d1d24f8c6bd1cd345361f185cab1ea)
2020-03-30 17:14:44 -07:00
Chalard Jean
0d667c5508 Add combine() and equals() for NetworkCapabilities admin UIDs.
NetworkCapabilities#mAdministratorUids should be checked for equality
when combining NetworkCapabilities. Administrator UIDs should also be
included in NetworkCapabilities equals() and hashCode().

Bug: 147903575
Test: FrameworksNetTests
Change-Id: I803bdec80e27ee80d3a39844c5fb7aed584ab07d
Merged-In: I803bdec80e27ee80d3a39844c5fb7aed584ab07d
(cherry picked from commit 5fad8aa761336012bb228afc3b6f7d42fa274242)
2020-03-30 17:14:33 -07:00
Cody Kesting
fe059d8c30 Invoke onConnectivityReport on registering ConnectivityDiagnostics.
This change updates the behavior for registering
ConnectivityDiagnosticsCallbacks. Now, after a successful register()
call, callbacks will receive cached ConnectivityReports for all
matching, permissioned networks. This allows registrants to be updated
with the network state for their networks without having to wait for the
next network validation.

Bug: 147849853
Test: atest FrameworksNetTests
Change-Id: I924ba8fdcc847f453557021591bde38602fe089c
Merged-In: I924ba8fdcc847f453557021591bde38602fe089c
(cherry picked from commit 95ec0b206b759e1d26bc1dbb2255a515bb24358a)
2020-03-30 17:13:55 -07:00
Cody Kesting
9f8773c32e Clean up handling of NetworkCapabilities#administratorUids.
Update ConnectivityService's check for administrator UIDs to use
ArrayUtils to check for UID inclusion. Update the NetworkCapabilities
annotation on the administrator UIDs field to clarify that it is
NonNull.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: Id630fe9d76aacdaf038fdaa5360f0327520ee0c3
Merged-In: Id630fe9d76aacdaf038fdaa5360f0327520ee0c3
(cherry picked from commit 898496365aa1f3601cdbb305004ad0de11ff6bfc)
2020-03-30 17:13:37 -07:00
Cody Kesting
a365c81bfa Merge "Invoke onConnectivityReport on registering ConnectivityDiagnostics." 2020-03-31 00:06:26 +00:00
Cody Kesting
5c96dc912b Merge "Clean up handling of NetworkCapabilities#administratorUids." am: eb0b80c9e5 am: 2ea7a457b0
Change-Id: Ie2e85fc61fe3765beebcc511f2256bd6b4c37b1f
2020-03-30 22:50:39 +00:00
Cody Kesting
eb0b80c9e5 Merge "Clean up handling of NetworkCapabilities#administratorUids." 2020-03-30 22:04:43 +00:00
Cody Kesting
9a4168bd3b Clarify comments for Connectivity Diagnostics reports.
Clarify when
ConnectivityDiagnosticsCallback#onConnectivityReportAvailable will be
invoked. Clarify when NetworkAgentInfo#mConnectivityReport will be null
vs non-null.

Bug: 147849853
Test: atest FrameworksNetTests
Change-Id: I748bd9ded72a34d89f13bd4362d6d4da62b910b8
2020-03-30 14:51:24 -07:00
Cody Kesting
ec5a0cb0ff Sort administrator UIDs for NetworkCapabilities.
Administrator UIDs stored in NetworkCapabilities should be sorted. This
allows for easier equals checks and hashCode computation. Additionally,
duplicate UIDs should be prevented.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: Ia5387ca2ce7c3fcbd04dc7fbff5266f7bcc71694
2020-03-30 14:51:24 -07:00
Chalard Jean
20e92eca29 Add combine() and equals() for NetworkCapabilities admin UIDs.
NetworkCapabilities#mAdministratorUids should be checked for equality
when combining NetworkCapabilities. Administrator UIDs should also be
included in NetworkCapabilities equals() and hashCode().

Bug: 147903575
Test: FrameworksNetTests
Change-Id: I803bdec80e27ee80d3a39844c5fb7aed584ab07d
2020-03-30 14:27:20 -07:00
Cody Kesting
b77bf707c6 Invoke onConnectivityReport on registering ConnectivityDiagnostics.
This change updates the behavior for registering
ConnectivityDiagnosticsCallbacks. Now, after a successful register()
call, callbacks will receive cached ConnectivityReports for all
matching, permissioned networks. This allows registrants to be updated
with the network state for their networks without having to wait for the
next network validation.

Bug: 147849853
Test: atest FrameworksNetTests
Change-Id: I924ba8fdcc847f453557021591bde38602fe089c
2020-03-30 11:10:46 -07:00
Cody Kesting
7b987276db Clean up handling of NetworkCapabilities#administratorUids.
Update ConnectivityService's check for administrator UIDs to use
ArrayUtils to check for UID inclusion. Update the NetworkCapabilities
annotation on the administrator UIDs field to clarify that it is
NonNull.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: Id630fe9d76aacdaf038fdaa5360f0327520ee0c3
2020-03-30 16:55:21 +00:00
Remi NGUYEN VAN
e3aade0a30 Merge "Create a builder for NetworkCapabilities." 2020-03-30 02:58:45 +00:00
Chalard Jean
ec85550d64 Merge changes from topics "api-fix-networkagent", "networkprovider_api", "satisfiedby" into rvc-dev am: 199c91b659
Change-Id: I041fa5232ac2f653f0ff9070b9bcd924345f9987
2020-03-27 22:56:26 +00:00