Commit Graph

8761 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
006ef16b04 Merge "Make LinkPropertiesTest compatible with Q" into rvc-dev am: 75cdb045dc
Change-Id: I756521af50e0176817cc1502e5a5b2ad15979817
2020-04-03 08:17:06 +00:00
Remi NGUYEN VAN
75cdb045dc Merge "Make LinkPropertiesTest compatible with Q" into rvc-dev 2020-04-03 07:52:26 +00:00
Lorenzo Colitti
3143cb6fa3 Merge "Added a new capability for temporarily unmetered network." into rvc-dev am: 0edabc5e4e
Change-Id: I2954f582524903c542a65439fba05af6cc37aa0f
2020-04-03 05:07:14 +00:00
Jack Yu
2bd176d185 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
Lorenzo Colitti
b3792be0fa Merge "Add more tests in LinkPropertiesTests.java" into rvc-dev am: 5f67a3c20f
Change-Id: Icb07eade679f34a7872050ca711aa45ffd11e462
2020-04-02 10:52:46 +00:00
Lorenzo Colitti
5f67a3c20f Merge "Add more tests in LinkPropertiesTests.java" into rvc-dev 2020-04-02 10:35:49 +00:00
Aaron Huang
d2485f672d Make LinkPropertiesTest compatible with Q
CompareResult had been moved from LinkProperties to LinkPropertiesUtils
so this change ignores testCompareResult() on Q and only check
compareAllRoutes() works while android version is at least R.

Bug: 151782584
Test: atest CtsNetTestCasesLatestSdk:LinkPropertiesTest
Merged-In: I38b0d83abf983b3bcc01fc6aea2e5cc307734198
Change-Id: I38b0d83abf983b3bcc01fc6aea2e5cc307734198
2020-04-02 03:30:49 +00:00
Chiachang Wang
c4e9983ed6 Merge "Update constructor of NetworkMonitor" into rvc-dev am: d7df0c13d9
Change-Id: Iea5f995291bdbe3081c8f7ded5bf4f3f50e6c7d1
2020-04-01 09:11:13 +00:00
Lucas Lin
fff26219d7 Add more tests in LinkPropertiesTests.java
Test getAllInterfaceNames(), hasIpv4DefaultRoute(),
hasIpv4DnsServer() and hasIpv6DnsServer().

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:android.net.LinkPropertiesTest

Change-Id: I2bae76dc93e7aa02efe25dca4b6e99692c79135a
Merged-In: Ie77dd7eb5c7ecc763c661e8510f9a308e695e77f
(cherry picked from commit 30a56a5c719c38894b3dfe803d1b58db26cc1c95)
2020-04-01 06:26:59 +00:00
Chiachang Wang
9e16b29fab Update constructor of NetworkMonitor
Remove redundant parameter.

Bug: 152374582
Test: m -j40 ; atest FrameworksNetIntegrationTests
Merged-In: I3a636f0ea5145ac4435e06a9827bb8e01862542d
Change-Id: I3a636f0ea5145ac4435e06a9827bb8e01862542d
2020-04-01 02:12:32 +00:00
Cody Kesting
3cbabe8edb Merge changes I2431a6d2,I9096969a,I748bd9de,Ia5387ca2,I803bdec8, ... into rvc-dev am: aa33c8ca7a
Change-Id: Id83214bd033f56295868f7c54a659a4d4b84fe79
2020-04-01 01:33:46 +00:00
Cody Kesting
bd60162bbb Simplify unregister logic for Connectivity Diagnostics callbacks. am: 482e80d7a8
Change-Id: I6b9541fd562c3e65af65e9b5b754909d96f332fd
2020-04-01 01:33:42 +00:00
Cody Kesting
b073ee6831 Clarify comments for Connectivity Diagnostics reports. am: 96622a7cf5
Change-Id: I9263ddeb7b757e6c147fcf57b5fd9825f2fd3860
2020-04-01 01:33:40 +00:00
Cody Kesting
6eebd1535d Sort administrator UIDs for NetworkCapabilities. am: 28743e99d5
Change-Id: I06d79c338f9994988373f43ab67efc1315596e5c
2020-04-01 01:33:36 +00:00
Chalard Jean
f819ec5c9e Add combine() and equals() for NetworkCapabilities admin UIDs. am: 57f00777b3
Change-Id: I4b52b619cde3b080bfe58f69dacdb0078a11a7e8
2020-04-01 01:33:30 +00:00
Cody Kesting
a106b2e97b Use IBinder as key for ConnectivityDiagnostics storage in CS. am: 14ce0a3349
Change-Id: I9b75e908b217cf518281e1d8471af66022c65667
2020-04-01 01:33:24 +00:00
Cody Kesting
f3e2f8ba30 Decrement networkRequestPerUid when callbacks are unregistered. am: 031b4318d6
Change-Id: I8710a66725a0d09ca652ad8ce6fc7ced0070f647
2020-04-01 01:33:22 +00:00
Cody Kesting
3d50c5696c Invoke onConnectivityReport on registering ConnectivityDiagnostics. am: 1bee2ea867
Change-Id: I20430c60e27b9c3b4210ec037b71accac376ca44
2020-04-01 01:33:19 +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
0e92acefbc Merge "Clean up handling of NetworkCapabilities#administratorUids." into rvc-dev am: 1da99800de
Change-Id: I729db9d97d69a088c272a64d270aa05be474ed87
2020-03-31 18:01:30 +00:00
Cody Kesting
1da99800de Merge "Clean up handling of NetworkCapabilities#administratorUids." into rvc-dev 2020-03-31 17:46:57 +00:00
Benedict Wong
2933f38880 Merge changes I97ba5903,Icd80b368 into rvc-dev am: a7e71febc5
Change-Id: I5f6ac7365512b16597abae5d9f5306a755bb4879
2020-03-31 17:12:33 +00:00
Benedict Wong
69c8858e8a Merge "Automatically set IPsec tunnel interface as up" into rvc-dev am: 61cd22fe3e
Change-Id: Ie0ff250e5ff36b317932053a950e49df9eae2e9f
2020-03-31 17:11:16 +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
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
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
Xiao Ma
0897bef5b2 Merge "Add CTS tests for ApfCapabilities static APIs." into rvc-dev am: ac27736c5b
Change-Id: If3bf3a905dcb466fb01574b6e244c5818c6577a8
2020-03-30 08:06:39 +00:00
Xiao Ma
ac27736c5b Merge "Add CTS tests for ApfCapabilities static APIs." into rvc-dev 2020-03-30 07:46:30 +00:00
Xiao Ma
e43c74d97e Add CTS tests for ApfCapabilities static APIs.
Add tests for getApfEtherTypeBlackList and getApfDrop8023Frames APIs.

Bug: 150640397
Test: atest CtsNetTestCasesLatestSdk:android.net.apf.ApfCapabilitiesTest
      on both of Q and R devices.

Change-Id: I11555934df4b27cbb6b7ddbb81022d8fb7c25e15
Merged-In: I11555934df4b27cbb6b7ddbb81022d8fb7c25e15
(cherry picked from commit 7d51a72487dba5b2747a9de12f50ba2087007264)
2020-03-30 05:41:02 +00:00
TreeHugger Robot
acd7932d24 Merge "Unbreak testStartUsingNetworkFeature_enableHipri failure" into rvc-dev am: 60e3892fec
Change-Id: Ib70529204dab1f6e43dbc46538c90f8fdddc66bc
2020-03-30 04:39:32 +00:00
Mark Chien
41a28cae9d Unbreak testStartUsingNetworkFeature_enableHipri failure
aosp/1261619 break legacy API that only supported for SDK which is
smaller than android M, caller need to have network stack permission
to request network with legacy type. Fix failure by whitelist permission
check for the caller who built with order SDK(< M).

Bug: 152229492
Test: atest CtsTetheringTest
      atest ConnectivityManagerLegacyTest# \
      testStartUsingNetworkFeature_enableHipri

Change-Id: I02504c0eed10ee4e08c8fbf032951022255ba5fa
Merged-In: I367dff0429f26f266282300edc38637b55eece38
(cherry picked from commit b1c8acf0d6ba1fe35d8e81673d2c5c24fa2fea79)
2020-03-30 02:26:57 +00:00
Hall Liu
921f9b4572 Merge changes from topic "phonestatelistener-limit-rvc-dev" into rvc-dev am: 9a5e26ef77
Change-Id: Ic9004aa98a71d52c45c88a5636970f7e156cbca0
2020-03-28 06:55:28 +00:00
Hall Liu
9a5e26ef77 Merge changes from topic "phonestatelistener-limit-rvc-dev" into rvc-dev
* changes:
  Add gating, logging for PhoneStateListener's limit
  Institute limit on PhoneStateListener
2020-03-28 06:48:56 +00:00
Hall Liu
2ca7c9a422 Add gating, logging for PhoneStateListener's limit
Add gating via PlatformCompat and DeviceConfig and logging via
PlatformCompat to the limit instituted on per-process listeners

Fixes: 152074216
Test: atest CtsTelephonyHostCases
Change-Id: I4d6681d90705b68c3349f4124e434a29b50fd3a2
2020-03-27 19:21:51 -07:00
Chalard Jean
bc5149723a Merge changes from topics "api-fix-networkagent", "networkprovider_api", "satisfiedby" into rvc-dev am: f7c2921f91
Change-Id: Ie0cf94ac30f7edd36aaf82344c68a18d13d7a45c
2020-03-27 22:58:45 +00:00
Chalard Jean
2616b2bbb0 Address further API council comments. am: c882f64b3c
Change-Id: I539d05a584c40606f0f27bff06e9585407b53cd8
2020-03-27 22:58:41 +00:00
Chalard Jean
750bd91aa5 Update the NetworkProvider API for council comments am: 4c7368a340
Change-Id: If7798e35b8c8f4ba4b70cedd9689dcf84caf140f
2020-03-27 22:58:34 +00:00
Chalard Jean
f7c2921f91 Merge changes from topics "api-fix-networkagent", "networkprovider_api", "satisfiedby" into rvc-dev
* changes:
  Rename satisfiedBy into canBeSatisfiedBy
  Address further API council comments.
  Update the NetworkProvider API for council comments
2020-03-27 22:50:42 +00:00
Cody Kesting
ede1ab6af0 Merge "Clean up unit testing for ConnectivityDiagnostics." into rvc-dev am: fc0eed5aa6
Change-Id: Icff8ed1cf90927e521c8294aaec8bfdd6a4ccc4d
2020-03-27 19:23:37 +00:00
Cody Kesting
fc0eed5aa6 Merge "Clean up unit testing for ConnectivityDiagnostics." into rvc-dev 2020-03-27 19:09:00 +00:00
Cody Kesting
f4597a69da Merge "Restrict VPN Diagnostics callbacks to underlying networks." into rvc-dev am: 488c8e4734
Change-Id: Ibd8c0920b66899d36058f249904d33fe14ce9504
2020-03-27 18:38:07 +00:00