Commit Graph

29343 Commits

Author SHA1 Message Date
Bill Yi
8ee687d87b [automerger skipped] Import translations. DO NOT MERGE ANYWHERE am: be8fc3803d -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/16587566

Change-Id: I6d5d03b6dda1f23fd13b17540fba6e983c291566
2022-01-09 05:43:56 +00:00
Bill Yi
742792ff40 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Iea8616779d0e27d13eb0b87857b5106b15e38c1f
2022-01-08 05:15:41 +00:00
Bill Yi
be8fc3803d Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ia09c81abfe90e4e54d11228e4b56d4a671902985
2022-01-08 05:14:29 +00:00
Lucas Lin
3de047cb32 Merge "Add test for Vpn#prepare()" into sc-dev am: f89a629776 am: 66737a8c5d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15606164

Change-Id: Icec2f3508932abd460b2605881b54c5d0cfafb35
2021-12-27 17:35:31 +00:00
Lucas Lin
66737a8c5d Merge "Add test for Vpn#prepare()" into sc-dev am: f89a629776
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15606164

Change-Id: I6b9024a183cefba4ce7173650d78c61ee60c9ec2
2021-12-23 12:32:09 +00:00
Lucas Lin
f89a629776 Merge "Add test for Vpn#prepare()" into sc-dev 2021-12-23 12:14:46 +00:00
lucaslin
f76481568d Add test for Vpn#prepare()
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
2021-12-22 07:03:31 +00:00
Les Lee
28da18e286 Merge "[conflict] Add test case to test normalize am: f444e9d182" into sc-v2-dev 2021-11-18 01:49:03 +00:00
Les Lee
109b1246c3 [conflict] Add test case to test normalize am: f444e9d182
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/16214695

Bug: 206073065
Bug: 206448852
Test: Test: I solemnly swear I tested this conflict resolution.
Merged-In: I80c9f887cf8b4714716d657da92ed273a532ce27
Merged-In: I2f5790b9217357ddcf3f466cec1b2b1afbb47210
2021-11-16 03:46:22 +00:00
Oriol Prieto Gasco
48683e2439 Revert "[resolved conflict] Add test case to test normalize am: f444e9d182"
This reverts commit fc719b474a.

Reason for revert: DroidMonitor-triggered revert due to breakage bug b/206448852

Bug: 206448852

Change-Id: I7f685bc1b2e4b2b3b33a2d2f0e430a321d7493fe
2021-11-15 23:39:55 +00:00
Les Lee
fc719b474a [resolved conflict] Add test case to test normalize am: f444e9d182
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/16214695

Bug: 206073065
Change-Id: I2bbac80ae1b2f64166d6598f72e156b23c0f019e
Merged-In: I80c9f887cf8b4714716d657da92ed273a532ce27
Merged-In: I2f5790b9217357ddcf3f466cec1b2b1afbb47210
Test: Test: I solemnly swear I tested this conflict resolution.
2021-11-15 11:26:34 +00:00
Les Lee
f444e9d182 Add test case to test normalize
Bug: 194939211
Test: atest -c NetworkTemplateTest
Merged-In: I2f5790b9217357ddcf3f466cec1b2b1afbb47210
Change-Id: I2f5790b9217357ddcf3f466cec1b2b1afbb47210
2021-11-09 10:31:56 +08:00
Aaron Huang
3a7b8f1e2b Merge "Bypass cellular battery stats test if telephony is not supported" into sc-v2-dev 2021-10-26 09:31:40 +00:00
Aaron Huang
25f4b66ced Merge "Update callers to use buildTemplateMobileWithRatType with metered" into sc-v2-dev 2021-10-25 15:09:01 +00:00
Aaron Huang
6d546271b2 Bypass cellular battery stats test if telephony is not supported
This test requires a cell network so the test will be failed if
the device does not support telephony. Add a condition to check
if the device supports telephony and skip cellular battery stats
test if telephony is not supported.

Bug: 196231205
Test: atest CtsNetTestCases:BatteryStatsManagerTest
Change-Id: I9ddc1da2a3f83f3fd2ab59059185f2f7a8d08701
Merged-In: I9ddc1da2a3f83f3fd2ab59059185f2f7a8d08701
2021-10-25 13:55:25 +08:00
Chalard Jean
1b0915c261 Merge changes from topic "rm-forceAllNetworkTypes-sc-v2-dev" into sc-v2-dev
* changes:
  Test a template matches mobile and mobile wildcard
  Remove ForceAllNetworkTypes from test
2021-10-25 04:50:31 +00:00
Treehugger Robot
52c5bf2b6f Exclude testGetMultipathPreference on no Wi-Fi devices
Bug: 202228414
Test: atest CtsNetTestCases
Change-Id: Ie7cd52942b93de5d0b0dd5be49d1f85afafb4ea7
Merged-In: I3112ffb816fd16b2fc7a87c35d8f95eef0144281
(cherry picked from commit db354f783e)
2021-10-21 07:04:40 +00:00
TreeHugger Robot
e3b6dc0f67 Merge "Support wifi and ethernet connection for DnsResolverTest." into sc-v2-dev 2021-10-19 12:58:20 +00:00
Treehugger Robot
ab48d029e6 Support wifi and ethernet connection for DnsResolverTest.
bug: 199675828
Test: atest CtsNetTestCases:android.net.cts.DnsResolverTest

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1833253

Change-Id: I4deed4292a20df70cfefc7ffb3b0ad76fda3d393
Merged-In: Ie1c7522426314ccc83008b75f90a57f3a53339d4
(cherry picked from commit a974622461)
2021-10-18 07:27:13 +00:00
Chalard Jean
71d8bb764f Wait for validation of WiFi in OEM pref test
OEM_NETWORK_PREFERENCE_TEST prefers NOT_METERED&VALIDATED networks
then TEST networks. If the WiFi isn't validated by the time the
preference is set, then the TEST network is preferred and the test
fails. The best solution is simply to wait for the WiFi network to
validate before setting the preference.

Besides, some of the *wait* methods wait for validation and some
don't, creating confusion. Make this explicit on the
setWifiMeteredStatusAndWait method with a boolean argument, which
forces all users to make an explicit choice.

testSetOemNetworkPreferenceForTestOnlyPref is not affected, as
it does not change WiFi meteredness.

Ignore-AOSP-First: cherry-pick of an already-submitted AOSP change
Bug: 195365654
Test: testSetOemNetworkPreferenceForTestPref
Change-Id: I9f2bacd9b5433d7c907536af2f6c2653523271d2
Merged-In: Icb9d7ff1ca5c3d93286ea3a79c27f15630d17ee6
(cherry picked from commit ae4c414c1f)
2021-10-15 05:06:52 +00:00
Remi NGUYEN VAN
bb323e0926 Ensure wifi reconnects before waiting for metered
testGetMultipathPreference assumes that wifi will auto-reconnect after
changing its metered status, but this is not necessarily the case if the
BSSID has been blocklisted after it failed validating too many times.

Call ensureWifiConnected to force wifi to reconnect before waiting for
it to become metered.

Bug: 190913510
Test: atest ConnectivityManagerTest
Change-Id: Iafe9837b97e4d654bb0f3962d48a94c1f31bbebc
Merged-In: Iafe9837b97e4d654bb0f3962d48a94c1f31bbebc
2021-10-15 05:06:18 +00:00
Aaron Huang
21b13bb81b Update callers to use buildTemplateMobileWithRatType with metered
The method buildTemplateMobileWithRatType is updated to take
metered as a parameter so the callers should be updated to
the new version.

Ignore-AOSP-First: There's a CL in the same topic will conflict
with internal tree so ignore AOSP first.
Bug: 183776809
Test: atest FrameworksNetTest
Change-Id: I859514b93705f9ee4f9ae4b0bcddcb61005a78ff
2021-10-07 17:28:33 +08:00
Aaron Huang
35bbf12886 Test a template matches mobile and mobile wildcard
Add two test cases for matchesMobile and matchesMobileWildcard

Bug: 183776809
Test: FrameworksNetTests:NetworkTemplateTest
Change-Id: I14d31071655204fe6ad36c71f7f521640e01c96e
Merged-In: I14d31071655204fe6ad36c71f7f521640e01c96e
2021-10-05 21:09:16 +08:00
Aaron Huang
ea0732e615 Remove ForceAllNetworkTypes from test
Before sForceAllNetworkTypes is removed, the network
type and meteredness will be ignored when matchesMobile
or matchesMobileWildcard is called.

After sForceAllNetworkTypes is removed, the matches
method should check the network type and the meteredness.
Thus, if the test data contains different type or it's
not metered should not be counted.

Bug: 183776809
Test: FrameworksNetTests
Change-Id: Ie7194495d26c0f5ef7a247733f43c64688626c67
Merged-In: Ie7194495d26c0f5ef7a247733f43c64688626c67
2021-10-05 21:08:57 +08:00
TreeHugger Robot
ec388da126 Merge "Ensure calling package name and uid are matched" into sc-qpr1-dev am: e93efb6f96
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15618365

Change-Id: Ia3c730176ac21b90c2b44ad1cd56304d6b85ac4f
2021-10-01 14:21:12 +00:00
TreeHugger Robot
e93efb6f96 Merge "Ensure calling package name and uid are matched" into sc-qpr1-dev 2021-10-01 14:08:56 +00:00
Bill Yi
f5b69c6e64 Merge changes from topic "presubmit-am-647350e3bf134d7da0e8df1bfb2dc418" into sc-qpr1-dev am: 814a8e4d90
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15806632

Change-Id: Ia3919ae1e66f94ee8a3fe37853a49ad328577d7d
2021-09-12 13:22:26 +00:00
Bill Yi
d5e882db02 [automerger skipped] [automerged blank] Import translations. DO NOT MERGE ANYWHERE 2p: 069a442dc2 am: cf16330636 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15806632

Change-Id: I4757cb41f3574cb494b1f2e4b56a1ac7048e8e0b
2021-09-12 13:22:24 +00:00
Bill Yi
814a8e4d90 Merge changes from topic "presubmit-am-647350e3bf134d7da0e8df1bfb2dc418" into sc-qpr1-dev
* changes:
  [automerged blank] Import translations. DO NOT MERGE ANYWHERE 2p: 069a442dc2
  Import translations. DO NOT MERGE ANYWHERE
2021-09-12 13:03:49 +00:00
Bill Yi
7fc05636f5 [automerger skipped] Import translations. DO NOT MERGE ANYWHERE am: 166f5fe82b -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15806603

Change-Id: Id1ab88235a28fe8c33ebb7568963dbabf062f170
2021-09-12 08:28:55 +00:00
Bill Yi
2d0f0bb123 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ic149bd5a99e8521cf55f7bc6741f90b685ab46be
2021-09-10 22:27:23 +00:00
Bill Yi
166f5fe82b Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I60afaececda2b6b0216db73056b4eff658e168a1
2021-09-10 22:26:08 +00:00
Bill Yi
cf16330636 [automerged blank] Import translations. DO NOT MERGE ANYWHERE 2p: 069a442dc2
Blank merge reason: commit message contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15806632

Change-Id: I55c96e736f9f5a9f98dd4fe4940ee4f05d9999d8
2021-09-10 22:25:03 +00:00
Bill Yi
069a442dc2 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I5d6853625026f0eb4f19bf414fdab18c5cfc4a05
2021-09-10 22:24:52 +00:00
Kenneth Magic
903a564340 Add CtsHostsideNetworkTests deps to sts. am: da973a6d9d am: 928655800a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15612573

Change-Id: I96e45f3483b2254208e8ff399b931a726028f5fd
2021-09-08 13:39:14 +00:00
Kenneth Magic
928655800a Add CtsHostsideNetworkTests deps to sts. am: da973a6d9d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15612573

Change-Id: I111fa816cd4aede1b291bd49ec2dc400a925d6cb
2021-09-08 13:24:07 +00:00
Lorenzo Colitti
eca2ef2d5e Give EthernetTetheringTest the restricted networks permission.
This test fails on devices where physical Ethernet interfaces are
available but marked restricted, like cuttlefish.

Bug: 197462993
Bug: 197910181
Test: test-only change

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807157

Change-Id: I04ccf491be12236dffb5ba4972fac35946fc6896
Merged-In: I04ccf491be12236dffb5ba4972fac35946fc6896
Merged-In: I15c991b2e43e2d5e823dcdcfbd74adfd9b2f6f08
2021-08-30 08:17:30 +00:00
paulhu
b2c286816d Ensure calling package name and uid are matched
CS#requestRouteToHostAddress enforcing change permission doesn't
check whether the calling package belongs to calling uid. This
can be used to check whether package name exists or not without
permission. Thus, add a check to ensure calling package name and
uid are matched.

Bug: 193801134
Test: atest FrameworksNetTests CtsNetTestCases
Ignore-AOSP-First: Security fix
Change-Id: I980f1c68b5321601aa40da29e283fb4dd717d5de
2021-08-26 13:23:03 +00:00
Kenneth Magic
da973a6d9d Add CtsHostsideNetworkTests deps to sts.
This fixes the missing apk errors when running this module as
part of sts.

Ignore-AOSP-First: Platform changes related to this are not in AOSP yet.
Test: run sts-engbuild-no-spl-lock -m CtsHostsideNetworkTests
Bug: 195961795
Change-Id: I9a9a2d20ce637663790df42e22b0c8023cf7bc3e
2021-08-18 19:38:56 +00:00
Xin Li
28c8a63f3a [automerger skipped] Merge stage-aosp-sc-ts-dev before making it an upstream am: b5c6036c29 -s ours am: 21026d8bfb -s ours
am skip reason: Merged-In I592dd5f1d6e13b020beadb11b9d913857a82e524 with SHA-1 58b493abf6 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15546967

Change-Id: Id06b722ffc5c36f71b7a8d05bebbfad28a5074b9
2021-08-13 21:20:28 +00:00
Xin Li
21026d8bfb [automerger skipped] Merge stage-aosp-sc-ts-dev before making it an upstream am: b5c6036c29 -s ours
am skip reason: Merged-In I592dd5f1d6e13b020beadb11b9d913857a82e524 with SHA-1 58b493abf6 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15546967

Change-Id: I6c8ea5e480616212dee710e111cd4b16d6533b7d
2021-08-13 20:53:31 +00:00
Xin Li
b5c6036c29 Merge stage-aosp-sc-ts-dev before making it an upstream
Bug: 169893837
Merged-In: I592dd5f1d6e13b020beadb11b9d913857a82e524
Change-Id: I9db108c5bf31c17321534a55c1e6e78f46b96c45
2021-08-13 18:26:19 +00:00
Xin Li
de12da7a25 Merge "Merge ab/7633965" into stage-aosp-sc-ts-dev 2021-08-13 00:03:19 +00:00
The Android Open Source Project
7ef5d542cd Merge ab/7633965
Bug: 169893837
Merged-In: I592dd5f1d6e13b020beadb11b9d913857a82e524
Change-Id: I4e01d58ed61c595b704bae6c935d0da1714ee398
2021-08-12 22:28:22 +00:00
Aaron Huang
47b4556fc0 Merge "Skip wifi stats test if link layer stats is not supported" into sc-dev am: 9ac9c1d575 am: 1a1ab4a4ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15479880

Change-Id: I98f7f0051761e8f912f980cb23a6c7cde536a181
2021-08-11 04:07:05 +00:00
Aaron Huang
1a1ab4a4ab Merge "Skip wifi stats test if link layer stats is not supported" into sc-dev am: 9ac9c1d575
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15479880

Change-Id: I677f8566496230e8ac6fd141e6e4d79aad4b1cf8
2021-08-11 03:51:56 +00:00
Aaron Huang
1b88f69d99 Skip wifi stats test if link layer stats is not supported
Wifi link layer is an optional feature so this test will be
failed on wifi stats check if a device does not support it.
Add a check to know if the  device supports wifi link layer
stats and skip it if it is not supported.

Ignore-AOSP-First: Needs cherry-picks
Bug: 195518957
Test: CtsNetTestCases:BatteryStatsManagerTest
Change-Id: I592dd5f1d6e13b020beadb11b9d913857a82e524
Merged-In: I592dd5f1d6e13b020beadb11b9d913857a82e524
(cherry picked from commit 58b493abf6)
2021-08-11 03:45:29 +00:00
Aaron Huang
9ac9c1d575 Merge "Skip wifi stats test if link layer stats is not supported" into sc-dev 2021-08-11 03:33:53 +00:00
Aaron Huang
58b493abf6 Skip wifi stats test if link layer stats is not supported
Wifi link layer is an optional feature so this test will be
failed on wifi stats check if a device does not support it.
Add a check to know if the  device supports wifi link layer
stats and skip it if it is not supported.

Ignore-AOSP-First: Needs cherry-picks
Bug: 195518957
Test: CtsNetTestCases:BatteryStatsManagerTest
Change-Id: I592dd5f1d6e13b020beadb11b9d913857a82e524
2021-08-10 14:37:51 +08:00
Lucas Lin
2883684925 Merge "Add test for [stop|start]VpnProfile()" into sc-dev am: 2900ffbb5f am: 849c3fb997
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15359731

Change-Id: I8a0f348953405ee38358739525fa9825cd3e0670
2021-08-10 02:55:36 +00:00