Commit Graph

29329 Commits

Author SHA1 Message Date
Aaron Huang
25f4b66ced Merge "Update callers to use buildTemplateMobileWithRatType with metered" into sc-v2-dev 2021-10-25 15:09:01 +00: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
Lucas Lin
849c3fb997 Merge "Add test for [stop|start]VpnProfile()" into sc-dev am: 2900ffbb5f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15359731

Change-Id: I5e6f58cc9f234250a2c41e1b31313cd5663de2ae
2021-08-10 02:40:30 +00:00
Lucas Lin
2900ffbb5f Merge "Add test for [stop|start]VpnProfile()" into sc-dev 2021-08-10 02:28:24 +00:00
TreeHugger Robot
54ecd83b7e Merge "Use dns resolver v9 in connectivity and set resolverOptions to null." into sc-dev am: 4e257a92ca
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15482197

Change-Id: Ifc568e19ddd3462895749efaeaa8e944a40efda2
2021-08-06 19:00:13 +00:00
TreeHugger Robot
4e257a92ca Merge "Use dns resolver v9 in connectivity and set resolverOptions to null." into sc-dev 2021-08-06 18:35:45 +00:00
Remi NGUYEN VAN
0ccf3fb461 Use dns resolver v9 in connectivity and set resolverOptions to null.
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
2021-08-06 22:21:51 +09:00
Benedict Wong
1bea0853e9 Update ConnDiags CTS test to expect validation result SKIPPED. am: ae00382c67
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15474912

Change-Id: Ib4d746ad90c6d22db7630885bcfac4d78e6d231d
2021-08-06 11:44:51 +00:00
Benedict Wong
ae00382c67 Update ConnDiags CTS test to expect validation result SKIPPED.
This CL updates ConnectivityDiagnosticsManagerTest to expect
NETWORK_VALIDATION_RESULT_SKIPPED for its TestNetworks. The tests also
expect a ConnectivityReport to be sent for all calls to
ConnectivityManager#reportNetworkConnectivity.

This change is different from the one pushed into AOSP & the mainline
modules; this allows both SKIPPED and VALID in the intermediate time
while module prebuilts are generated. MTS will enforce the stricter
SKIPPED check, while this allows both the S-release behavior and
mainline update behavior.

Bug: 162407730
Bug: 195727283
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Ia0bf1bb53289b079f26597f09b0759a89deb681f
Merged-In: I78b78919d5b0f09348dfdd5fdb37418b8c7f861f
2021-08-06 18:08:48 +09:00
Chalard Jean
b78fb70309 Merge "Revert "Allow network providers to set yield to bad wifi"" into sc-dev am: e8b35336f4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15443464

Change-Id: Iba26d5779df32c9a94b216f10fb6cc665e29cd18
2021-08-05 11:41:42 +00:00
Chalard Jean
e8b35336f4 Merge "Revert "Allow network providers to set yield to bad wifi"" into sc-dev 2021-08-05 11:31:40 +00:00
Remi NGUYEN VAN
574e8d3573 Merge changes Ic33d8976,Ib5bd74d8 into sc-dev am: 6c1e049e29
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15461111

Change-Id: I119dc7433cd8f5fa2ba1f997f7adef8985a3b492
2021-08-05 07:30:42 +00:00
Remi NGUYEN VAN
43bb3a2856 Add overlay options for no internet notifications am: 893494289b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15461110

Change-Id: Ic49531aa88bceeb4f75b3b3ef071df7acef1a71f
2021-08-05 07:30:39 +00:00
Remi NGUYEN VAN
6c1e049e29 Merge changes Ic33d8976,Ib5bd74d8 into sc-dev
* changes:
  Mock connectivity resources in integration tests
  Add overlay options for no internet notifications
2021-08-05 07:17:31 +00:00
Remi NGUYEN VAN
0a37e72f0c Mock connectivity resources in integration tests
The resources may have different values depending on devices, and
resources IDs may mismatch if the test was not built at the same time as
the installed module, so mock the resources to allow running the
integration tests on more builds.

Bug: 193847396
Test: atest FrameworksNetIntegrationTests
Ignore-AOSP-First: cherry-pick created
Change-Id: Ic33d897690a8ea84a78c01dc5f2b2e2c473d57df
2021-08-05 07:07:38 +00:00
Chiachang Wang
4dd0f9c194 Revert "Allow network providers to set yield to bad wifi"
This reverts commit c4660c98f6a63a73df1a79c34fbbf2266a6b381e.

The reverted commit removed the POLICY_YIELD_TO_BAD_WIFI exclusive
bit from the EXTERNAL_POLICIES_MASK. The new policy calculation
is done by bitwise-or-ing with existing policy. If the
POLICY_YIELD_TO_BAD_WIFI was ever set to policy in the FullScore
, CS will not be able to remove the policy to reflect the avoid
bad wifi setting change since the result is always be true unless
the policy is updated from factories.

Eventually, the original commit is the intended design but current
design could not work well with it. Thus, revert it to keep the
control on CS now.

Bug: 195612849
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: I002e206ffd41796cb0996b9c559afed3d619b67c
Ignore-AOSP-First: Commit is only available in internal branch
2021-08-05 05:23:23 +00:00