Commit Graph

42196 Commits

Author SHA1 Message Date
paulhu
f3d3127084 [automerger skipped] Add test for CSM#[get|set]UidsAllowedOnRestrictedNetworks am: 342ee18b57 -s ours
am skip reason: Merged-In Ie9391d9332ded58cf1e63c8c5c6f5ba85c950bc6 with SHA-1 d266285172 is already in history

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

Change-Id: I806fbb1ff7df936f44daaf654e4b3df2d91d498d
2021-06-23 19:33:35 +00:00
Paul Hu
859611dfa4 Merge "Add test for CSM#[get|set]UidsAllowedOnRestrictedNetworks" am: 33b4929cfe am: 33ebb2d0af
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1740740

Change-Id: I703b9839f0e2e59c57e03bd2dfc31f1932f8c02c
2021-06-23 17:08:41 +00:00
Paul Hu
33ebb2d0af Merge "Add test for CSM#[get|set]UidsAllowedOnRestrictedNetworks" am: 33b4929cfe
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1740740

Change-Id: I1f82fdb084fc73a4db69f2ba8eba96d8e8010c7a
2021-06-23 16:48:11 +00:00
Paul Hu
2cea8eab79 [automerger skipped] Merge "Add ConnectivitySettingsManagerTest" into sc-dev am: a244f13f21 -s ours
am skip reason: Merged-In I8161c1bca84b41964578d59ee5d6ab07b2380707 with SHA-1 236a992cd0 is already in history

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

Change-Id: If47c9a142319af5bb80362795ddd684faff35dff
2021-06-23 16:45:28 +00:00
paulhu
342ee18b57 Add test for CSM#[get|set]UidsAllowedOnRestrictedNetworks
Bug: 185149952
Test: atest ConnectivityManagerTest
Original-Change: https://android-review.googlesource.com/1740740
Merged-In: Ie9391d9332ded58cf1e63c8c5c6f5ba85c950bc6

Change-Id: Ie9391d9332ded58cf1e63c8c5c6f5ba85c950bc6
2021-06-23 16:34:01 +00:00
Paul Hu
33b4929cfe Merge "Add test for CSM#[get|set]UidsAllowedOnRestrictedNetworks" 2021-06-23 16:30:57 +00:00
Paul Hu
a244f13f21 Merge "Add ConnectivitySettingsManagerTest" into sc-dev 2021-06-23 16:29:20 +00:00
TreeHugger Robot
4212f39749 [automerger skipped] Merge changes I77dc5556,If772078c,Idb19b0f7 into sc-dev am: e7ac3ffec5 -s ours
am skip reason: Merged-In I77dc5556458c2e824f7abd5a7b79e8aeed8dabf3 with SHA-1 481040b43a is already in history

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

Change-Id: I9049e421b915a69e981aa208028c7bd5d493bc97
2021-06-23 16:22:10 +00:00
TreeHugger Robot
051bc29cfc [automerger skipped] Merge "Add basic tests for InvalidPacketException" into sc-dev am: 06b27811c8 -s ours
am skip reason: Merged-In I33f1ee1702672204a46063e6e75c3880d5e7600b with SHA-1 bf44f6200e is already in history

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

Change-Id: I8eef906ff625b484727751684058540398168012
2021-06-23 16:22:04 +00:00
TreeHugger Robot
0a326392c4 [automerger skipped] Merge "Move ConnectivityDiagnosticsManagerTest to common" into sc-dev am: ac6a28907a -s ours
am skip reason: Merged-In I86f39238054f43403f9a1e383dd2a935de84f06f with SHA-1 7e23f18158 is already in history

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

Change-Id: I81dcad761ea0719d693af40bfd2119f807cb34e5
2021-06-23 16:21:58 +00:00
Remi NGUYEN VAN
37d6978d4e [automerger skipped] Added tests for QosCallback am: 763f3a0fb3 -s ours
am skip reason: Merged-In I29769fc8be074a5105bfe4ac34e30980c5f8744a with SHA-1 6214f82c04 is already in history

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

Change-Id: Iaaab320d78197f5d92d5614a69d40868880813a7
2021-06-23 16:21:52 +00:00
Remi NGUYEN VAN
ccd2989742 [automerger skipped] Add tests for duplicate PendingIntent requests am: 3674367bcc -s ours
am skip reason: Merged-In Ic636c731c71474ef09043d7a26ccfd6e2bb5c39f with SHA-1 489275e84e is already in history

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

Change-Id: I856adffad2150ac768b1cada280a390acf3e1ab0
2021-06-23 16:21:45 +00:00
TreeHugger Robot
e7ac3ffec5 Merge changes I77dc5556,If772078c,Idb19b0f7 into sc-dev
* changes:
  Add test for CM#setAvoidUnvalidated
  Provide a way to override the avoid bad wifi configuration
  Remove ConnectivityServiceTest signature perms use
2021-06-23 16:16:03 +00:00
TreeHugger Robot
06b27811c8 Merge "Add basic tests for InvalidPacketException" into sc-dev 2021-06-23 16:09:25 +00:00
TreeHugger Robot
ac6a28907a Merge "Move ConnectivityDiagnosticsManagerTest to common" into sc-dev 2021-06-23 16:09:23 +00:00
paulhu
0903f73e1f Add ConnectivitySettingsManagerTest
- Add tests for ConnectivitySettingsManager.
- Also address leftover javadoc comments.

Bug: 182538166
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Original-Change: https://android-review.googlesource.com/1738353
Merged-In: I8161c1bca84b41964578d59ee5d6ab07b2380707
Change-Id: I8161c1bca84b41964578d59ee5d6ab07b2380707
2021-06-23 20:02:27 +08:00
Chiachang Wang
79f6827d45 Add test for CM#setAvoidUnvalidated
Bug: 186061922
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCasesLatestSdk
Original-Change: https://android-review.googlesource.com/1733789
Merged-In: I77dc5556458c2e824f7abd5a7b79e8aeed8dabf3
Change-Id: I77dc5556458c2e824f7abd5a7b79e8aeed8dabf3
2021-06-23 10:31:17 +00:00
Chiachang Wang
ef570996db Merge "Add test for CM#setAvoidUnvalidated" am: 13549792e2 am: eaf5893102
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1733789

Change-Id: Ibf57a8fe0f49763b2bf1f7fe06c42851dde905cf
2021-06-23 09:51:28 +00:00
Chiachang Wang
eaf5893102 Merge "Add test for CM#setAvoidUnvalidated" am: 13549792e2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1733789

Change-Id: I0431134cfd124e0602b32a26425d2fb943f9f95a
2021-06-23 09:38:08 +00:00
Chiachang Wang
13549792e2 Merge "Add test for CM#setAvoidUnvalidated" 2021-06-23 09:19:51 +00:00
Remi NGUYEN VAN
bdd448e641 Add basic tests for InvalidPacketException
The test simply verify the constructor. They only apply on S+ as
InvalidPacketException is not updatable before S.

Bug: 187935317
Test: atest InvalidPacketExceptionTest
Original-Change: https://android-review.googlesource.com/1742076
Merged-In: I33f1ee1702672204a46063e6e75c3880d5e7600b
Change-Id: I33f1ee1702672204a46063e6e75c3880d5e7600b
2021-06-23 09:16:59 +00:00
Remi NGUYEN VAN
b5f0819d35 Move ConnectivityDiagnosticsManagerTest to common
The tests are also useful in CTS to ensure that the
ConnectivityDiagnosticsManager class API is implemented properly
(including behavior of the DataStallReport class for example).

Bug: 187935317
Test: atest ConnectivityDiagnosticsManagerTest
Original-Change: https://android-review.googlesource.com/1742075
Merged-In: I86f39238054f43403f9a1e383dd2a935de84f06f
Change-Id: I86f39238054f43403f9a1e383dd2a935de84f06f
2021-06-23 09:16:53 +00:00
Chiachang Wang
fad30e3d84 Provide a way to override the avoid bad wifi configuration
ConnectivityManager.setAvoidUnvalidated only works if the
config_networkAvoidBadWifi configuration is set to 0 and the
NETWORK_AVOID_BAD_WIFI setting is unset. There is no easy way
for a testing app to temporary set a test value to verify the
behavior of the API. Thus, add a mechanism to allow test app
to set a period of time to temporary unstrict the resource
configuration, i.e. Temporary simulate config_networkAvoidBadWifi
configured to 0.

Bug: 186061922
Test: atest CtsNetTestCases FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1733788
Merged-In: If772078c61a9b12926f104d5dfc9c9071e844732
Change-Id: If772078c61a9b12926f104d5dfc9c9071e844732
2021-06-23 08:42:47 +00:00
Remi NGUYEN VAN
ff55aeb916 Remove ConnectivityServiceTest signature perms use
To allow unit tests to run without platform certificates, remove
signature permission usage in ConnectivityServiceTest.

This mocks permission checks done in ConnectivityService for which the
test assumed that the permission was held, and mocks calls to
BatteryStatsManager. Calls to ActivityManagerService (through
PendingIntent) are done with shell permissions as the test uses real
PendingIntent mechanics.

Bug: 187935317
Test: atest FrameworksNetTests
Merged-In: If309d653ac2e9bbcf1b94bcee6336367289df359
Change-Id: If309d653ac2e9bbcf1b94bcee6336367289df359

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

(cherry picked from commit 595dda3604)

Change-Id: Idb19b0f7cb87bb4d9de7a0b1a0e4128c2d6b9c6d
2021-06-23 08:39:38 +00:00
paulhu
d266285172 Add test for CSM#[get|set]UidsAllowedOnRestrictedNetworks
Bug: 185149952
Test: atest ConnectivityManagerTest
Change-Id: Ie9391d9332ded58cf1e63c8c5c6f5ba85c950bc6
2021-06-23 08:01:00 +00:00
Remi NGUYEN VAN
763f3a0fb3 Added tests for QosCallback
Tests for the newly added QosCallback functionality

Bug: 155176305
Test: Added to cts/NetworkAgentTest
Original-Change: https://android-review.googlesource.com/1558648
Merged-In: I29769fc8be074a5105bfe4ac34e30980c5f8744a
Change-Id: I29769fc8be074a5105bfe4ac34e30980c5f8744a
2021-06-23 07:15:31 +00:00
Remi NGUYEN VAN
3674367bcc Add tests for duplicate PendingIntent requests
Add tests for requestNetwork and registerNetworkCallback with
PendingIntents that are equal as per PendingIntent.intentFilterEquals.

In such situations, the first request is documented to be automatically
unregistered. This means that the PendingIntent should only be fired
once, instead of being fired for both requests.

Currently this behavior is broken for network callbacks (not for network
requests).

Test: atest ConnectivityManagerTest
Bug: 174237997
Original-Change: https://android-review.googlesource.com/1742073
Merged-In: Ic636c731c71474ef09043d7a26ccfd6e2bb5c39f
Change-Id: Ic636c731c71474ef09043d7a26ccfd6e2bb5c39f
2021-06-23 07:15:24 +00:00
Remi NGUYEN VAN
2b2df6c85b Merge "Added tests for QosCallback" am: 8ce48fe117 am: f4a7d4130f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1558648

Change-Id: Ic1e274100986681ac7d203ae6ad424387903e2a2
2021-06-23 06:30:09 +00:00
Remi NGUYEN VAN
2370c7cdf4 Merge "Add basic tests for InvalidPacketException" am: eb0a4b41f8 am: b1eee18493
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1742076

Change-Id: Ia8e3933f3abe69565e1b3e91fa38fff6ce0d36c5
2021-06-23 06:30:05 +00:00
Luke Huang
226281b698 Merge "Fix the comments from aosp/1719018" am: 0c20c4901f am: 9adee2f105
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1729691

Change-Id: I65dd02aacd50acb92d15c76457f8415b0cc8b73e
2021-06-23 06:29:30 +00:00
Chiachang Wang
481040b43a Add test for CM#setAvoidUnvalidated
Bug: 186061922
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I77dc5556458c2e824f7abd5a7b79e8aeed8dabf3
2021-06-23 13:54:04 +08:00
Remi NGUYEN VAN
f4a7d4130f Merge "Added tests for QosCallback" am: 8ce48fe117
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1558648

Change-Id: I198704f7c5b7d4ad3be292221270b7a41b2dd752
2021-06-23 05:50:54 +00:00
Remi NGUYEN VAN
b1eee18493 Merge "Add basic tests for InvalidPacketException" am: eb0a4b41f8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1742076

Change-Id: I55c691161abc5571ee59b2b3874540d0d28c06b9
2021-06-23 05:50:44 +00:00
Luke Huang
9adee2f105 Merge "Fix the comments from aosp/1719018" am: 0c20c4901f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1729691

Change-Id: Ia744fbab5b8bb97198861500472127f98185f022
2021-06-23 05:39:32 +00:00
Frank Li
de0b96bbaa [automerger skipped] Ignore some ConnectivityManagerTest CTS tests that can't be run in the instant app mode am: e7d085e87d -s ours
am skip reason: Merged-In Ice43bcf7a1dc34f4a54fefba7f408767f0a4341e with SHA-1 279a8ee8f7 is already in history

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

Change-Id: I47384d702eb620903796184677eb9655c1c8de9b
2021-06-23 05:37:45 +00:00
Remi NGUYEN VAN
8ce48fe117 Merge "Added tests for QosCallback" 2021-06-23 05:34:46 +00:00
Remi NGUYEN VAN
eb0a4b41f8 Merge "Add basic tests for InvalidPacketException" 2021-06-23 05:32:52 +00:00
Luke Huang
0c20c4901f Merge "Fix the comments from aosp/1719018" 2021-06-23 03:36:02 +00:00
Remi NGUYEN VAN
5b20059b56 Merge "Move ConnectivityDiagnosticsManagerTest to common" am: ef21082033 am: cb88733c59
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1742075

Change-Id: I5a0959b0dacbed1662a7852ad8d191cfa57c57e4
2021-06-23 03:11:12 +00:00
Remi NGUYEN VAN
cb88733c59 Merge "Move ConnectivityDiagnosticsManagerTest to common" am: ef21082033
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1742075

Change-Id: I865e22887c55fe3faff19476948a5ed75dc05437
2021-06-23 02:48:40 +00:00
Remi NGUYEN VAN
a73bc56179 [automerger skipped] Merge "Initialize TetheringManager lazily" into sc-dev am: 7579035ac9 -s ours
am skip reason: Merged-In I2ba7b8f2b9e1c934cfb082776b8d643f2f2c17e5 with SHA-1 e4d1cd970e is already in history

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

Change-Id: I35a1257b93e6223ecf78442b8426644e204a9eec
2021-06-23 02:37:17 +00:00
Remi NGUYEN VAN
bf44f6200e Add basic tests for InvalidPacketException
The test simply verify the constructor. They only apply on S+ as
InvalidPacketException is not updatable before S.

Bug: 187935317
Test: atest InvalidPacketExceptionTest
Change-Id: I33f1ee1702672204a46063e6e75c3880d5e7600b
2021-06-23 11:33:10 +09:00
Remi NGUYEN VAN
ef21082033 Merge "Move ConnectivityDiagnosticsManagerTest to common" 2021-06-23 02:31:03 +00:00
Frank Li
e7d085e87d Ignore some ConnectivityManagerTest CTS tests that can't be run in the instant app mode
1. testIsPrivateDnsBroken: It requires the
   permission:android.permission.WRITE_SECURE_SETTINGS. But the
   WRITE_SECURE_SETTINGS permission can't be granted to instant
   apps.
2. testSetOemNetworkPreferenceForTestOnlyPref: Instant apps can't
   create test networks.
3. testSetOemNetworkPreferenceForTestPref: Instant apps can't
   create test networks.

Bug: 191678254
Bug: 191680108
Test: atest android.net.cts.ConnectivityManagerTest --instant
      atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest --instant
Original-Change: https://android-review.googlesource.com/1743373
Merged-In: Ice43bcf7a1dc34f4a54fefba7f408767f0a4341e
Change-Id: Ice43bcf7a1dc34f4a54fefba7f408767f0a4341e
2021-06-23 02:24:55 +00:00
Remi NGUYEN VAN
7579035ac9 Merge "Initialize TetheringManager lazily" into sc-dev 2021-06-23 02:17:34 +00:00
Frank Li
23ccaddf1b Merge "Ignore some ConnectivityManagerTest CTS tests that can't be run in the instant app mode" am: a8a7cfd668 am: c4b4635f20
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1743373

Change-Id: Id65f442158f67d149bdc14ef7a00cd56db606c9f
2021-06-23 02:08:53 +00:00
Paul Hu
977a013d10 Merge "Add ConnectivitySettingsManagerTest" am: 6160d60b2e am: f37dd31334
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1738353

Change-Id: I239c14543f6948cb729424008054317b28bb9647
2021-06-23 02:08:49 +00:00
Chiachang Wang
403836f671 Merge "Provide a way to override the avoid bad wifi configuration" am: 38e8c2c94b am: 4ef85d615b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1733788

Change-Id: Ibe05bc988f0020eec8485023c3529bcc1696bd80
2021-06-23 02:08:44 +00:00
Frank Li
c4b4635f20 Merge "Ignore some ConnectivityManagerTest CTS tests that can't be run in the instant app mode" am: a8a7cfd668
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1743373

Change-Id: Id99ab133d4b682cfc77777b63be564c2f5450308
2021-06-23 02:08:39 +00:00
Remi NGUYEN VAN
4b348711de Merge "Add tests for duplicate PendingIntent requests" am: 307cb41ade am: 98138948fe
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1742073

Change-Id: I0246e733e7a33bc4958ebb25948032f3669d1c33
2021-06-23 02:08:35 +00:00