Commit Graph

9136 Commits

Author SHA1 Message Date
Chalard Jean
89469aba2e [automerger skipped] Update NetworkAgentConfig API for council comments am: e5b9e82f86 am: 0b32491fc4 -s ours
am skip reason: Change-Id Idca9f243a5c955f4caa30921ee520e1a93b0d11a with SHA-1 74fe1c7205 is in history

Change-Id: Icf2ec01fe46cf905b2636d064fd68e2ff9e546e7
2020-04-01 05:58:23 +00:00
Chalard Jean
6e73dd4adc [automerger skipped] Update the NetworkAgent API for council comments am: 7fe99f5dfe am: 39709833c2 -s ours
am skip reason: Change-Id I9a2691f783f4449348c3f767568e05620f0b9df5 with SHA-1 cb4711edd8 is in history

Change-Id: Iac85b28ac13c794999110e7cd54f1816dd298967
2020-04-01 05:58:14 +00:00
Chalard Jean
0b32491fc4 Update NetworkAgentConfig API for council comments am: e5b9e82f86
Change-Id: I195c50ee1db2dd26b7c06f4ecbd6dbccc38895ef
2020-04-01 05:46:58 +00:00
Chalard Jean
39709833c2 Update the NetworkAgent API for council comments am: 7fe99f5dfe
Change-Id: I1337011740d2c34f886a6d2975bd3da24f371bb8
2020-04-01 05:46:50 +00:00
Cody Kesting
fecedcfef7 [automerger skipped] Merge changes I2431a6d2,I9096969a,I748bd9de,Ia5387ca2,I803bdec8, ... into rvc-dev am: aa33c8ca7a -s ours
am skip reason: Change-Id I2431a6d273d0d73432919baf41b4f66397f4b7dc with SHA-1 70897531b8 is in history

Change-Id: Id445e7883fa4aa86f97488535c517471b6c5641f
2020-04-01 01:29:59 +00:00
Cody Kesting
aa33c8ca7a Merge changes I2431a6d2,I9096969a,I748bd9de,Ia5387ca2,I803bdec8, ... into rvc-dev
* changes:
  Update CS helper for clearing NetworkCapabilities UIDs.
  Simplify unregister logic for Connectivity Diagnostics callbacks.
  Clarify comments for Connectivity Diagnostics reports.
  Sort administrator UIDs for NetworkCapabilities.
  Add combine() and equals() for NetworkCapabilities admin UIDs.
  Use IBinder as key for ConnectivityDiagnostics storage in CS.
  Decrement networkRequestPerUid when callbacks are unregistered.
  Invoke onConnectivityReport on registering ConnectivityDiagnostics.
2020-04-01 01:13:11 +00:00
Cody Kesting
e6bb4dae60 Merge "Update CS helper for clearing NetworkCapabilities UIDs." am: 0a45ad1dc1 am: f886aaf81d
Change-Id: I4560ffd4558288854e2cb493f6e82a95bc45a88d
2020-03-31 20:45:25 +00:00
Cody Kesting
cd310a3cbf Merge "Simplify unregister logic for Connectivity Diagnostics callbacks." am: b2582a32e8 am: e6a16e1466
Change-Id: I50aa039a875be2fcbcb0d82c384d4cbd585a951d
2020-03-31 20:45:06 +00:00
Cody Kesting
f886aaf81d Merge "Update CS helper for clearing NetworkCapabilities UIDs." am: 0a45ad1dc1
Change-Id: I6769788d7c0fade7bcab912c6a68f91161b25992
2020-03-31 20:33:17 +00:00
Cody Kesting
e6a16e1466 Merge "Simplify unregister logic for Connectivity Diagnostics callbacks." am: b2582a32e8
Change-Id: I798827a3505f460a5baf633ee2d3fb2422d65137
2020-03-31 20:32:59 +00:00
Cody Kesting
0a45ad1dc1 Merge "Update CS helper for clearing NetworkCapabilities UIDs." 2020-03-31 20:18:17 +00:00
Cody Kesting
b2582a32e8 Merge "Simplify unregister logic for Connectivity Diagnostics callbacks." 2020-03-31 20:18:01 +00:00
Cody Kesting
6a974a86c4 Merge "Clarify comments for Connectivity Diagnostics reports." am: 71016c103f am: 0dcfdb77be
Change-Id: I4e6452b4875a8c3e3739dea4d3bc281a006156eb
2020-03-31 18:17:26 +00:00
Cody Kesting
0b68045244 Merge "Sort administrator UIDs for NetworkCapabilities." am: 92e4bb4455 am: c475e2912b
Change-Id: I453f81bcb7c426ab4b529acce5c32c502a29331b
2020-03-31 18:17:14 +00:00
Cody Kesting
3e23762597 Merge "Add combine() and equals() for NetworkCapabilities admin UIDs." am: 1bf4b1f47b am: cfd382a47c
Change-Id: Ic8fc22f0eb47836053fc6b9423018c16ae46ef46
2020-03-31 18:16:18 +00:00
Cody Kesting
0dcfdb77be Merge "Clarify comments for Connectivity Diagnostics reports." am: 71016c103f
Change-Id: If353d65d28842c6eb621a8881e9279a018fa9ffa
2020-03-31 18:02:08 +00:00
Cody Kesting
c475e2912b Merge "Sort administrator UIDs for NetworkCapabilities." am: 92e4bb4455
Change-Id: I4cfb80b1eb9edc5ad90a1aff957a0f6d1f3eb522
2020-03-31 18:01:47 +00:00
Cody Kesting
1d3aa104da [automerger skipped] Merge "Clean up handling of NetworkCapabilities#administratorUids." into rvc-dev am: 1da99800de -s ours
am skip reason: Change-Id Id630fe9d76aacdaf038fdaa5360f0327520ee0c3 with SHA-1 61c6b86550 is in history

Change-Id: Ic3e78575a0b50cfd6ca8e309461214ba4c72b818
2020-03-31 18:01:33 +00:00
Cody Kesting
cfd382a47c Merge "Add combine() and equals() for NetworkCapabilities admin UIDs." am: 1bf4b1f47b
Change-Id: Ic8b353d233eda759100952e126d77e9dd48005e5
2020-03-31 18:01:24 +00:00
Cody Kesting
1da99800de Merge "Clean up handling of NetworkCapabilities#administratorUids." into rvc-dev 2020-03-31 17:46:57 +00:00
Cody Kesting
71016c103f Merge "Clarify comments for Connectivity Diagnostics reports." 2020-03-31 17:43:44 +00:00
Cody Kesting
92e4bb4455 Merge "Sort administrator UIDs for NetworkCapabilities." 2020-03-31 17:43:02 +00:00
Cody Kesting
1bf4b1f47b Merge "Add combine() and equals() for NetworkCapabilities admin UIDs." 2020-03-31 17:42:18 +00:00
Cody Kesting
b3541c0513 Merge "Use IBinder as key for ConnectivityDiagnostics storage in CS." am: aa53148caf am: f580595f99
Change-Id: Ia63d6ab70027e4d1b389a05f3d46162a68747e77
2020-03-31 17:35:09 +00:00
Cody Kesting
f580595f99 Merge "Use IBinder as key for ConnectivityDiagnostics storage in CS." am: aa53148caf
Change-Id: Ife76fa15b2dab71021251846aa69e9090f809941
2020-03-31 17:10:51 +00:00
Benedict Wong
1a7637bf08 [automerger skipped] Merge changes I97ba5903,Icd80b368 into rvc-dev am: a7e71febc5 -s ours
am skip reason: Change-Id I97ba5903b3cc1ed6a21c706ed3d78bd8ecbeee0c with SHA-1 ff367b870e is in history

Change-Id: I5963d5e7306cff4a1c4cf4bca483a40536f73e14
2020-03-31 17:04:15 +00:00
Benedict Wong
a3f620166b [automerger skipped] Merge "Automatically set IPsec tunnel interface as up" into rvc-dev am: 61cd22fe3e -s ours
am skip reason: Change-Id I55b63a748463a388e1e2991d2d5d6b3023545e60 with SHA-1 5a09daaa7f is in history

Change-Id: I10aae07c044231d9b6fcdd61488a146b21d8dd8f
2020-03-31 17:03:21 +00:00
Cody Kesting
aa53148caf Merge "Use IBinder as key for ConnectivityDiagnostics storage in CS." 2020-03-31 17:00:03 +00:00
Benedict Wong
a7e71febc5 Merge changes I97ba5903,Icd80b368 into rvc-dev
* changes:
  Make VpnProfile.maxMtu default value match Ikev2VpnProfile
  Add negotiated DNS servers to VPN config
2020-03-31 16:52:04 +00:00
Benedict Wong
61cd22fe3e Merge "Automatically set IPsec tunnel interface as up" into rvc-dev 2020-03-31 16:51:58 +00:00
Chalard Jean
e5b9e82f86 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
7fe99f5dfe 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
Benedict Wong
fad1dfe2a3 Make VpnProfile.maxMtu default value match Ikev2VpnProfile
This change corrects the VpnProfile's maxMtu defaults to match that of
the Ikev2VpnProfile. 1400 is too high as a default, and Settings will
run into an issue here quite often.

Bug: 152573931
Test: FrameworksNetTests passing
Change-Id: I97ba5903b3cc1ed6a21c706ed3d78bd8ecbeee0c
Merged-In: I97ba5903b3cc1ed6a21c706ed3d78bd8ecbeee0c
(cherry picked from commit d0a44f49df01a1aefa505ee90c9806dee135b4e4)
2020-03-30 22:59:17 -07:00
Benedict Wong
8ba3905c49 Merge "Make VpnProfile.maxMtu default value match Ikev2VpnProfile" am: 548e1ecf4a am: 02b5ed5a6b
Change-Id: I51a3ec89f215dd937357e5a77f679a063a7b8a18
2020-03-31 03:06:19 +00:00
Benedict Wong
02b5ed5a6b Merge "Make VpnProfile.maxMtu default value match Ikev2VpnProfile" am: 548e1ecf4a
Change-Id: I525f947ce90d44c286a61d05297dd205e706a319
2020-03-31 02:37:52 +00:00
Benedict Wong
548e1ecf4a Merge "Make VpnProfile.maxMtu default value match Ikev2VpnProfile" 2020-03-31 02:22:54 +00:00
Cody Kesting
6aceab2cd0 Merge "Decrement networkRequestPerUid when callbacks are unregistered." am: 95fa8eec8a am: 3dcaec1201
Change-Id: I10185578b859218680168cffdfcd8cd0f24de09c
2020-03-31 00:55:06 +00:00
Cody Kesting
5c72dc9cd1 Merge "Invoke onConnectivityReport on registering ConnectivityDiagnostics." am: 77f2293b06 am: c3a02d033f
Change-Id: Ib65d67f8d9a6e44d03f745cdcb27d7535fd40c58
2020-03-31 00:54:30 +00:00
Cody Kesting
f98655069e Update CS helper for clearing NetworkCapabilities UIDs.
NetworkCapabilities needs to have its UIDs cleared (UID ranges, owner
UID, and administrator UIDs) before it can be shared with apps via
ConnectivityDiagnosticsCallback invocations. The previous helper used
for clearing these values mutated the provided NetworkCapabilities. This
is updated to instead return a sanitized copy of the provided
NetworkCapabilities

Bug: 148942124
Test: atest FrameworksNetTests
Change-Id: I2431a6d273d0d73432919baf41b4f66397f4b7dc
Merged-In: I2431a6d273d0d73432919baf41b4f66397f4b7dc
(cherry picked from commit 45bbc4f6ac910a2ea87eb6b2197e34db50d3ada8)
2020-03-30 17:46:59 -07:00
Cody Kesting
70897531b8 Update CS helper for clearing NetworkCapabilities UIDs.
NetworkCapabilities needs to have its UIDs cleared (UID ranges, owner
UID, and administrator UIDs) before it can be shared with apps via
ConnectivityDiagnosticsCallback invocations. The previous helper used
for clearing these values mutated the provided NetworkCapabilities. This
is updated to instead return a sanitized copy of the provided
NetworkCapabilities

Bug: 148942124
Test: atest FrameworksNetTests
Change-Id: I2431a6d273d0d73432919baf41b4f66397f4b7dc
2020-03-30 17:40:49 -07:00
Cody Kesting
3dcaec1201 Merge "Decrement networkRequestPerUid when callbacks are unregistered." am: 95fa8eec8a
Change-Id: I1ac0276aa434748dbb22b82f0c4aca917875b168
2020-03-31 00:26:01 +00:00
Cody Kesting
c3a02d033f Merge "Invoke onConnectivityReport on registering ConnectivityDiagnostics." am: 77f2293b06
Change-Id: I2d3e6be0923ec2a0d3197f71fb2d3149c40a5eea
2020-03-31 00:25:24 +00:00
Cody Kesting
482e80d7a8 Simplify unregister logic for Connectivity Diagnostics callbacks.
ConnectivityService is updated to simplify the logic for unregistering
ConnectivityDiagnosticsCallback instances. This change removes the given
callback from ConnectivityService's data structure. If the callback was
not registered with ConnectivityService, it is logged and the function
exits; else, the unregister() operation continues.

Bug: 150867635
Test: atest FrameworksNetTests
Change-Id: I9096969a1bf33da72b117f5bbc88257df805e688
Merged-In: I9096969a1bf33da72b117f5bbc88257df805e688
(cherry picked from commit f047313940b5af49a3b0e72a5f2d94fc1dda9c9d)
2020-03-30 17:15:09 -07:00
Cody Kesting
96622a7cf5 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
28743e99d5 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
57f00777b3 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
14ce0a3349 Use IBinder as key for ConnectivityDiagnostics storage in CS.
This change updates ConnectivityService to use IBinder instances as keys
when storing ConnectivityDiagnosticsCallbacks.

When storing ConnectivityDiagnosticsCallbacks in ConnectivityService,
the IConnectivityDiagnsoticsCallback is used as the key for
ConnectivityService.mConnectivityDiagnosticsCallbacks. However,
IConnectivityDiagnosticsCallback instances are received as different
objects. This causes them to produce different hashCode() values, so
attempts to remove an IConnectivityDiagnosticsCallback fail.

Bug: 150867635
Test: atest FrameworksNetTests
Change-Id: Ib99e68d5ae47fa27e12428f9a60a2c1204ac59a2
Merged-In: Ib99e68d5ae47fa27e12428f9a60a2c1204ac59a2
(cherry picked from commit c7c6a4ac12beb7c216076958612869426da06da0)
2020-03-30 17:14:20 -07:00
Cody Kesting
031b4318d6 Decrement networkRequestPerUid when callbacks are unregistered.
ConnectivityDiagnosticsCallbacks are tied to NetworkRequestInfo objects
when registered with the platform. Each NetworkRequestInfo is tied to a
specific uid, and ConnectivityService enforces a limit on the number of
network requests that can be associated with each uid.

When ConnectivityDiagnosticsCallbacks are unregistered from the
platform, their NetworkRequestInfo is freed and the number of network
requests per the user's uid should be decremented.

Bug: 150802582
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: Ia5ed39c1d8e6221cd402be4f8baf69fa643a6113
Merged-In: Ia5ed39c1d8e6221cd402be4f8baf69fa643a6113
(cherry picked from commit 662076b1a7c0f064fa746fc7b8d3204c966c8e48)
2020-03-30 17:14:07 -07:00
Cody Kesting
1bee2ea867 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
5a4b20d623 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