Commit Graph

2811 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
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
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
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
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
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
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
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
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
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
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
e1aae8471e Merge "Remove usage of internal APIs from InetAddress and ServerSocket" into sc-dev am: 99c7bdb1a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15015192

Change-Id: Ie62012e26e1d44b02ec58beea554e5429aca3088
2021-06-28 14:28:01 +00: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
5202b76a71 Check null NetworkSpecifier before redacting am: 4ad09c4a74
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15121422

Change-Id: I9092bfd9eedf04b68fc5f6d8091dcff733d943b7
2021-06-28 06:19:10 +00: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
Lorenzo Colitti
b0a55740ab Add CTS for BatteryStatsManager new API am: 9d3a5ede58
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15082047

Change-Id: Ie217e2bec3c63284f73cedabb035f7d079fa8121
2021-06-24 09:44:07 +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
aa5e681d92 Merge "Test updating underlying network of IpSecTunnelInterface" into sc-dev am: dfc9b497fd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15068514

Change-Id: I9d2a9a3d806cc6cf76994b0762dab31771166045
2021-06-24 01:27:53 +00:00
Yan Yan
dfc9b497fd Merge "Test updating underlying network of IpSecTunnelInterface" into sc-dev 2021-06-24 01:05:26 +00:00
paulhu
85b11cfd19 Add test for CSM#[get|set]UidsAllowedOnRestrictedNetworks am: 342ee18b57
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15081393

Change-Id: I0d23b667251e1372d76601805bb55d90dc916739
2021-06-23 19:35:04 +00:00
Paul Hu
341971c0e1 Merge "Add ConnectivitySettingsManagerTest" into sc-dev am: a244f13f21
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15079711

Change-Id: I621d54f7290c45d73db9369364a19f544915943c
2021-06-23 16:47:11 +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
e89ecee138 Merge changes I77dc5556,If772078c,Idb19b0f7 into sc-dev am: e7ac3ffec5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15079710

Change-Id: I3bb589deffd64544931966e94502a658f3945d10
2021-06-23 16:24:57 +00:00
Chiachang Wang
8bb531f3af Provide a way to override the avoid bad wifi configuration am: fad30e3d84
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15068262

Change-Id: I918e3af3e637cfa20c0943c197780411f99e41f1
2021-06-23 16:24:55 +00:00
Remi NGUYEN VAN
3e19171609 Remove ConnectivityServiceTest signature perms use am: ff55aeb916
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15076673

Change-Id: I82e8d3473fab1c5190b18e123f6ced4ad9a7bc1d
2021-06-23 16:24:52 +00:00
TreeHugger Robot
30ebf987bb Merge "Add basic tests for InvalidPacketException" into sc-dev am: 06b27811c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15076675

Change-Id: I028a47e25820a13a2ebfb4354f52618564a954e7
2021-06-23 16:23:50 +00:00
TreeHugger Robot
c0459cdcb8 Merge "Move ConnectivityDiagnosticsManagerTest to common" into sc-dev am: ac6a28907a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15076674

Change-Id: I593327a7edc6327e3f0277b08d204ec4474579c9
2021-06-23 16:23:36 +00:00