Commit Graph

29180 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
48a0dbefbd Fix CtsNetTestCases in instant mode am: 21e5140ff4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15179352

Change-Id: Iea06a9e9a3cbacecf9a5ada088ef3a25fc779e45
2021-07-02 07:32:20 +00:00
Remi NGUYEN VAN
21e5140ff4 Fix CtsNetTestCases in instant mode
Skip tests that cannot run in instant mode, as WifiManager is not
available, and the test cannot bind to sockets in instant mode.

Bug: 192284219
Test: atest CtsNetTestCases -- --enable-parameterized-modules \
        --abi arm64-v8a --module-parameter instant_app
Original-Change: https://android-review.googlesource.com/1753823
Merged-In: I7a7b0169a3a495bb359dc1f72e56937dcdc5b8a8
Change-Id: I7a7b0169a3a495bb359dc1f72e56937dcdc5b8a8
2021-07-02 06:04:35 +00:00
Lucas Lin
be95328ab1 Merge "Print the result of command when test is failed" into sc-dev am: 0def47421d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165009

Change-Id: I953b20df723ee06cbc415a5bfe90ea34298b09bd
2021-07-02 05:44:33 +00:00
Lucas Lin
0def47421d Merge "Print the result of command when test is failed" into sc-dev 2021-07-02 05:27:45 +00:00
Orion Hodson
ce47122578 Remove dependency on stable.core.platform.api.stubs am: 5e5c287d6b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15163615

Change-Id: Iae64d04b662b76582b7579d541d90f6acf6f90ad
2021-07-02 04:57:59 +00:00
Orion Hodson
5e5c287d6b Remove dependency on stable.core.platform.api.stubs
Bug: 183097033
Test: m droid
Original-Change: https://android-review.googlesource.com/1751523
Merged-In: I06cbc7e06e112d61575fad6ad0783348c94e3df2
Change-Id: I06cbc7e06e112d61575fad6ad0783348c94e3df2
2021-07-02 00:42:52 +00:00
Sudheer Shanka
311b28c020 Merge "Skip NetworkPolicyManagerTest on unsupported devices." into sc-dev am: 0a224da8d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15167635

Change-Id: Ibcdf57e5dad03cea9e07cc18c1c3c5b6acdcb5f0
2021-07-01 23:40:25 +00:00
Sudheer Shanka
0a224da8d3 Merge "Skip NetworkPolicyManagerTest on unsupported devices." into sc-dev 2021-07-01 23:28:45 +00:00
Sudheer Shanka
fe89aaad47 Skip NetworkPolicyManagerTest on unsupported devices.
Fixes: 192473577
Test: atest CtsHostsideNetworkTests:HostsideNetworkPolicyManagerTests
Change-Id: Ib90f0045cb574ada792c5d43fcc359c22d20f3a4
Merged-In: Ib90f0045cb574ada792c5d43fcc359c22d20f3a4
2021-07-01 17:10:02 +00:00
TreeHugger Robot
5e427a411e Merge "Make notification icons and autocancel overlayable" into sc-dev am: 2a512b4a16
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15172450

Change-Id: I07a3e28797aaff19d7edd1ac7c965399dd49eaaa
2021-07-01 15:37:38 +00:00
TreeHugger Robot
2a512b4a16 Merge "Make notification icons and autocancel overlayable" into sc-dev 2021-07-01 15:24:43 +00:00
TreeHugger Robot
1dbd4239a7 Merge "Dump the protocol of IPv4 offload rule" into sc-dev am: a575bce0ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164997

Change-Id: I5e167aaf42b5d4cbf23eef34dd2e1ed7c66fc326
2021-07-01 11:03:45 +00:00
TreeHugger Robot
1f798f9800 Merge "Fix testGetAllNetworkStateSnapshots for non-cellular" into sc-dev am: 86a118c060
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15108489

Change-Id: I19519b91d29533ff459c14bca0038d6832db1da6
2021-07-01 11:03:31 +00:00
TreeHugger Robot
a575bce0ed Merge "Dump the protocol of IPv4 offload rule" into sc-dev 2021-07-01 10:54:44 +00:00
TreeHugger Robot
86a118c060 Merge "Fix testGetAllNetworkStateSnapshots for non-cellular" into sc-dev 2021-07-01 10:53:27 +00:00
Treehugger Robot
8ef6bfe5ae Make notification icons and autocancel overlayable
Allow overlays to change the connectivity notification icons, and
whether the notifications are auto-cancelled.

This does not change default behavior, but is necessary to allow vendors
to adapt the notifications to their standards.

Bug: 173171709
Bug: 172048052
Test: atest NetworkNotificationManagerTest
      Added test overlay, verified icon replaced
Original-Change: https://android-review.googlesource.com/1753822
Merged-In: Ibbb765a5e828b8b870cbfb81e89df2dbd2828be7
Change-Id: Ibbb765a5e828b8b870cbfb81e89df2dbd2828be7
2021-07-01 10:44:09 +00:00
Luke Huang
de8cdb81c6 Merge "Fix the comments from aosp/1719018" into sc-dev am: bf9cb4dd18
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15076676

Change-Id: I1645777332b870001c496b464693eb96c223e78b
2021-07-01 10:28:35 +00:00
Lucas Lin
a10f2a5f25 Print the result of command when test is failed
When ConnectivityManagerTest#testGetMultipathPreference() is
failed, it only prints "Unexpected format from cmd netpolicy" and
it's not helpful.
Print the result of command can help people to know what's the
difference between expected result and actual result.

Bug: 187921745
Test: atest CtsNetTestCases:ConnectivityManagerTest#testGetMultipathPreference
Original-Change: https://android-review.googlesource.com/1749262
Merged-In: I63cd4b043e7c70775156aa5244d25ee2268f9f32
Change-Id: I63cd4b043e7c70775156aa5244d25ee2268f9f32
2021-07-01 10:11:13 +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
5f071c5925 Merge "Simplify the return condition in stop()" into sc-dev am: b851d80de2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164994

Change-Id: Ic23afbcaadffaf87ca760473dc5a10cd6e7c02eb
2021-07-01 09:37:44 +00:00
Junyu Lai
4bdfd01aee Merge "Fix network callback with the same PendingIntent does not release" into sc-dev am: 8ba13e99e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164991

Change-Id: Ic875052f9a045c32a19457fa5d154b1502a6a1ab
2021-07-01 09:37:23 +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
21ec633e39 Fix testGetAllNetworkStateSnapshots for non-cellular
bug: 192115694
Test: atest ConnectivityManagerTest#testGetAllNetworkStateSnapshots
Original-Change: https://android-review.googlesource.com/1749483
Merged-In: Ie7f637248302f3e6b61be69ef4c6a7a906e69275
Change-Id: Ie7f637248302f3e6b61be69ef4c6a7a906e69275
2021-07-01 08:47:03 +00:00
Nucca Chen
a4a7825e13 Dump the protocol of IPv4 offload rule
Print the protocol {tcp, udp} of v4 rules in dumpsys.

Format:
proto [inDstMac] iif(iface) src -> nat -> dst [outDstMac] age
  udp [00:00:00:00:00:00] 14(rmnet0) 74.125.10.156:443
  -> 30(30) 10.254.92.123:60262 -> 192.168.128.240:60262
  [0a:bd:b5:e0:41:53] 96067ms

Bug: 190783768
Test: dumpsys tethering
Original-Change: https://android-review.googlesource.com/1753608
Merged-In: Idae1042cfb454cc97b9b103587f11bc0700e0787
Change-Id: Idae1042cfb454cc97b9b103587f11bc0700e0787
2021-07-01 08:31:23 +00:00
TreeHugger Robot
0488f2897d Merge "Fix and test usb function configuration change" into sc-dev am: 424ef2043c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15142213

Change-Id: I4715b27d4ce6f44411703ede576b20811328f113
2021-07-01 07:15:55 +00:00
TreeHugger Robot
3ede39228b Merge "Remove wigig support from S tethering" into sc-dev am: 2e0cdad198
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15142212

Change-Id: Ia708b28d4b2795e0d4c7615d6b2692f61f850be4
2021-07-01 07:15: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
891ba6680a Dump the unused IPv4 BPF rule age correctly am: 59f422694a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164992

Change-Id: Iec2505b0d0648718f6d05445f87be87592f25c49
2021-07-01 04:47:37 +00:00
Chiachang Wang
a7e58ab6bc Trigger the network score update after setting test allow bad wifi am: 6339ec22ad
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164990

Change-Id: I6f47ea4d87d1a065599deb1b4775ba817267ccf4
2021-07-01 03:27:26 +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
e15012586e Merge "Use appId instead of uid" into sc-dev am: eefacbcb5c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15123902

Change-Id: I5ffb87c6a9bfc30899f0c7c4607758f28aa00443
2021-06-30 09:51:46 +00:00
Paul Hu
eefacbcb5c Merge "Use appId instead of uid" into sc-dev 2021-06-30 09:38:26 +00:00
TreeHugger Robot
f156d482f6 Merge "Fix null PendingIntent in network listens" into sc-dev am: 4fd9dfef2d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15136918

Change-Id: Ie000ca0d22891120f5dda8a8088596ef84f02005
2021-06-29 13:49:15 +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
25b288225b Merge "Partial cherry-pick to remove IoUtils#deleteContents usage in FrameworksNetTests" into sc-dev am: e4132c8ca0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15108481

Change-Id: If24c0e920f55f5046fd2a93bfd16004c28f389df
2021-06-29 08:42:12 +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
f0a8dff500 Merge "Fix flakes in tests running after testIsPrivateDnsBroken" into sc-dev am: 64168015f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15135741

Change-Id: Ia82e72dce1742c122e711b4796db98feb6a53f24
2021-06-29 06:58:06 +00:00
Paul Duffin
48edc6d921 Merge "Enable tethering to perform its own hidden API processing" into sc-dev am: 4c94d16ced
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15106963

Change-Id: I2efd1b30cf614617861355b80abc4d526cc7a0bc
2021-06-29 06:57:52 +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