Commit Graph

3778 Commits

Author SHA1 Message Date
Treehugger Robot
321558ffe8 Merge "Listen EXTERNAL_APPLICATIONS_AVAILABLE intent" 2021-07-02 16:56:12 +00:00
paulhu
8a4ce40acb 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
2021-07-02 22:35:26 +08:00
Paul Hu
cedfba2e89 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
2021-07-02 14:31:31 +00:00
Paul Hu
790d3eb079 Merge "Listen EXTERNAL_APPLICATIONS_AVAILABLE intent" into sc-dev 2021-07-02 14:17:17 +00:00
Treehugger Robot
4703a8c392 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
Original-Change: https://android-review.googlesource.com/1753619
Merged-In: I53d6080f48707ff3c37fbfbef534284ba77a7432
Change-Id: I53d6080f48707ff3c37fbfbef534284ba77a7432
2021-07-02 13:56:28 +00:00
Treehugger Robot
8d1e3166cd 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
2021-07-02 13:55:33 +00:00
Treehugger Robot
47202851ec Merge "Force only system uid can set uids allowed on restricted networks" 2021-07-02 13:52:50 +00:00
Treehugger Robot
5903d5646c Merge "Allow non-VPNs to have underlying networks." 2021-07-02 13:28:01 +00:00
Paul Hu
39828864dd 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
2021-07-02 12:20:24 +00:00
Paul Hu
29194db12f Merge "Use Netd new added/removed uid range methods" into sc-dev 2021-07-02 12:08:35 +00:00
paulhu
92f128c51c Force only system uid can set uids allowed on restricted networks
- Check whether calling UID/PID is system_server.
- For CTS test, enforce NETWORK_SETTINGS permission otherwise if
  it's a debug build.

Bug: 175199465
Test: atest FrameworksNetTests
Test: atest ConnectivityManagerTest#testUidsAllowedOnRestrictedNetworks
Merged-In: I175a831671d3e52460d28203b09f6c0dda56b61c

Change-Id: I175a831671d3e52460d28203b09f6c0dda56b61c
2021-07-02 20:04:50 +08:00
Paul Hu
93e9d0c1f6 Merge "Force only system uid can set uids allowed on restricted networks" into sc-dev am: 77739d37b3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15172131

Change-Id: Ic688c1515f55de1a7f1ac784c5f6172429ac1902
2021-07-02 11:02:26 +00:00
Paul Hu
77739d37b3 Merge "Force only system uid can set uids allowed on restricted networks" into sc-dev 2021-07-02 10:46:19 +00:00
Lorenzo Colitti
bd079455f1 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
2021-07-02 18:48:25 +09:00
TreeHugger Robot
f5f8e4e3a5 Merge "Change to REQUEST from LISTEN for mobile data preferred uids feature" into sc-dev 2021-07-02 09:27:38 +00:00
TreeHugger Robot
8d75184baf Merge "Test Entitlement when telephony is present" into sc-dev 2021-07-02 08:29:15 +00:00
Benedict Wong
1117e853f9 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
2021-07-02 00:39:32 -07:00
Remi NGUYEN VAN
a1b3f57eb8 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
2021-07-02 16:24:01 +09:00
Lorenzo Colitti
a27e4fa269 Merge changes from topic "conn-diags-skipped" am: 05752a5316 am: da7f313fb4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1665082

Change-Id: I11d040232c8e24747966c7aa22a9c3bc7c3150c4
2021-07-02 06:56:58 +00:00
Cody Kesting
7efec74a37 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
2021-07-02 06:56:54 +00:00
Cody Kesting
c6abf3d60c 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
2021-07-02 06:43:20 +00:00
Lorenzo Colitti
05752a5316 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.
2021-07-02 06:26:57 +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
Treehugger Robot
0cc6f3b99d Test Entitlement when telephony is present
bug: 187331752
Test: atest android.tethering.test.TetheringManagerTest
Original-Change: https://android-review.googlesource.com/1735336
Merged-In: I9fbb7141691fbbf8685b46359c050e0385928805
Change-Id: I9fbb7141691fbbf8685b46359c050e0385928805
2021-07-02 05:48:23 +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
Treehugger Robot
505f30c572 Merge "Test Entitlement when telephony is present" am: 93773f0aa0 am: f780194b25
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1735336

Change-Id: I0df5ed172ea00f2d2bf44e8f37c1b417fc9245b7
2021-07-02 04:41:18 +00:00
Remi NGUYEN VAN
899b99040c Merge "Fix CtsNetTestCases in instant mode" am: 81be2bd036 am: b786afa6e3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753823

Change-Id: I283c7e665673f148b447847ff1d96a2efa70f11c
2021-07-02 04:37:08 +00:00
Treehugger Robot
93773f0aa0 Merge "Test Entitlement when telephony is present" 2021-07-02 04:28:18 +00:00
Remi NGUYEN VAN
81be2bd036 Merge "Fix CtsNetTestCases in instant mode" 2021-07-02 04:07:05 +00:00
Paul Hu
07950df234 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
2021-07-02 03:03:07 +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
Paul Hu
6bc989a586 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
2021-07-02 01:44:52 +00:00
Paul Hu
7079b72fa6 Merge "Change to REQUEST from LISTEN for mobile data preferred uids feature" 2021-07-02 01:10:56 +00:00
Cody Kesting
69ec69341e Update ConnDiags CTS test to expect validation result SKIPPED.
This CL updates ConnectivityDiagnosticsManagerTest to expect
NETWORK_VALIDATION_RESULT_SKIPPED for its TestNetworks. The tests also
expect a ConnectivityReport to be sent for all calls to
ConnectivityManager#reportNetworkConnectivity.

Bug: 162407730
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: I525ea22a38c54a6b5b969a70301852e7af12849c
2021-07-01 17:38:17 -07:00
Cody Kesting
f1120be78b 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
2021-07-01 17:38:16 -07:00
Sudheer Shanka
0a224da8d3 Merge "Skip NetworkPolicyManagerTest on unsupported devices." into sc-dev 2021-07-01 23:28:45 +00:00
Sudheer Shanka
d80b8cc4a9 Merge "Skip tests on unsupported devices." am: 0dc6206752 am: f8110a2cda
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753865

Change-Id: Ib0d27578e15d6f4af77723700ca564ecf15c0f4e
2021-07-01 17:28:49 +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
Sudheer Shanka
0dc6206752 Merge "Skip tests on unsupported devices." 2021-07-01 16:59:46 +00:00
TreeHugger Robot
2a512b4a16 Merge "Make notification icons and autocancel overlayable" into sc-dev 2021-07-01 15:24:43 +00:00
paulhu
03635b3ad5 Force only system uid can set uids allowed on restricted networks
- Check whether calling UID/PID is system_server.
- For CTS test, enforce NETWORK_SETTINGS permission otherwise if
  it's a debug build.

Bug: 175199465
Test: atest FrameworksNetTests
Test: atest ConnectivityManagerTest#testUidsAllowedOnRestrictedNetworks
Ignore-AOSP-First: Need cherry-pick
Change-Id: I175a831671d3e52460d28203b09f6c0dda56b61c
2021-07-01 23:01:41 +08:00
TreeHugger Robot
86a118c060 Merge "Fix testGetAllNetworkStateSnapshots for non-cellular" into sc-dev 2021-07-01 10:53:27 +00:00
Treehugger Robot
eb650c896c 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
2021-07-01 10:48:08 +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
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
Treehugger Robot
2c7e0714c6 Merge "Make notification icons and autocancel overlayable" 2021-07-01 09:49:37 +00:00
Remi NGUYEN VAN
f9d8719d64 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
Change-Id: I7a7b0169a3a495bb359dc1f72e56937dcdc5b8a8
2021-07-01 18:48:27 +09:00
Lucas Lin
b851d80de2 Merge "Simplify the return condition in stop()" into sc-dev 2021-07-01 09:09:39 +00:00