Commit Graph

44282 Commits

Author SHA1 Message Date
Chiachang Wang
48884dd32f [automerger skipped] Trigger the network score update after setting test allow bad wifi am: 6339ec22ad -s ours am: 9d172cc795 -s ours
am skip reason: Merged-In Ie0f777d0030b66dd306332496192c74f6c183284 with SHA-1 f1e09ef031 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164990

Change-Id: I142ff8e701045635cefd52ac6cb11a14430a8e9d
2021-07-01 03:42:21 +00:00
Chiachang Wang
3e273f0bab [automerger skipped] Trigger the network score update after setting test allow bad wifi am: 6339ec22ad am: a7e58ab6bc -s ours
am skip reason: Merged-In Ie0f777d0030b66dd306332496192c74f6c183284 with SHA-1 f1e09ef031 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164990

Change-Id: I7b307b0a0dc7c0639bec3cd194df5d3b9b0c206c
2021-07-01 03:42:07 +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
Chiachang Wang
9d172cc795 [automerger skipped] Trigger the network score update after setting test allow bad wifi am: 6339ec22ad -s ours
am skip reason: Merged-In Ie0f777d0030b66dd306332496192c74f6c183284 with SHA-1 f1e09ef031 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164990

Change-Id: Ibeb036ebb9672e753721da2b064158d66dd4233d
2021-07-01 03:26:31 +00: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
c955dcc84d Merge "Simplify the return condition in stop()" am: 584ab08627
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1729690

Change-Id: Ie0701cb9c61afde51b04c902bd9f13f1e0559841
2021-07-01 01:55:56 +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
073f6e299a Merge "Apply jarjar rules on coverage tests" am: d590b30f72
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749680

Change-Id: Ibd6a0d86d9e70e2cdc83ac0de2f3507902bf8299
2021-07-01 00:52:11 +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
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
Treehugger Robot
e6517c060f Merge "Fix network callback with the same PendingIntent does not release" am: 6d908a513a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1727470

Change-Id: I37b87ca482c8b77444bcb0d0ba575be61ab7d3ad
2021-06-30 21:59:16 +00:00
Treehugger Robot
6d908a513a Merge "Fix network callback with the same PendingIntent does not release" 2021-06-30 21:43:15 +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
Chiachang Wang
e0dfa2face Merge "Trigger the network score update after setting test allow bad wifi" am: 4bb141787b am: 91693952de am: 4143a2f97b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751588

Change-Id: I4de90ec6772859a5c7fca7eac687d997955970f7
2021-06-30 14:45:46 +00:00
Chiachang Wang
4143a2f97b Merge "Trigger the network score update after setting test allow bad wifi" am: 4bb141787b am: 91693952de
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751588

Change-Id: I3e544434c4ffeda7eab183f64f9c212ae162588f
2021-06-30 14:33:06 +00:00
Chiachang Wang
91693952de Merge "Trigger the network score update after setting test allow bad wifi" am: 4bb141787b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751588

Change-Id: Ic9949766b84c1003f7f542aa9ca78d5535d01577
2021-06-30 14:24:32 +00:00
Chiachang Wang
4bb141787b Merge "Trigger the network score update after setting test allow bad wifi" 2021-06-30 14:14:03 +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
Paul Hu
4da8f09412 [automerger skipped] Merge "Use appId instead of uid" into sc-dev am: eefacbcb5c -s ours am: cee2b58834 -s ours
am skip reason: Merged-In Ib8ea2185d8056bddb2ca5a8006f83afb3cffc9f4 with SHA-1 1e5d742596 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15123902

Change-Id: Icc45839b6042219d24facd441f5f4b5ea9016d64
2021-06-30 10:03:35 +00:00
Paul Hu
0905202af7 [automerger skipped] Merge "Use appId instead of uid" into sc-dev am: eefacbcb5c am: e15012586e -s ours
am skip reason: Merged-In Ib8ea2185d8056bddb2ca5a8006f83afb3cffc9f4 with SHA-1 1e5d742596 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15123902

Change-Id: If328de573e9453f1dcfedbfce2aca5fbb9ba4dcc
2021-06-30 10:03:27 +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
cee2b58834 [automerger skipped] Merge "Use appId instead of uid" into sc-dev am: eefacbcb5c -s ours
am skip reason: Merged-In Ib8ea2185d8056bddb2ca5a8006f83afb3cffc9f4 with SHA-1 1e5d742596 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15123902

Change-Id: Ie9e95f2b7d166033b0ee2189ad63a380604c2d59
2021-06-30 09:50:42 +00:00
Paul Hu
eefacbcb5c Merge "Use appId instead of uid" into sc-dev 2021-06-30 09:38:26 +00:00
Paul Duffin
a51823513e [automerger skipped] Merge "Enable tethering to perform its own hidden API processing" am: d8a8041ffc am: dd5ece3d19 -s ours am: 1ee498841d -s ours
am skip reason: Merged-In I4d9621325c7fcea5043cbca4c577ba2ac6125c0c with SHA-1 b28cb44e4b is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1748800

Change-Id: I3a448cf5998b7e802b1c52794ac9fcc5032426fc
2021-06-30 09:00:34 +00:00
Paul Duffin
1ee498841d [automerger skipped] Merge "Enable tethering to perform its own hidden API processing" am: d8a8041ffc am: dd5ece3d19 -s ours
am skip reason: Merged-In I4d9621325c7fcea5043cbca4c577ba2ac6125c0c with SHA-1 b28cb44e4b is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1748800

Change-Id: Ibca4e880a1455257517525d26277247b2c493acb
2021-06-30 08:45:25 +00:00
Chiachang Wang
f1e09ef031 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
Change-Id: Ie0f777d0030b66dd306332496192c74f6c183284
2021-06-30 16:41:59 +08: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
Paul Duffin
dd5ece3d19 Merge "Enable tethering to perform its own hidden API processing" am: d8a8041ffc
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1748800

Change-Id: I7885f619b84bc9a998697f2b68e8059c59476494
2021-06-30 08:36:42 +00:00
Paul Duffin
d8a8041ffc Merge "Enable tethering to perform its own hidden API processing" 2021-06-30 08:19:02 +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
1f3d8dc5e8 Merge "Re-skip connectivity unit tests before S" am: a9230c1bf7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749684

Change-Id: I4e3f42424fd76fdfae2c87af91bc4eaaf5c296d8
2021-06-30 08:02:50 +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
e18bdeb24a [automerger skipped] Merge "Add option to make sign-in notification ongoing" am: ea395bf6a0 am: 4154629272 -s ours am: 1032563615 -s ours
am skip reason: Merged-In I3c2563d4ae4e3715d0c6270344ba8f7ef067872f with SHA-1 2afd0986d3 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751960

Change-Id: Ibc07b68c6b7cbc2f035d6aecfdc779cbeb8da892
2021-06-30 05:58:39 +00:00
Remi NGUYEN VAN
1032563615 [automerger skipped] Merge "Add option to make sign-in notification ongoing" am: ea395bf6a0 am: 4154629272 -s ours
am skip reason: Merged-In I3c2563d4ae4e3715d0c6270344ba8f7ef067872f with SHA-1 2afd0986d3 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751960

Change-Id: I8d70b9c29b518e60e7d9753393f66a7eac6eb91c
2021-06-30 05:42:22 +00:00
Remi NGUYEN VAN
4154629272 Merge "Add option to make sign-in notification ongoing" am: ea395bf6a0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751960

Change-Id: I61e852037ee8f38ebe89eab21e82df9a7b7c5810
2021-06-30 05:27:40 +00: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
Paul Duffin
f9a0c868c4 Enable tethering to perform its own hidden API processing
Previously, the hidden API encoding of the tethering boot dex jars,
i.e. those dex jars that tethering contributes to the bootclasspath
were done as part of the monolithic hidden API processing. This change
causes the encoding to be done by the tethering's
bootclasspath_fragment.

This change involves the following:
* Addition of the fragments property to the tethering's
  bootclasspath_fragment module to list all the other
  bootclasspath_fragment modules on which this depends.
* Addition of the additional_stubs property to add stubs for APIs that
  are not provided by another bootclasspath_fragment.

The build automatically checks that the hidden API flags which are
computed by tethering and encoded into its boot dex jars match those
that are generated by the monolithic processing so this is guaranteed
to be safe.

Bug: 179354495
Test: m com.android.tethering
      - ensure that the generated APEX is byte-for-byte identical
        before and after these changes.
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - make sure that they are not changed by this.
(cherry picked from b28cb44e4b)

Merged-In: I4d9621325c7fcea5043cbca4c577ba2ac6125c0c
Change-Id: I4d9621325c7fcea5043cbca4c577ba2ac6125c0c
2021-06-30 00:00:41 +01:00
Hungming Chen
81e193089f Dump the unused IPv4 BPF rule age correctly am: e7dff2f955 am: e9deba21ad am: a2a34a90d7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751022

Change-Id: Ia533d227c66e228f93f5852b2ddeae3440a794c7
2021-06-29 16:36:40 +00:00
Hungming Chen
a2a34a90d7 Dump the unused IPv4 BPF rule age correctly am: e7dff2f955 am: e9deba21ad
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751022

Change-Id: I3704db91381858a88f51972692af78f14e6d2e0c
2021-06-29 16:22:38 +00:00
Hungming Chen
e9deba21ad Dump the unused IPv4 BPF rule age correctly am: e7dff2f955
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1751022

Change-Id: I8370822cd5c96e28b51a54759bced40d556fde84
2021-06-29 16:09:55 +00:00
TreeHugger Robot
8a7b56c6a8 [automerger skipped] Merge "Fix null PendingIntent in network listens" into sc-dev am: 4fd9dfef2d -s ours am: 1c4e80dfa3 -s ours
am skip reason: Merged-In Id7343a4cc020aba16b7979b16334721c56b2839c with SHA-1 1e238a87e9 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15136918

Change-Id: I799216a77c448240c34a3827afbfea516f469f74
2021-06-29 14:02:11 +00:00
TreeHugger Robot
7349f5876d [automerger skipped] Merge "Fix null PendingIntent in network listens" into sc-dev am: 4fd9dfef2d am: f156d482f6 -s ours
am skip reason: Merged-In Id7343a4cc020aba16b7979b16334721c56b2839c with SHA-1 1e238a87e9 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15136918

Change-Id: I7fda2e9d6a0dea3af43f1780a38b81513843e837
2021-06-29 14:01:53 +00:00