Commit Graph

3245 Commits

Author SHA1 Message Date
Lorenzo Colitti
363526b6d2 Merge changes from topic "conn-diags-skipped" am: 05752a5316 am: da7f313fb4 am: a27e4fa269
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1665082

Change-Id: Ia7264c28b0260c18c6f489371fdf6856e96a9539
2021-07-02 07:14:37 +00:00
Cody Kesting
fd8b1fbca5 Report result SKIPPED in ConnDiags if the network is not validated. am: f1120be78b am: c6abf3d60c am: 7efec74a37
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1718510

Change-Id: Iddfdafdcfafbc5a0ee70be0de489d6f3c716e9dd
2021-07-02 07:14:31 +00: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
Treehugger Robot
4b650196a0 Merge "Test Entitlement when telephony is present" am: 93773f0aa0 am: f780194b25 am: 505f30c572
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1735336

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

Change-Id: I6dd0bdcaa8720e4ba0dea8e314e1b15cf6b233f6
2021-07-02 04:48:56 +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
b68eda8105 Merge "Change to REQUEST from LISTEN for mobile data preferred uids feature" am: 7079b72fa6 am: 9e98dea823 am: 6bc989a586
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751023

Change-Id: Ie2685f7264dd127048b8b36539d6739458248302
2021-07-02 02:03:14 +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
5bb04c584d Merge "Skip tests on unsupported devices." am: 0dc6206752 am: f8110a2cda am: d80b8cc4a9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753865

Change-Id: I6ed43269eb2c061b342afef1d109078b345370d1
2021-07-01 17:49:24 +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
0dc6206752 Merge "Skip tests on unsupported devices." 2021-07-01 16:59:46 +00:00
Treehugger Robot
a1e4470a3a Merge "Make notification icons and autocancel overlayable" am: 2c7e0714c6 am: 0cdc510d6c am: eb650c896c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753822

Change-Id: Icd0524fac36d10aeeb20fbe9952e07b87e4ecb4f
2021-07-01 10:49:26 +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
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
c09c9cbd72 Merge "Print the result of command when test is failed" am: c28bb26888 am: 864c93bf07 am: 4ae105f517
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749262

Change-Id: I79f0989ed49adf0abe190b16472af5c345592ae9
2021-07-01 08:13:21 +00:00
Treehugger Robot
df3eb4551e Merge "Fix testGetAllNetworkStateSnapshots for non-cellular" am: ddf3660af8 am: f786aa57e9 am: a0dd923ffb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749483

Change-Id: I5b38f930b1e19868f709f75a4fc9a33eccc6b8ab
2021-07-01 08:13:14 +00:00
Sudheer Shanka
f90750e26a Skip tests on unsupported devices.
Fixes: 192473577
Test: atest CtsHostsideNetworkTests:HostsideNetworkPolicyManagerTests
Change-Id: Ib90f0045cb574ada792c5d43fcc359c22d20f3a4
2021-07-01 08:08:30 +00:00
Lucas Lin
4ae105f517 Merge "Print the result of command when test is failed" am: c28bb26888 am: 864c93bf07
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749262

Change-Id: I1ec8cc0a99bcd730792b0d46a6e11119cd2f54fa
2021-07-01 07:55:37 +00:00
Treehugger Robot
a0dd923ffb Merge "Fix testGetAllNetworkStateSnapshots for non-cellular" am: ddf3660af8 am: f786aa57e9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749483

Change-Id: I983838a0e9a0b32d0ab66bbdcfdb117c9652cf55
2021-07-01 07:55:32 +00:00
Lucas Lin
c28bb26888 Merge "Print the result of command when test is failed" 2021-07-01 07:49:03 +00:00
Treehugger Robot
ddf3660af8 Merge "Fix testGetAllNetworkStateSnapshots for non-cellular" 2021-07-01 07:44:50 +00:00
Remi NGUYEN VAN
3a8198c3ba 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
2021-07-01 16:04:09 +09:00
Lucas Lin
7059292726 Merge "Simplify the return condition in stop()" am: 584ab08627 am: c955dcc84d am: b278aac2a3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1729690

Change-Id: If4f1980844e042eb897db548e5afa10799917aff
2021-07-01 02:33:00 +00:00
Lucas Lin
b278aac2a3 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
2021-07-01 02:13:04 +00:00
Lucas Lin
584ab08627 Merge "Simplify the return condition in stop()" 2021-07-01 01:46:59 +00:00
Remi NGUYEN VAN
aa56ebdcb7 Merge "Apply jarjar rules on coverage tests" am: d590b30f72 am: 073f6e299a am: 4a980eebf5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749680

Change-Id: I9ffdff991415b7e353c5962b8fdf0985faa80e2b
2021-07-01 01:22:38 +00:00
Remi NGUYEN VAN
4a980eebf5 Merge "Apply jarjar rules on coverage tests" am: d590b30f72 am: 073f6e299a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749680

Change-Id: I80209723541bdfb8f5b08cd5e9cf0e76afa3593e
2021-07-01 01:08:32 +00:00
Remi NGUYEN VAN
d590b30f72 Merge "Apply jarjar rules on coverage tests" 2021-06-30 23:53:57 +00:00
Treehugger Robot
eee8e24724 Merge "Fix network callback with the same PendingIntent does not release" am: 6d908a513a am: e6517c060f am: 8711b078ff
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1727470

Change-Id: I92046b205588e4e88a1866bd81e15748a2ec08a4
2021-06-30 22:25:04 +00:00
Treehugger Robot
8711b078ff 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
2021-06-30 22:12:04 +00:00
lucaslin
40d931c474 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
2021-07-01 02:29:53 +08:00
Ansik
605e77055c 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
2021-06-30 14:22:34 +00:00
WeiZhang
1cc3f17413 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
2021-06-30 12:05:43 +00:00
Remi NGUYEN VAN
f920878bc1 Merge "Re-skip connectivity unit tests before S" am: a9230c1bf7 am: 1f3d8dc5e8 am: aec0e35349
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749684

Change-Id: I485a07ba29fd9297ed47275e6c540a50937e34f9
2021-06-30 08:36:58 +00:00
Remi NGUYEN VAN
aec0e35349 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
2021-06-30 08:18:57 +00:00
Remi NGUYEN VAN
a9230c1bf7 Merge "Re-skip connectivity unit tests before S" 2021-06-30 07:43:08 +00:00
Remi NGUYEN VAN
8ea5ee6d33 Apply jarjar rules on coverage tests
Apply their respective jarjar rules on tethering and general
connectivity tests, then merge both into the coverage tests suite.
This is necessary to ensure that classes covered by tests have names
matching classes used in code.

Also fix IpConnectivityLogTest to use the module utility instead of the
hidden BitUtils, as the test would fail after internal utils are
jarjared.

Bug: 187935317
Test: atest ConnectivityCoverageTests TetheringCoverageTests
Change-Id: Ib95b58dab93f7adebc445b662a6d15db1ce0e7c2
2021-06-30 16:00:26 +09:00
Remi NGUYEN VAN
ea395bf6a0 Merge "Add option to make sign-in notification ongoing" 2021-06-30 05:12:09 +00:00
Remi NGUYEN VAN
154cf1da20 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
2021-06-30 12:00:28 +09:00
Remi NGUYEN VAN
57c0380135 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
2021-06-30 11:59:11 +09:00