Commit Graph

28399 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
1c45a8a623 Add ConnectivityCoverageTests to postsubmit
Add the tests to both postsubmit and mainline-postsubmit.

This should allow moving the tests to presubmit in the near future,
after they have been verified to pass in postsubmit.

Bug: 187935317
Test: treehugger needs to test
Original-Change: https://android-review.googlesource.com/1736506
Merged-In: I9a05d6a300c5f777497e867d0456bc59b06eee80
Change-Id: I9a05d6a300c5f777497e867d0456bc59b06eee80
2021-07-05 05:01:02 +00:00
Remi NGUYEN VAN
168b3d19f1 Add connectivity coverage tests
The coverage tests will allow measuring code coverage for all
Connectivity+Tethering code.

This is a combination of the current TetheringCoverageTests, and
FrameworksNetTests.

Adding min_sdk_version to the test prevents it from using deprecated
IoUtils utilities. Replace it with the non-deprecated alternative.

Bug: 187935317
Test: atest ConnectivityCoverageTests
Original-Change: https://android-review.googlesource.com/1731232
Merged-In: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
Change-Id: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
2021-07-05 05:00:36 +00:00
Remi NGUYEN VAN
ad8f23fef4 Make tests compatible with mockito-extended
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
2021-07-02 01:59:56 +00:00
Remi NGUYEN VAN
8f260383f7 Fix KeepalivePacketDataUtilTest crash on eng build
The test causes a Log.wtf to be logged, because it tests a method that
should not be used after R. Mock the terrible failure handler to avoid
crashes on eng builds.

Test: atest KeepalivePacketDataUtilTest
Bug: 187935317

Original-Change: https://android-review.googlesource.com/1736261
Merged-In: Ic06a0db7fefb4acf38b66feba9b47e21f9927b1c
Change-Id: Ic06a0db7fefb4acf38b66feba9b47e21f9927b1c
2021-07-02 01:59:40 +00:00
Treehugger Robot
0e2dbf3106 Update connectivity TEST_MAPPING
- Move Tethering TEST_MAPPING up one level to merge with the general
   Connectivity TEST_MAPPING. This allows running the tethering tests
   on any connectivity change.
 - Move TetheringIntegrationTests from postsubmit to presubmit
 - Add TetheringCoverageTests to mainline-postsubmit, so it can be
   added to mainline-presubmit later.
 - Import NetworkStack tests so that they are run on any connectivity
   change.

TetheringIntegrationTests were continuously green in postsubmit.

Bug: 187946226
Original-Change: https://android-review.googlesource.com/1713468
Merged-In: Ibf05ad64b02c563930ba0f01eb91331b295fe505
Change-Id: Ibf05ad64b02c563930ba0f01eb91331b295fe505
Test: Treehugger needed to test TEST_MAPPING files
2021-07-01 10:01:37 +00:00
Luke Huang
bf9cb4dd18 Merge "Fix the comments from aosp/1719018" into sc-dev 2021-07-01 09:49:46 +00:00
Lucas Lin
b851d80de2 Merge "Simplify the return condition in stop()" into sc-dev 2021-07-01 09:09:39 +00:00
Junyu Lai
8ba13e99e8 Merge "Fix network callback with the same PendingIntent does not release" into sc-dev 2021-07-01 09:08:40 +00:00
TreeHugger Robot
424ef2043c Merge "Fix and test usb function configuration change" into sc-dev 2021-07-01 07:04:48 +00:00
TreeHugger Robot
2e0cdad198 Merge "Remove wigig support from S tethering" into sc-dev 2021-07-01 07:02:38 +00:00
Lucas Lin
5ca769ef4a Simplify the return condition in stop()
Previously, the return condition in stop() will check if the state
is STOPPING and the reason is ERROR_INVALID_NETWORK. The condition
is too restricted so that if another event is happened after binder
died, the exception will be thrown and crash the system.
Since calling stop() twice doesn't make sense, so relax the condition
of return when the state is STOPPING.

Bug: 182586681
Test: atest FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1729690
Merged-In: I2454c1c080d8954dd3785d4ac6e96fc4131fdb47
Change-Id: I2454c1c080d8954dd3785d4ac6e96fc4131fdb47
2021-07-01 06:57:53 +00:00
Hungming Chen
59f422694a Dump the unused IPv4 BPF rule age correctly
Print a dash for the unused "lastUsed" of the rule.

The age should not equal the bootime if the rule has never been
updated the "lastUsed" field.

Format:
[inDstMac] iif(iface) src -> nat -> dst [outDstMac] age
[00:00:00:00:00:00] 14(rmnet0) 140.112.8.116:443
-> 30(30) 10.170.56.233:43720
-> 192.168.45.236:43720 [be:34:40:28:33:5f] -

Bug: 190783768
Test: dumpsys tethering
Original-Change: https://android-review.googlesource.com/1751022
Merged-In: Ie771becd2f72518cf02a86e5ae228315785752a5
Change-Id: Ie771becd2f72518cf02a86e5ae228315785752a5
2021-07-01 03:23:01 +00:00
Treehugger Robot
282f743a8c Fix network callback with the same PendingIntent does not release
Currently, ConnectivityService uses EVENT_REGISTER_NETWORK_LISTENER
to dispatch registering network callback with pending intent, this
is wrong since the code flow will not check if the pending intent
is duplicated. Thus, the registration will be duplicated if the
caller uses the same pending intent and register multiple times.

This change fixes the logic by using
EVENT_REGISTER_NETWORK_LISTENER_WITH_INTENT instead of
EVENT_REGISTER_NETWORK_LISTENER when dispatching register network
callback with pending intent.

Test: atest android.net.cts.ConnectivityManagerTest#testRegisterNetworkRequest_identicalPendingIntents
Test: atest android.net.cts.ConnectivityManagerTest#testRegisterNetworkCallback_identicalPendingIntents
Test: atest ConnectivityServiceTest#testNetworkCallbackMaximum
Test: 1. Use test app to file callback with same PendingIntent
       2. Check dumpsys output
Bug: 189868426
Original-Change: https://android-review.googlesource.com/1727470
Merged-In: I38bdea3a026a78a6dc34b5200d43a75b3cd1ac0c
Change-Id: I38bdea3a026a78a6dc34b5200d43a75b3cd1ac0c
2021-07-01 01:44:56 +00:00
Chiachang Wang
6339ec22ad Trigger the network score update after setting test allow bad wifi
Avoid bad wifi design has to apply in both wifi and cellular
networks. Cellular network should contain POLICY_YIELD_TO_BAD_WIFI
policy, then system default network could stay in the wifi after
wifi becomes unvalidated.

The testing API only update the value but not trigger the avoid
bad wifi callback to update the score in the existing cellular
network. Thus, if the cellular network is connected before
setting the overridden value, the yield to bad wifi policy will
not updated to cellular network. The system default network will
still switch from unvalidated wifi network to cellular network
even wifi network is connected with the avoid bad wifi policy.

Update to trigger a reevaluation to update the score in each
NetworkAgent in the ConnectivityService.

Bug: 192149168
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest\
      #testSetAvoidUnvalidated --rerun-until-failure 100
Original-Change: https://android-review.googlesource.com/1751588
Merged-In: Ie0f777d0030b66dd306332496192c74f6c183284
Change-Id: Ie0f777d0030b66dd306332496192c74f6c183284
2021-07-01 00:32:08 +00:00
Paul Hu
eefacbcb5c Merge "Use appId instead of uid" into sc-dev 2021-06-30 09:38:26 +00:00
TreeHugger Robot
4fd9dfef2d Merge "Fix null PendingIntent in network listens" into sc-dev 2021-06-29 13:36:15 +00:00
Mark Chien
66fa6f24f9 Fix and test usb function configuration change
Allow stop TETHERING_NCM no matter ncm is used for TETHERING_USB or
TETHERING_NCM.

Add a test:
1. NCM is started for TETHERING_NCM
2. The config changes to use NCM for TETHERING_USB.
3. Then the config changes to use RNDIS for TETHERING_USB.

Also let some logs not only print in dumpsys, but also in logcat to
easiler debug unit test.

Bug: 185649441
Test: atest TetheringTests
Original-Change: https://android-review.googlesource.com/1740778
Merged-In: Ia8d76a29646f36941cbb16cd68ae6887100ec8ec
Change-Id: Ia8d76a29646f36941cbb16cd68ae6887100ec8ec
2021-06-29 10:46:51 +00:00
Treehugger Robot
cc77000d9a Remove wigig support from S tethering
Bug: 176520801
Test: atest TetheringTests
Original-Change: https://android-review.googlesource.com/1744652
Merged-In: Id0bf02c01419e0c69a1d0b6a41789826538444d3
Change-Id: Id0bf02c01419e0c69a1d0b6a41789826538444d3
2021-06-29 10:46:16 +00:00
Victor Chang
e4132c8ca0 Merge "Partial cherry-pick to remove IoUtils#deleteContents usage in FrameworksNetTests" into sc-dev 2021-06-29 08:12:04 +00:00
Paul Hu
dca7230c1d Use appId instead of uid
Multiple user's ares of mApps are not initialized in startMonitoring(),
so mApps.get(uid) of multi-user's app returns null in onPackageAdded().
As the result, permission of system uid is updated to "Network" and
any system application cannot use dedicated apn like IMS.
Using appId avoids this problem.

Bug: 168932048
Test: atest FrameworksNetTests

Signed-off-by: Sangcheol Lee <goodsc.lee@samsung.com>
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1733212
Merged-In: Ib8ea2185d8056bddb2ca5a8006f83afb3cffc9f4

Change-Id: Ib8ea2185d8056bddb2ca5a8006f83afb3cffc9f4
2021-06-29 16:07:54 +08:00
Remi NGUYEN VAN
4cb6189802 Fix null PendingIntent in network listens
In S ConnectivityService was changed to use getActiveRequest() to fill
EXTRA_NETWORK_REQUEST, but there is no active request in the case of
listens.

When getActiveRequest() is missing, use the first mRequest instead. This
should match previous behavior.

Bug: 191713869
Test: atest android.net.cts.ConnectivityManagerTest
Original-Change: https://android-review.googlesource.com/1748153
Merged-In: Id7343a4cc020aba16b7979b16334721c56b2839c
Change-Id: Id7343a4cc020aba16b7979b16334721c56b2839c
2021-06-29 07:07:28 +00:00
Remi NGUYEN VAN
64168015f1 Merge "Fix flakes in tests running after testIsPrivateDnsBroken" into sc-dev 2021-06-29 06:51:25 +00:00
Paul Duffin
4c94d16ced Merge "Enable tethering to perform its own hidden API processing" into sc-dev 2021-06-29 06:43:40 +00:00
Treehugger Robot
b91d44a64a Fix flakes in tests running after testIsPrivateDnsBroken
The test would not reconnect wifi after restoring the private DNS setting,
so validation would not be triggered, and it would remain identified as
having broken private DNS.

Reconnect wifi after the test to avoid affecting subsequent tests.

Original-Change: https://android-review.googlesource.com/1749560
Merged-In: Id9beba94e0fed85bd26c0509ad61369be794f3c3
Change-Id: Id9beba94e0fed85bd26c0509ad61369be794f3c3
Test: atest android.net.cts.ConnectivityManagerTest
Bug: 182296835
2021-06-29 04:04:07 +00:00
Paul Duffin
b28cb44e4b Enable tethering to perform its own hidden API processing
Previously, the hidden API encoding of the tethering boot dex jars,
i.e. those dex jars that tethering contributes to the bootclasspath
were done as part of the monolithic hidden API processing. This change
causes the encoding to be done by the tethering's
bootclasspath_fragment.

This change involves the following:
* Addition of the fragments property to the tethering's
  bootclasspath_fragment module to list all the other
  bootclasspath_fragment modules on which this depends.
* Addition of the additional_stubs property to add stubs for APIs that
  are not provided by another bootclasspath_fragment.
* Moving hidden API flag file entries related to tethering from the
  flag files in frameworks/base/boot/hiddenapi directory into the
  tethering directory with an appropriate OWNERS file to allow them to
  be managed by the Soong and compat team.
* Addition of a PREUPLOAD.cfg hook script to ensure that the flag files
  are sorted.

The build automatically checks that the hidden API flags which are
computed by tethering and encoded into its boot dex jars match those
that are generated by the monolithic processing so this is guaranteed
to be safe.

Bug: 179354495
Test: m com.android.tethering
      - ensure that the generated APEX is byte-for-byte identical
        before and after these changes.
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - make sure that they are not changed by this.
Change-Id: I4d9621325c7fcea5043cbca4c577ba2ac6125c0c
Ignore-AOSP-First: merge conflicts
2021-06-28 23:41:38 +01:00
Remi NGUYEN VAN
819045fc60 Partial cherry-pick to remove IoUtils#deleteContents usage in FrameworksNetTests
It's a partial cherry-pick of https://r.android.com/1731232

Bug: 154796679
eest: atest ConnectivityCoverageTests
Merged-In: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
Change-Id: I23565c4144e665130585a86ce66cee6c2da07b60
2021-06-28 16:53:15 +01:00
Victor Chang
99c7bdb1a4 Merge "Remove usage of internal APIs from InetAddress and ServerSocket" into sc-dev 2021-06-28 14:17:12 +00:00
Victor Chang
6fae863801 Remove usage of internal APIs from InetAddress and ServerSocket
It affects the test only.

Bug: 154796679
Test: atest CtsNetTestCases
Merged-In: I77a419c459ee53b36d24f324ecab2b5dae5744de
Change-Id: I77a419c459ee53b36d24f324ecab2b5dae5744de
(cherry picked from commit ef88fadc2e)
2021-06-28 12:11:52 +01:00
Junyu Lai
4ad09c4a74 Check null NetworkSpecifier before redacting
Do null check before redacting, since NetworkSpecifier will not
always be attached. For example, NetworkSpecifier of wifi
network is only attached when a wifi network is created
in response to a network request with specifier attached.

Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testGetAllNetworkStateSnapshots \
      --rerun-until-failure 100
      (tested on cuttlefish mobile and wifi)
Bug: 191944987
Original-Change: https://android-review.googlesource.com/1747893
Merged-In: I5df3547995111fe6340facb94a577296d2228694
Change-Id: I5df3547995111fe6340facb94a577296d2228694
2021-06-28 01:22:42 +00:00
Nucca Chen
fadd7b7a33 Refresh conntrack entry timeout
Needed because the BPF maps offloads IPv4 traffic. The kernel can't
trace the offloaded traffic to keep the conntrack entry.

Bug: 190783768
Test: atest TetheringCoverageTests
Original-Change: https://android-review.googlesource.com/1566871
Merged-In: Idbcf686c9b2124b192944156ac5111be741744fb
Change-Id: Idbcf686c9b2124b192944156ac5111be741744fb
2021-06-26 08:48:52 +00:00
Nucca Chen
01785d7eff Clear IPv4 offload rules when tethering stopped
The condition for deleting IPv4 forwarding rules.
1. When the tethering client has gone, deletes the client and its
   rules.
2. When the upstream has gone, deletes all rules.
3. When the upstream has changed, deletes all rules.

Test: atest TetheringCoverageTests and check IPv4 offload rules
via dumpsys tethering in the following test cases.

Bug: 190783768

Test cases:
a. Loss upstream interface while tethering
  1. Enable WIFI tethering
  2. Disable upstream interface
  3. Check the rules are removed.
b. Loss downstream interfaces while tethering
  1. Enable WIFI tethering
  2. Enable BT tethering
  3. Disable BT tethering
  4. Check the BT tether rules are removed.
  5. Disable WIFI tethering
  6. Check the WIFI tether rules are removed.
c. Switch upstream interface while tethering
  1. Enable WIFI tethering
  2. Enable BT tethering
  3. Switch upstream interface from cellular to wifi.
  4. Check all rules are removed.
d. Enable NAT failure (manual)

Log:
The rule deletion in each case.
- IpServer#stopIPv4: case b and case d.
- BpfCoordinator#updateUpstreamNetworkState: case a and case c.

Test case a
06-23 09:58:59.245  [...] Tethering: [BpfCoordinator]
    updateUpstreamNetworkState tetherOffloadRule4Clear wlan2

Test case b
06-07 22:17:51.886  [..] Tethering: [bt-pan] cleanupUpstream bt-pan
06-07 22:17:51.888  [..] Tethering: [bt-pan] stopIPv4 bt-pan
06-07 22:18:23.769  [..] Tethering: [wlan2] cleanupUpstream wlan2
06-07 22:18:23.772  [..] Tethering: [wlan2] stopIPv4 wlan2

Test case c
06-08 11:11:48.277  [..] Tethering: [BpfCoordinator]
    updateUpstreamNetworkState tetherOffloadRule4Clear bt-pan
06-08 11:11:48.396  [..] Tethering: [BpfCoordinator]
    updateUpstreamNetworkState tetherOffloadRule4Clear wlan2
06-08 11:11:48.579  [..] Tethering: [wlan2] cleanupUpstreamInterface
    wlan2
06-08 11:11:48.808  [..] Tethering: [bt-pan] cleanupUpstreamInterface
    bt-pan

Enabling NAT failure
06-08 13:04:18.117  [..] Tethering: [wlan2] Exception enabling NAT [..]
06-08 13:04:18.234  [..] Tethering: [wlan2] cleanupUpstream wlan2
06-08 13:04:18.246  [..] Tethering: [wlan2] stopIPv4 wlan2

Original-Change: https://android-review.googlesource.com/1579873
Merged-In: Id505a3deb277bbe0f44403234d8ca8bbf01eec80
Change-Id: Id505a3deb277bbe0f44403234d8ca8bbf01eec80
2021-06-26 08:45:39 +00:00
Remi NGUYEN VAN
d5532eac04 Merge "Add back tethering to mainline-postsubmit" into sc-dev 2021-06-25 00:42:10 +00:00
Lorenzo Colitti
9d3a5ede58 Add CTS for BatteryStatsManager new API
Bug: 189308158
Test: This test and
      run testReportNetworkInterfaceForTransports
      with --rerun-until-failure 500
Original-Change: https://android-review.googlesource.com/1722770
Merged-In: I654b8920d6ea1dada782a618776b13870f7f98df
Change-Id: I654b8920d6ea1dada782a618776b13870f7f98df
2021-06-24 03:15:03 +00:00
Yan Yan
dfc9b497fd Merge "Test updating underlying network of IpSecTunnelInterface" into sc-dev 2021-06-24 01:05:26 +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
a244f13f21 Merge "Add ConnectivitySettingsManagerTest" into sc-dev 2021-06-23 16:29:20 +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
Luke Huang
18e0d49a44 Fix the comments from aosp/1719018
1. Test {start,stop}-service
2. Add waitForIdle

Bug: 181810560
Test: atest NsdServiceTest
Original-Change: https://android-review.googlesource.com/1729691
Merged-In: I0953887d1d92a644a29a2e80521469c8cc2aa2fc
Change-Id: I0953887d1d92a644a29a2e80521469c8cc2aa2fc
2021-06-23 09:55:11 +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
Remi NGUYEN VAN
109fd92b3d Add back tethering to mainline-postsubmit
Tethering was removed from mainline-postsubmit while Connectivity was
being added to it, but it can run in postsubmit again now.

If the runs are successful, it can be added to presubmit as well.

Ignore-AOSP-First: Partial revert of change that did not go to AOSP
Bug: 177290955
Test: TH needs to test postsubmit

Change-Id: I5d5dbccd8d14be573104947412a76578b2d7a6c1
2021-06-23 08:19:45 +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
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