Commit Graph

9120 Commits

Author SHA1 Message Date
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
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
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
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
Cody Kesting
95fa8eec8a Merge "Decrement networkRequestPerUid when callbacks are unregistered." 2020-03-31 00:07:01 +00:00
Cody Kesting
77f2293b06 Merge "Invoke onConnectivityReport on registering ConnectivityDiagnostics." 2020-03-31 00:06:26 +00:00
Cody Kesting
c82bde604a Merge "Clean up handling of NetworkCapabilities#administratorUids." am: 7ac175925c am: d30159678b
Change-Id: Ie2e85fc61fe3765beebcc511f2256bd6b4c37b1f
2020-03-30 22:50:39 +00:00
Cody Kesting
d30159678b Merge "Clean up handling of NetworkCapabilities#administratorUids." am: 7ac175925c
Change-Id: I69f1061972af362560a274084c94428b57bd46e8
2020-03-30 22:27:30 +00:00
Cody Kesting
7ac175925c Merge "Clean up handling of NetworkCapabilities#administratorUids." 2020-03-30 22:04:43 +00:00
Cody Kesting
970e77957c 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
2020-03-30 14:51:24 -07:00
Cody Kesting
782d0a044c 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
751d414caf 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
9e70d0d85f 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
0c55a30a9e 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
2020-03-30 11:10:46 -07:00
Cody Kesting
fc14fbea61 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
2020-03-30 11:10:46 -07:00
Cody Kesting
905b475a00 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
61c6b86550 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
Chiachang Wang
6b34f49c99 Merge "Update constructor of NetworkMonitor" am: 42956a037c am: c513ab9b0c
Change-Id: I59f68083d374afc1d0bf38cc6abd5fe4cbe068d1
2020-03-30 09:12:37 +00:00
Chiachang Wang
c513ab9b0c Merge "Update constructor of NetworkMonitor" am: 42956a037c
Change-Id: I5ef9b48946acb83ada644600117c604028a5c0b5
2020-03-30 08:56:34 +00:00
Chiachang Wang
42956a037c Merge "Update constructor of NetworkMonitor" 2020-03-30 08:40:45 +00:00