summaryrefslogtreecommitdiff
path: root/tests/unit/java/com/android/server/connectivity
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-13.0.0_r16' into t13.0Semavi Ulusoy2022-12-172-15/+92
|\ | | | | | | | | | | Android 13.0.0 Release 16 (TQ1A.221205.011) Change-Id: I11c23ee1f0766b6c32efe2df223c9615a30752d2
| * Update test on calling getAppExclusionList with restricted userchiachangwang2022-09-221-1/+2
| | | | | | | | | | | | | | | | Bug: 247344442 Test: atest VpnTest Change-Id: I3b847f13162f8702013b23cabefce8d98b62f5c6 (cherry picked from commit 8dae9343bbaa5a27324c424dbfddb7a354db2d92) Merged-In: I3b847f13162f8702013b23cabefce8d98b62f5c6
| * Merge "fix clat on restricted networks" into tm-qpr-devMaciej Żenczykowski2022-08-181-6/+6
| |\
| | * fix clat on restricted networksMaciej Żenczykowski2022-08-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is the case for example when a tethering dun is in use Bug: 235523181 Bug: 241055859 Change-Id: Ie261db0329179ff7f92c61202af30ab55130ae03 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> (cherry picked from commit ef4b1bc50f81b8d321a868c31246883ebc1f10d2) Merged-In: Ie261db0329179ff7f92c61202af30ab55130ae03
| * | Update the prefix of VPN_APP_EXCLUDED in the testchiachangwang2022-08-181-1/+1
| |/ | | | | | | | | | | | | | | | | | | Update the string according to the change in Vpn.java Bug: 237345836 Test: atest FrameworksNetTests Change-Id: I9bfe0a1fad29ba1435eeb8b8b2cffa9d385b1cb5 (cherry picked from commit 9460f45c047e49aff7e83ea3496476dd21752e0e) Merged-In: I9bfe0a1fad29ba1435eeb8b8b2cffa9d385b1cb5
| * Test that VpnManager events will never be sent to Settings VPNslucaslin2022-07-271-0/+25
| | | | | | | | | | | | | | | | | | | | | | This change tries to mock there is an IkeTimeoutException when Settings VPN is establishing connection and see if the VpnManager events will be sent to Settings VPN or not. Bug: 236315805 Test: atest FrameworksNetTests:VpnTest Change-Id: I1706ceb129ef95f44d45754665b9dbcf9b6fdfd4 Merged-In: I0ee4a70ded4937a1573d34cddab552f762e4fc18
| * Add test for startPptpRemi NGUYEN VAN2022-07-131-0/+53
| | | | | | | | | | | | | | | | | | | | | | The test verifies arguments used to start the daemon Bug: 201660636 Test: atest VpnTest Change-Id: I0854fbeaf1a3e3554c157fde227a7bfa187b1013 Merged-In: I0854fbeaf1a3e3554c157fde227a7bfa187b1013 (cherry picked from commit 522cea7d4eca8b0c80b78fa187e6b0f24e10994d) Merged-In: I0854fbeaf1a3e3554c157fde227a7bfa187b1013
| * Test recoverable Ikev2 errorslucaslin2022-06-101-7/+30
| | | | | | | | | | | | | | | | | | | | | | Test if retry mechanism is working or not when there is a recoverable Ikev2 error. Bug: 229350078 Test: atest FrameworksNetTests:VpnTest Change-Id: I5e881c6b42aeb98adce598587e2a7e49be7d9643 (cherry picked from commit adb56e94a5fc3c61af10780713f0b7a4f163c965) Merged-In: I5e881c6b42aeb98adce598587e2a7e49be7d9643
* | Bypass VPN lockdown for clat initializationt-m-w2022-11-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows clat to initialize properly when VPNs are configured with "Block connections without VPN", rather than to error out with "no IPv6 addresses were available for clat". This issue primarily affects particular mobile networks configured with NAT64 (without direct IPv4 connectivity). Issue: calyxos#1288 Bug: 255040839 Change-Id: I4a8ee0295e0f5d1e330f7529856347b8bd10360c
* | Test that VpnManager events will never be sent to Settings VPNslucaslin2022-08-191-0/+25
|/ | | | | | | | | | | | | | This change tries to mock there is an IkeTimeoutException when Settings VPN is establishing connection and see if the VpnManager events will be sent to Settings VPN or not. Bug: 236315805 Test: atest FrameworksNetTests:VpnTest Change-Id: I1706ceb129ef95f44d45754665b9dbcf9b6fdfd4 Merged-In: I1706ceb129ef95f44d45754665b9dbcf9b6fdfd4 Merged-In: I0ee4a70ded4937a1573d34cddab552f762e4fc18 (cherry picked from commit dbbeb9937076fe6b6a7167a6e9e6bc1ad1ff5a76) Merged-In: I1706ceb129ef95f44d45754665b9dbcf9b6fdfd4
* Verify if the VPN app has been added into power save whilte listlucaslin2022-06-031-1/+34
| | | | | | | | Bug: 234104087 Test: atest FrameworksNetTests:VpnTest Change-Id: I2aa99b8ea8dbe668a45782f50a4a0ac82e72b7a2 (cherry picked from commit 802fa5d0ec0642573951e93e7106f3b809ac4aff) Merged-In: I2aa99b8ea8dbe668a45782f50a4a0ac82e72b7a2
* Merge changes from topic "vpnmanager-events-T" into tm-devLorenzo Colitti2022-06-021-9/+80
|\ | | | | | | | | | | * changes: Test VpnManager event for CATEGORY_EVENT_NETWORK_ERROR Test VpnManager event for CATEGORY_EVENT_IKE_ERROR
| * Test VpnManager event for CATEGORY_EVENT_NETWORK_ERRORlucaslin2022-05-281-6/+53
| | | | | | | | | | | | | | | | Bug: 191413541 Test: atest FrameworksNetTests:VpnTest Change-Id: Idffd5f5f8fc6614281f3fb0884228a797d783fe3 (cherry picked from commit cfec723ef9b7b82586192ee106e0efab52640bc0) Merged-In: Idffd5f5f8fc6614281f3fb0884228a797d783fe3
| * Test VpnManager event for CATEGORY_EVENT_IKE_ERRORlucaslin2022-05-281-9/+33
| | | | | | | | | | | | | | | | Bug: 191413541 Test: atest FrameworksNetTests:VpnTest Change-Id: Iebc0ac281eb03fac9626c64e44cdd14be1462d89 (cherry picked from commit 827b44daeaec3298429d4e031839e55b864c4bb3) Merged-In: Iebc0ac281eb03fac9626c64e44cdd14be1462d89
* | Add unit test for MultipathPolicyTrackerJunyu Lai2022-05-301-7/+49
|/ | | | | | | | | | This CL adds unit test to test onThresholdReached event would unregister and re-register usage callback. Ignore-AOSP-First: Urgent fix Test: MultipathPolicyTrackerTest#testOnThresholdReached Bug: 233733267 Change-Id: I6e43ae93055009d91b0795a4466f2c02f4403c0a
* Test VpnManager event for CATEGORY_EVENT_ALWAYS_ON_STATE_CHANGEDlucaslin2022-05-231-13/+82
| | | | | | | | Bug: 225010642 Test: atest FrameworksNetTests:VpnTest Change-Id: I078be4e00470efd9d7a2a87b40919116b99c83b8 (cherry picked from commit 0772c169b59e0536a68486a921f9144c5732faff) Merged-In: I078be4e00470efd9d7a2a87b40919116b99c83b8
* Test VpnManager event for CATEGORY_EVENT_DEACTIVATED_BY_USERlucaslin2022-05-231-27/+92
| | | | | | | | Bug: 191413541 Test: atest FrameworksNetTests:VpnTest Change-Id: Idc876275b88c2f4ddeb85c43d37d5f657b0f307b (cherry picked from commit c5bf088ced4c729c5a11c4d29e2c0bb9077a4c14) Merged-In: Idc876275b88c2f4ddeb85c43d37d5f657b0f307b
* Block incoming packets in VPN Lockdown mode.Motomu Utsumi2022-05-171-14/+190
| | | | | | | | | | | | | | | Currently, even when VPN Lockdown mode is enabled, incoming packets are not dropped if VPN is not connected. This commit fixed this issue. After this commit, If VPN Lockdown mode is enabled, incoming packets are dropped regardless of the VPN connectivity. Bug: 206482423 Test: atest TrafficControllerTest ConnectivityServiceTest PermissionMonitorTest Change-Id: If52ece613c8aac1073355e43b6fb9cb3fcc87d1d (cherry picked from commit b08654ca0450d021da709a762ab509a8d4f87d40) Merged-In: If52ece613c8aac1073355e43b6fb9cb3fcc87d1d
* Address leftover commentsChiachang2022-05-131-21/+27
| | | | | | | | | | | | | | This is a follow-up commit from aosp/2076483. Mainly to update: 1. Update the hex string to human understandable code instead of byte code. 2. Use IgnoreUpTo() to do the SDK check 3. Avoid relying on the code being tested Bug: 192078259 Test: atest FrameworksNetTests Change-Id: I8973d248a1d30fdcb597677dbf051e146041f905 (cherry picked from commit a023f88193c62b78afc0508865c8961863c9efda) Merged-In: I8973d248a1d30fdcb597677dbf051e146041f905
* Test [set|get]AppExclusionListchiachangwang2022-05-131-0/+60
| | | | | | | | Bug: 192078259 Test: atest FrameworksNetTests Change-Id: Iee81d84b4127420121ce2d5a7defc3dbe34b6cde (cherry picked from commit 218d5652de980cb2834468725e4b5999f0373582) Merged-In: Iee81d84b4127420121ce2d5a7defc3dbe34b6cde
* Modify VPN unit tests to include SDK sandbox UIDs.Martijn Coenen2022-05-121-19/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | VPN configurations in T should automatically include the corresponding SDK sandbox UID of an application. The existing tests used a UID range outside the regular application range, which means the new sandbox UIDs wouldn't be tested. Modified the UIDs to run in the regular UID range of [10000, 19999]. Changed the tests to include the SDK sandbox UID where necessary. Also, changed the entire class to only run on T+, since that is the only place where the SDK sandbox UIDs will be added. Since VPN code is not mainline updatable, having coverage on earlier releases doesn't really help anyway. Finally, fixed up testNetworkBlockedStatusAlwaysOnVpn() in ConnectivityServiceTest, and only have that run on T+ for the same reasons. Bug: 225317905 Test: atest VpnTest Test: atest ConnectivityServiceTest Change-Id: I83009344c270e520ac8ad1558c067cf7e46b1d2e Merged-In: I83009344c270e520ac8ad1558c067cf7e46b1d2e
* adjust for new T bpfloader net_shared locationMaciej Żenczykowski2022-04-231-2/+2
| | | | | | | | | | (this is safe because on pre-T none of these maps and programs are mainlined and thus safe to access from mainline code anyway) Test: TreeHugger, manual Bug: 218408035 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I23e565d665247f33e084978890a1ee8ffe0fe568
* [CLATJ#27] Use ClatdCoordinator since T+ devicesHungming Chen2022-04-211-16/+61
| | | | | | | | | | | | | | | | | | | | | | | - For clatd start and stop, use ClatdCoordinator on T+ and Netd on S- - Fix the unit test for T+ and S- devices Note that mokito.verify(.., times(1)) is replaced by verify(..) because times(1) is the default and can be omitted. See verify in mockito/src/main/java/org/mockito/Mockito.java Note that this commit needs to be merged with aosp/1956072. Bug: 212345928 Test: atest FrameworksNetTests manual test 1. Connect to ipv6-only wifi. 2. Try IPv4 traffic. $ ping 8.8.8.8 3. Check bpf entries are added 4. Disconnect from ipv6-only wifi. 5. Check bpf entries are removed 6. testipv4.com shows 10/10 Change-Id: I7dfda6eec19de94e4258971effcd8a1210542473
* Merge "Save appIds permissions for each user"Natasha Lee2022-04-121-1/+231
|\
| * Save appIds permissions for each userpaulhu2022-04-121-1/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PermissionMonitor does not store any information regarding traffic permission. It just checks permission from each package and sends the result to netd. In addition, bpf can store traffic permissions for appIds only because of memory limitations. However, there is a mistaken permission overwriting when different packages are installed on multi-user. Because PermissionMonitor updates appIds traffic permissions to netd from each user, so the permission result will depend on the latest user state. To fix the problem, save the traffic permissions by each user and appId on PermissionMonitor. An appId has a permission if and only if at least one uid in that appId has that permission. bug: 224775316 Test: atest FrameworksNetTests CtsNetTestCases \ CtsNetTestCasesUpdateStatsPermission \ CtsNetTestCasesInternetPermission Change-Id: Ieb01fb21f6201a58723eb7e6446b127627be2c0e
* | ClatCoordinator: use Java class TcUtils to detach programHungming Chen2022-03-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This a preparation to replace duplicated native functions with the existing Java class. Bug: 221213090 Test: atest FrameworksNetTests Test: manual test Steps: 1. Connect to IPv6-only wifi 2. Check tc filter on wlan0 and v4-wlan0 $ adb shell tc filter show dev wlan0 ingress filter protocol ipv6 pref 4 bpf chain 0 filter protocol ipv6 pref 4 bpf chain 0 handle 0x1 prog_clatd_schedcls_ingress6_clat_ether:[*fsobj] direct-action not_in_hw id 23 tag 40918e0675598c8d $ adb shell tc filter show dev v4-wlan0 egress filter protocol ip pref 4 bpf chain 0 filter protocol ip pref 4 bpf chain 0 handle 0x1 prog_clatd_schedcls_egress4_clat_rawip:[*fsobj] direct-action not_in_hw id 26 tag 5d0057eab14480b7 $ adb shell tc filter show dev wlan0 egress (empty) $ adb shell tc filter show dev v4-wlan0 ingress (empty) 3. Disconnect from wifi 4. Check tc filter on wlan0 and v4-wlan0 $ adb shell tc filter show dev wlan0 ingress (empty) $ adb shell tc filter show dev v4-wlan0 egress (empty) $ adb shell tc filter show dev wlan0 egress (empty) $ adb shell tc filter show dev v4-wlan0 ingress (empty) Change-Id: Iaa67d5ae7c867d791d5f92a70a54bf549085053a
* | ClatCoordinator: use Java class TcUtils to attach programHungming Chen2022-03-311-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This a preparation to replace duplicated native functions with the existing Java class. Bug: 221213090 Test: atest FrameworksNetTests Test: manual test Steps: 1. Connect to IPv6-only wifi 2. Check tc filter on wlan0 and v4-wlan0 $ adb shell tc filter show dev wlan0 ingress filter protocol ipv6 pref 4 bpf chain 0 filter protocol ipv6 pref 4 bpf chain 0 handle 0x1 prog_clatd_schedcls_ingress6_clat_ether:[*fsobj] direct-action not_in_hw id 23 tag 40918e0675598c8d $ adb shell tc filter show dev v4-wlan0 egress filter protocol ip pref 4 bpf chain 0 filter protocol ip pref 4 bpf chain 0 handle 0x1 prog_clatd_schedcls_egress4_clat_rawip:[*fsobj] direct-action not_in_hw id 26 tag 5d0057eab14480b7 $ adb shell tc filter show dev wlan0 egress (empty) $ adb shell tc filter show dev v4-wlan0 ingress (empty) Change-Id: Id4edbfd87de8f9c5d2fa483b2024718b484cb044
* | ClatCoordinator: use Java class BpfMap to remove clat ruleHungming Chen2022-03-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This a preparation to replace duplicated native functions with the existing Java class. Bug: 221213090 Test: atest FrameworksNetTests Test: manual check Steps: 1. Connect wlan and check map content {iface index, v4addr, v6addr, pfx96} manually after clat started. $ adb shell dumpsys netd ClatdController BPF ingress map: iif(iface) nat64Prefix v6Addr -> v4Addr oif(iface) 47(wlan0) 64:ff9b::/96 2a00:79e1:abc:6f02:2479:2f51:25a9:28f1 -> 192.0.0.4 53(v4-wlan0) BPF egress map: iif(iface) v4Addr -> v6Addr nat64Prefix oif(iface) 53(v4-wlan0) 192.0.0.4 -> 2a00:79e1:abc:6f02:2479:2f51:25a9:28f1 64:ff9b::/96 47(wlan0) ether 2. Disconnect wlan and check the bpf map is removed. $ adb shell dumpsys netd ClatdController BPF ingress map: iif(iface) nat64Prefix v6Addr -> v4Addr oif(iface) BPF egress map: iif(iface) v4Addr -> v6Addr nat64Prefix oif(iface) Change-Id: Ia0c90c7104c4a42d34a28a5ddf3cf13a289f8c76
* | ClatCoordinator: use Java class BpfMap to add clat ruleHungming Chen2022-03-311-2/+40
|/ | | | | | | | | | | | | | | | | | | | | | | | | This a preparation to replace duplicated native functions with the existing Java class. Bug: 221213090 Test: atest FrameworksNetTests Test: check map content {iface index, v4addr, v6addr, pfx96} manually. The map fileds are the same as "ip addr" and clatd logging. $ adb shell dumpsys netd ClatdController BPF ingress map: iif(iface) nat64Prefix v6Addr -> v4Addr oif(iface) 47(wlan0) 64:ff9b::/96 2a00:79e1:abc:6f02:f9e1:8c2d:604e:bc06 -> 192.0.0.4 53(v4-wlan0) BPF egress map: iif(iface) v4Addr -> v6Addr nat64Prefix oif(iface) 53(v4-wlan0) 192.0.0.4 -> 2a00:79e1:abc:6f02:f9e1:8c2d:604e:bc06 64:ff9b::/96 47(wlan0) ether $ adb shell ip addr 47: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 .. 53: v4-wlan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1472 .. 03-14 18:35:04.822 30852 30852 I clatd : Starting clat version 1.5 on wlan0 plat=64:ff9b:: v4=192.0.0.4 v6=2a00:79e1:abc:6f02:f9e1:8c2d:604e:bc06 Change-Id: I91d0cb6e76c4ef7bacf91b996786308ff4918f35
* Merge "Revert "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator.""Michael Groover2022-03-311-8/+5
|\
| * Revert "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator."Michael Groover2022-03-231-8/+5
| | | | | | | | | | | | | | | | | | This reverts commit 7569d5144682d48467b59693928ec10bc6f6eb80. Reason for revert: ag/17318348 moved the declaration of the protected-broadcasts from the telephony package to the platform's manifest, so a flag is no longer required when registering for these. In addition, ag/17307852 is syncing the behavior of unexported runtime receivers with that of manifest receivers by limiting the UIDs that can broadcast to these receivers to the root and system UIDs; with the RECEIVER_NOT_EXPORTED flag from this commit, these receivers would no longer be able to receive these broadcasts when sent from the telephony UID. Bug: 225999840 Change-Id: Ifb15506434edabdfacf84c302881d0cf97d3add8
* | Don't throw in FullScore#policyNameOf.Lorenzo Colitti2022-03-291-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code is correct on userdebug builds, but it is dangerous on user builds because proguard might strip out the POLICY_* constants and that would lead to crashes. For now just log a wtf if an invalid policy name is found. A better solution would be to make MessageUtils robust to this problem, e.g., by having it store the SparseArray internally and providing getters that do not throw, instead of the current behaviour that returns the SparseArray. That is left to a future CL. Fix: 227161413 Test: atest FullScoreTest Change-Id: I68b69ee9dd84773018e62c9a8f43e754ae04c486
* | Merge "ClatCoordinator: wrap clatd information"Nucca Chen2022-03-221-0/+20
|\ \
| * | ClatCoordinator: wrap clatd informationHungming Chen2022-03-221-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation for accessing BPF program and map from existing Java class. The new class ClatdTracker stores the clatd information for forking clatd, accessing BPF maps and attaching BPF programs. Using an object is easier to pass all required parameters and reuse known resource. Also refactor existing function and rename existing variables for this commit. Bug: 221213090 Test: atest FrameworksNetTests Change-Id: I02ea889de89329c52710726fbcf1d2eac61707d7
* | | Merge "Setup permissions for SDK sandbox UIDs."Martijn Coenen2022-03-181-1/+55
|\ \ \
| * | | Setup permissions for SDK sandbox UIDs.Martijn Coenen2022-03-151-1/+55
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications may have an additional SDK sandbox process that should run with the same network policy as the app itself. There is a 1:1 mapping between appId and the SDK sandbox process that belongs to it; use that mapping to set the same policy for SDK sandbox processes as for the app that they belong to. Bug: 215012578 Test: atest com.android.server.PermissionMonitorTest Change-Id: Ibd2ada09c94d46e048f5731b90a721d8e85d3289
* / / Use int array for included and excluded uidsSooraj Sasindran2022-03-161-0/+51
|/ / | | | | | | | | | | | | | | | | Use int array for included and excluded uids so that uses same data type as in PreferentialNetworkServiceConfig Bug: 217365439 Test: ran connectivity service unit tests Change-Id: I9ac7e6498df2fd20b8397b2c110296e019c7389e
* | Merge "Merge Android 12L"Xin Li2022-03-081-0/+32
|\ \
| * \ Merge changes Ib1cd342a,Iab23d414 am: 1c5ce5542aTreehugger Robot2022-02-221-2/+7
| |\ \ | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1991622 Change-Id: I3aab26bc9351e7dd065071b11d58ef9be7224a92
| * \ \ Merge sc-v2-dev-plus-aosp-without-vendor@8084891Xin Li2022-02-111-0/+32
| |\ \ \ | | |_|/ | |/| | | | | | | | | | | | | | Bug: 214455710 Merged-In: I5894450f3089b2ea105722a18ddf8f1eed1c28a0 Change-Id: If2045705da821c90705f7dd1e6944c0bb92e3289
| | * | Merge changes from topic "ms17-multipath" am: bc1f44adb0 am: 31028206daJunyu Lai2022-01-071-9/+23
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1930833 Change-Id: I9263c1ede3fd0558c269ce0aeb5acd941f971860
| | * \ \ [MS17.2] Fix remaining daily budget assertion am: eaa58de991 am: e09d39d37eJunyu Lai2022-01-071-7/+10
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1930832 Change-Id: Id8834e89326119fac5bbf10b94d6e62b8e5eb1f8
| | * \ \ \ [conflict] Merge "Add test for Vpn#prepare()" into sc-dev am: f89a629776 am: ↵Lucas Lin2021-12-231-0/+32
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 66737a8c5d Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15606164
| | | * | | | Add test for Vpn#prepare()lucaslin2021-12-221-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add test for Vpn#prepare() to check if the SecurityException will be thrown when the caller is not the SYSTEM_UID and doesn't have CONTROL_VPN permission and its package doesn't match the oldPackage or the newPackage. Ignore-AOSP-First: It's a part of security patches. Bug: 191276656 Test: atest FrameworksNetTests:VpnTest Change-Id: Ibe0b245561b00442a6377fb849603f8b9026e9c4 Merged-In: Ibe0b245561b00442a6377fb849603f8b9026e9c4
| | | * | | | Merge "Use dns resolver v9 in connectivity and set resolverOptions to null." ↵TreeHugger Robot2021-08-061-3/+10
| | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | into sc-dev
| | | | * | | | Use dns resolver v9 in connectivity and set resolverOptions to null.Remi NGUYEN VAN2021-08-061-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The resolverOptions member of the ResolverParamsParcel has never been set by AOSP code but was only used by OEMs modifying DnsManager. Now that DnsManager is mainline code, this is no longer possible. So the DNS resolver introduces a new setResolverOptions IPC to allow OEMs to set the options and makes the resolverOptions nullable. Make DnsManager set resolverOptions to null, to ensure that when DnsManager calls setResolverConfiguration, it does not overwrite any options set by the OEM. Bug: 194048056 Test: Device boots and has connectivity Change-Id: I310a79521f5a365e50e2c65e9dd87d9b68f105d7 Merged-In: I310a79521f5a365e50e2c65e9dd87d9b68f105d7
| | | * | | | | Add overlay options for no internet notificationsRemi NGUYEN VAN2021-08-041-0/+112
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an option to display the no internet dialog directly instead of showing a notification when the notification would have been high priority (typically when the network was explicitly selected). This is disabled by default, but allows device manufacturers to use a slightly more disruptive UX to ensure that the user is aware that the network has no connectivity, and can take action. Also add an option to show the same notification as "no internet" instead of the "partial connectivity" notification. This is also disabled by default, but allows device manufacturers to use the "no internet" text if they feel that "partial connectivity" text is hard to understand for the user. Bug: 193847396 Test: atest NetworkNotificationManagerTest Original-Change: https://android-review.googlesource.com/1782433 Merged-In: Ib5bd74d8cf973bf70d373dd63648c178fae0ebae Change-Id: Ib5bd74d8cf973bf70d373dd63648c178fae0ebae
| | | * | | | Merge changes from topic "am-cc17cb7d48ea4bd7adc9183dc0c381e3-sc-dev" into ↵Remi NGUYEN VAN2021-07-0612-46/+88
| | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sc-dev * changes: Apply jarjar rules on coverage tests Re-skip connectivity unit tests before S Move ConnectivityCoverageTests to general-tests Fix ConnectivityManagerTest initialization on Q Move test_mainline_modules to AndroidTest.xml Add ConnectivityCoverageTests to postsubmit Add connectivity coverage tests Make tests compatible with mockito-extended Fix KeepalivePacketDataUtilTest crash on eng build Update connectivity TEST_MAPPING
| | | | * | | | Re-skip connectivity unit tests before SRemi NGUYEN VAN2021-07-0512-31/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests are packaged together with other tests in a common coverage suite, so need to be individually annotated so that they are skipped before S. They do not need to pass on platforms older than S, because such platforms will not updated with the code that is tested. This applies a previous change, this time using DevSdkIgnoreRunner, as SdkSuppress does not work as expected in branches that have a codename 2 versions above the SDK version, as is the case in AOSP. Bug: 187935317 Test: atest ConnectivityCoverageTests on R atest FrameworksNetTests on S Original-Change: https://android-review.googlesource.com/1749684 Merged-In: I5808d34459a4c19238baf8873afa7cf942828460 Change-Id: I5808d34459a4c19238baf8873afa7cf942828460
| | | | * | | | Make tests compatible with mockito-extendedRemi NGUYEN VAN2021-07-023-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does not change the mockito library to use mockito-extended in FrameworksNetTests, but changes the tests so that they would pass if built against that library. This is useful to run FrameworksNetTests in a common test suite with other tests that use mockito-extended, for example a common connectivity coverage test target. The change includes increasing the test timeout in ConnectivityServiceTest, as mockito-extended can have performance impact (~3 times on hwasan builds). This change does not make tests run slower in the current FrameworksNetTests suite though. Bug: 187935317 Test: atest FrameworksNetTests Original-Change: https://android-review.googlesource.com/1737400 Merged-In: I61fa371e8957037075a2617a014647ff062207c6 Change-Id: I61fa371e8957037075a2617a014647ff062207c6