Commit graph android_packages_modules_Co.../tests/unit/java
Message SHA1
Merge "Move BitUtils, RingBuffer test to coretests" am: 6be4ebcb0a am: b65aea1772
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1754897

Change-Id: Ic1a8f779daf2d36dd07b1ce0a84392c74e251263

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-07-05 05:31:16 +00:00
5f01d1d538
Merge "Move BitUtils, RingBuffer test to coretests"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-07-05 05:05:34 +00:00
6be4ebcb0a
Merge "Add tests for in-kernel VPN/VCN dataplane" am: 64619cabc1 am: 4793a34212
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749069

Change-Id: I503c883fd61679862563abea9264d1806a59be62

Benedict Wong   authored and   Automerger Merge Worker   commited 2021-07-02 19:12:24 +00:00
f95947b96f
Merge "Add tests for in-kernel VPN/VCN dataplane"
Benedict Wong   authored and   Gerrit Code Review   commited 2021-07-02 18:42:15 +00:00
64619cabc1
Merge "Listen EXTERNAL_APPLICATIONS_AVAILABLE intent"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-07-02 16:56:12 +00:00
321558ffe8
Listen EXTERNAL_APPLICATIONS_AVAILABLE intent
- Some applications are installed on external storage and they
  are unavailable until exernal storage installed them
  completely. And their permission need update after becoming
  available. Thus, listen EXTERNAL_APPLICATIONS_AVAILABLE intent
  and update those package whose is listed in chaged package
  list.
- Remove user argument on buildPackageInfo() because the uid on
  ApplicationInfo is based uid.

Bug: 145234989
Test: atest FrameworksNetTests
Merged-In: Ia11ca4a7ba6fc1b87c27c0c40e36c91d9cdb322a

Change-Id: Ia11ca4a7ba6fc1b87c27c0c40e36c91d9cdb322a

paulhu   commited 2021-07-02 22:35:26 +08:00
8a4ce40acb
Merge "Listen EXTERNAL_APPLICATIONS_AVAILABLE intent" into sc-dev am: 790d3eb079
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14772860

Change-Id: Ic9f4d305099262efb2ce8f7506cc0b06151717b5

Paul Hu   authored and   Automerger Merge Worker   commited 2021-07-02 14:31:31 +00:00
cedfba2e89
Merge "Listen EXTERNAL_APPLICATIONS_AVAILABLE intent" into sc-dev
Paul Hu   authored and   Android (Google) Code Review   commited 2021-07-02 14:17:17 +00:00
790d3eb079
Merge "Allow non-VPNs to have underlying networks." am: 5903d5646c am: 9a7c9c3c06
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753619

Change-Id: Ic2188f15ce354e44436d4edc7500859e4eb09308

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-07-02 13:55:33 +00:00
8d1e3166cd
Merge "Allow non-VPNs to have underlying networks."
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-07-02 13:28:01 +00:00
5903d5646c
Merge "Use Netd new added/removed uid range methods" into sc-dev am: 29194db12f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14911836

Change-Id: Ie2a855902fd4ad04624a714c71bfaede6f0098e3

Paul Hu   authored and   Automerger Merge Worker   commited 2021-07-02 12:20:24 +00:00
39828864dd
Merge "Use Netd new added/removed uid range methods" into sc-dev
Paul Hu   authored and   Android (Google) Code Review   commited 2021-07-02 12:08:35 +00:00
29194db12f
Allow non-VPNs to have underlying networks.
Certain network types, like the VCN, have underlying
networks for the purpose of data usage, but do not want to
propagate the underlying network capabilities.

Allow these networks to set underlying networks, but continue
not to propagate the capabilities.

Bug: 190620024
Test: new unit test
Change-Id: I53d6080f48707ff3c37fbfbef534284ba77a7432

Lorenzo Colitti   commited 2021-07-02 18:48:25 +09:00
bd079455f1
Add tests for in-kernel VPN/VCN dataplane
This change adds relevant tests for the migrateTun functionality in
NetworkStats.

Bug: 190620024
Test: atest NetworkStatsTest
Change-Id: I33f14f2d0f71013a594fd4c8c3914a590d30ea06

Benedict Wong   commited 2021-07-02 00:39:32 -07:00
1117e853f9
Move BitUtils, RingBuffer test to coretests
The utilities are part of com.android.internal.util, but were
historically tested as part of the services.net tests. They were then
mistakenly moved to packages/modules/Connectivity with the rest of the
networking code, but actually belong in coretests.

Bug: 187935317
Test: atest FrameworksCoreTests
Change-Id: I74702f6a4d9bed5985d2a830dacd78129a7854a8

Remi NGUYEN VAN   commited 2021-07-02 16:24:01 +09:00
a1b3f57eb8
Report result SKIPPED in ConnDiags if the network is not validated. am: f1120be78b am: c6abf3d60c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1718510

Change-Id: I499fa45099d8c2cc05797051d7853b97ed2234e8

Cody Kesting   authored and   Automerger Merge Worker   commited 2021-07-02 06:56:54 +00:00
7efec74a37
Report result SKIPPED in ConnDiags if the network is not validated. am: f1120be78b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1718510

Change-Id: I4135072382e447206ef7634e6e43b7ad5186a00d

Cody Kesting   authored and   Automerger Merge Worker   commited 2021-07-02 06:43:20 +00:00
c6abf3d60c
Merge changes from topic "conn-diags-skipped"
* changes:
  Update ConnDiags CTS test to expect validation result SKIPPED.
  Report result SKIPPED in ConnDiags if the network is not validated.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-07-02 06:26:57 +00:00
05752a5316
Change to REQUEST from LISTEN for mobile data preferred uids feature
- If Mobile data always on is OFF, mobile data preferred uids
  feature does not work.
- We need to request mobile data when MDO list is not empty.

Bug: 171872461
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases

Signed-off-by: Ansik <ansik.shin@samsung.com>
Original-Change: https://android-review.googlesource.com/1751023
Merged-In: Ie9d6b3e39ef16813c4be3979900d226c8f3d656d
Change-Id: Ie9d6b3e39ef16813c4be3979900d226c8f3d656d

Paul Hu   commited 2021-07-02 03:03:07 +00:00
07950df234
Merge "Change to REQUEST from LISTEN for mobile data preferred uids feature" am: 7079b72fa6 am: 9e98dea823
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751023

Change-Id: I18ab49638b3c51f4217c84dcf18a5b4fc7007181

Paul Hu   authored and   Automerger Merge Worker   commited 2021-07-02 01:44:52 +00:00
6bc989a586
Merge "Change to REQUEST from LISTEN for mobile data preferred uids feature"
Paul Hu   authored and   Gerrit Code Review   commited 2021-07-02 01:10:56 +00:00
7079b72fa6
Report result SKIPPED in ConnDiags if the network is not validated.
This CL updates ConnectivityDiagnostics to report
NETWORK_VALIDATION_RESULT_SKIPPED when the platform does not validate
the reported Network. This CL also updates the behavior for
ConnectivityManager#reportNetworkConnectivity, such that it will always
generate a ConnectivityReport on the reported network. If the reported
connectivity does not match the known connectivity of this network, the
network is revalidated and a report is generated. Otherwise,
revalidation is not performed and the cached ConnectivityReport is sent
instead.

This CL also updates ConnDiags behavior for calls to
ConnectivityManager#reportNetworkConnectivity. Specifically, ConnDiags
callbacks are only notified for these calls if:
  a) the call causes the Network to be re-validated, or
  b) the callback registrant was the caller of
     #reportNetworkConnectivity().
For b), the caller is always guaranteed to receive a ConnectivityReport
(a fresh report if the Network is re-validated, else the cached report).

Bug: 162407730
Test: atest FrameworksNetTests ConnectivityDiagnosticsManagerTest
Change-Id: I78b78919d5b0f09348dfdd5fdb37418b8c7f861f

Cody Kesting   commited 2021-07-01 17:38:16 -07:00
f1120be78b
Merge "Make notification icons and autocancel overlayable" am: 2c7e0714c6 am: 0cdc510d6c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753822

Change-Id: If48517cccabc9625cb5a7cc01babc3cff02d639b

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-07-01 10:48:08 +00:00
eb650c896c
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

Treehugger Robot   authored and   Remi NGUYEN VAN   commited 2021-07-01 10:44:09 +00:00
8ef6bfe5ae
Merge "Fix the comments from aosp/1719018" into sc-dev
Luke Huang   authored and   Android (Google) Code Review   commited 2021-07-01 09:49:46 +00:00
bf9cb4dd18
Merge "Make notification icons and autocancel overlayable"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-07-01 09:49:37 +00:00
2c7e0714c6
Merge "Simplify the return condition in stop()" into sc-dev
Lucas Lin   authored and   Android (Google) Code Review   commited 2021-07-01 09:09:39 +00:00
b851d80de2
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
Change-Id: Ibbb765a5e828b8b870cbfb81e89df2dbd2828be7

Remi NGUYEN VAN   commited 2021-07-01 16:04:09 +09:00
3a8198c3ba
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

Lucas Lin   commited 2021-07-01 06:57:53 +00:00
5ca769ef4a
Use Netd new added/removed uid range methods
Replace network[Add|Remove]UidRanges to
network[Add|Remove]UidRangesParcel. The new methods are passing
NativeUidRangeConfig which contains priority value for each uid
range rules.

Bug: 171872461
Test: atest FrameworksNetTests
Test: atest HostsideVpnTests
Ignore-AOSP-First: Need cherry-pick
Change-Id: I08bbdbcb8450b08e6208fa730137348550f9e3d2

paulhu   commited 2021-07-01 03:10:45 +00:00
de2a23958d
Merge "Simplify the return condition in stop()" am: 584ab08627 am: c955dcc84d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1729690

Change-Id: I2dcd10df1d339a1a24e31632b399f960f749d44a

Lucas Lin   authored and   Automerger Merge Worker   commited 2021-07-01 02:13:04 +00:00
b278aac2a3
Merge "Simplify the return condition in stop()"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-07-01 01:46:59 +00:00
584ab08627
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

Treehugger Robot   authored and   Junyu Lai   commited 2021-07-01 01:44:56 +00:00
282f743a8c
Merge "Fix network callback with the same PendingIntent does not release" am: 6d908a513a am: e6517c060f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1727470

Change-Id: I2a27b0f3d3204fcfc3cb2d787fa5c998d45e54de

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-06-30 22:12:04 +00:00
8711b078ff
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
Change-Id: I2454c1c080d8954dd3785d4ac6e96fc4131fdb47

lucaslin   commited 2021-07-01 02:29:53 +08:00
40d931c474
Change to REQUEST from LISTEN for mobile data preferred uids feature
- If Mobile data always on is OFF, mobile data preferred uids
  feature does not work.
- We need to request mobile data when MDO list is not empty.

Bug: 171872461
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases

Signed-off-by: Ansik <ansik.shin@samsung.com>
Change-Id: Ie9d6b3e39ef16813c4be3979900d226c8f3d656d

Ansik   authored and   paulhu   commited 2021-06-30 14:22:34 +00:00
605e77055c
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
Change-Id: I38bdea3a026a78a6dc34b5200d43a75b3cd1ac0c

WeiZhang   authored and   Junyu Lai   commited 2021-06-30 12:05:43 +00:00
1cc3f17413
Merge "Use appId instead of uid" into sc-dev
Paul Hu   authored and   Android (Google) Code Review   commited 2021-06-30 09:38:26 +00:00
eefacbcb5c
Listen EXTERNAL_APPLICATIONS_AVAILABLE intent
- Some applications are installed on external storage and they
  are unavailable until exernal storage installed them
  completely. And their permission need update after becoming
  available. Thus, listen EXTERNAL_APPLICATIONS_AVAILABLE intent
  and update those package whose is listed in chaged package
  list.
- Remove user argument on buildPackageInfo() because the uid on
  ApplicationInfo is based uid.

Bug: 145234989
Test: atest FrameworksNetTests
Ignore-AOSP-First: Need cherry-pick
Change-Id: Ia11ca4a7ba6fc1b87c27c0c40e36c91d9cdb322a

paulhu   commited 2021-06-30 17:07:47 +08:00
4ac225baed
Merge "Re-skip connectivity unit tests before S" am: a9230c1bf7 am: 1f3d8dc5e8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749684

Change-Id: I5ce3c5b7dc333c802890831daf8289985c61301d

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-06-30 08:18:57 +00:00
aec0e35349
Merge "Re-skip connectivity unit tests before S"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-06-30 07:43:08 +00:00
a9230c1bf7
Merge "Add option to make sign-in notification ongoing"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-06-30 05:12:09 +00:00
ea395bf6a0
Re-skip connectivity unit tests before S
The tests are packaged together with other tests in a common coverage
suite, so need to be individually annotated so that they are skipped
before S.

They do not need to pass on platforms older than S, because such
platforms will not updated with the code that is tested.

This applies a previous change, this time using DevSdkIgnoreRunner,
as SdkSuppress does not work as expected in branches that have a
codename 2 versions above the SDK version, as is the case in AOSP.

Bug: 187935317
Test: atest ConnectivityCoverageTests on R
      atest FrameworksNetTests on S
Change-Id: I5808d34459a4c19238baf8873afa7cf942828460

Remi NGUYEN VAN   commited 2021-06-30 12:00:28 +09:00
154cf1da20
Add option to make sign-in notification ongoing
Add an overlay boolean that allows setting the SIGN_IN notification as
an ongoing notification.

This can be useful to make sure users can always easily find the
notification to sign in to a captive portal, as studies have found that
some users have a tendency to dismiss notifications before reading them.
At the same time the notification shade is generally too crowded, which
is what causes such behaviors in the first place, so this option is not
enabled by default and should generally not be enabled without proper
user studies or metrics.

Bug: 173171709
Test: atest NetworkNotificationManagerTest
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ic187d2a2b7e49ad152ea2aa35bb784864b97473c

Remi NGUYEN VAN   commited 2021-06-30 11:59:11 +09:00
57c0380135
Merge "Revert "Skip connectivity unit tests before S"" am: b0c9e64d33 am: af5ae307f2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749498

Change-Id: Ibacbb3f4ca829931b723893a1dd84a2d21de914e

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-06-29 08:57:56 +00:00
6da2b28e57
Merge "Revert "Skip connectivity unit tests before S""
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-06-29 08:14:26 +00:00
b0c9e64d33
Merge "Partial cherry-pick to remove IoUtils#deleteContents usage in FrameworksNetTests" into sc-dev
Victor Chang   authored and   Android (Google) Code Review   commited 2021-06-29 08:12:04 +00:00
e4132c8ca0
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

Paul Hu   authored and   paulhu   commited 2021-06-29 16:07:54 +08:00
dca7230c1d
Revert "Skip connectivity unit tests before S"
This reverts commit 05dd1ba540.

Reason for revert: Skips more tests than it should in AOSP
Bug: 192302892

Change-Id: I7c5638d8c1cc626354d240a06af758e1cdd92e94

Remi NGUYEN VAN   commited 2021-06-29 01:08:00 +00:00
284b3c028c
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

Remi NGUYEN VAN   authored and   Victor Chang   commited 2021-06-28 16:53:15 +01:00
819045fc60