Commit graph

13,045 commits

Message SHA1
Move network selection utils to Connectivity
NetworkScore, IOnCompleteListener should be in the Connectivity scope,
as they are supporting classes for the ConnectivityManager APIs.

Bug: 181512874
Test: m
Change-Id: I6dc40a80e0bf5f86f5625b657b01eba969d41fcf

Remi NGUYEN VAN   commited 2021-03-18 23:57:26 +09:00
65b24f7034
Add InetAddressCompat
Although the InetAddress symbols used by Connectivity are stable core
platform API, and should be usable, the core_current stubs are not yet
part of the module_current API.
Until that is fixed, add an InetAddressCompat utility that calls the
three static methods by reflection.

Test: atest FrameworksNetTests CtsNetTestCases
Bug: 183097033
Change-Id: I797009aeff1d39ae2dc06ef69d2e235689b43c89

Remi NGUYEN VAN   commited 2021-03-18 23:54:04 +09:00
33e3abb3b5
Add startCaptivePortalApp to system API
The API is already used by settings and should be usable by setup
wizards. It is the only way for a caller outside of the system_server to
trigger the captive portal application.

The API is already CTS tested in android.net.cts.CaptivePortalTest.

Fixes: 182871577
Test: atest CtsNetTestCases:android.net.cts.CaptivePortalTest
Change-Id: Ie8d9a546b54524ba837715baa94a07d1f993d8d3

Remi NGUYEN VAN   authored and   Chiachang Wang   commited 2021-03-18 22:41:00 +08:00
bffe51d589
Merge "Expose systemReady for SystemServer" am: 33737f6ac4 am: 7d2c52067f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640142

Change-Id: Ic700e27e679a1f56b69ef082d4f5c7f5d12f8b6e

Lucas Lin   authored and   Automerger Merge Worker   commited 2021-03-18 14:29:20 +00:00
91ee69fca8
Merge changes from topic "replaceUidRange" am: 7b582e9749 am: 38794c5290
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626206

Change-Id: Ie767ae0818210b2f4946450bc6784b89514ff3ad

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-18 14:28:58 +00:00
28f5f912c5
Merge "Expose APIs for Settings" am: 53178361ae am: 94e9fb339f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644202

Change-Id: I4a65fa2e637a01f13ac14d8413a7be47a37c7937

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-18 14:28:48 +00:00
259c30a6de
Merge "Add a VpnManager.TYPE_VPN_OEM." am: 96d66bb7b8 am: 6ace66ed21
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644265

Change-Id: Ic6865adf525d216d38c999a74bb4ffa35641e8a3

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-18 14:28:32 +00:00
7853e40205
Merge "Expose systemReady for SystemServer" am: 33737f6ac4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640142

Change-Id: I4680cd76d6e5c074e291bddcf1bd4bd3871365a1

Lucas Lin   authored and   Automerger Merge Worker   commited 2021-03-18 14:05:03 +00:00
7d2c52067f
Merge changes from topic "replaceUidRange" am: 7b582e9749
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626206

Change-Id: I3d62d9c03ab6a418e23dd6c5e6f8317b7b375f9c

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-18 14:01:33 +00:00
38794c5290
Merge "Expose APIs for Settings" am: 53178361ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644202

Change-Id: Ia47e8efc3cc3f40b396c0aa0bd49afea2385e9c3

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-18 13:53:36 +00:00
94e9fb339f
Merge "Add a VpnManager.TYPE_VPN_OEM." am: 96d66bb7b8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644265

Change-Id: Ie010e23484d9ec7ad31631d72292cc52c96f2c10

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-18 13:50:18 +00:00
6ace66ed21
Merge "Expose systemReady for SystemServer"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-18 13:40:54 +00:00
33737f6ac4
Correct the logic in NetworkCapabilitiesTest
setOwnerUid() and setAdministratorUids() should run in R+.
Previous logic will skip them in S+. Correct the logic to
what it should be.

Bug: 172183305
Test: atest android.net.NetworkCapabilitiesTest
Change-Id: I46f7dab5eb50cbdcd58aa4c58f43829d10b6c3d8

Chiachang Wang   commited 2021-03-18 13:37:31 +00:00
628ada1d2d
Merge changes from topic "replaceUidRange"
* changes:
  Expose uids related APIs in NetworkRequest and NetworkCapabilities
  Replace the usage of UidRange

Chiachang Wang   authored and   Gerrit Code Review   commited 2021-03-18 13:36:39 +00:00
7b582e9749
Merge "Address remaining comments on aosp/1607893" am: 08b0411d4f am: ec138734a7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640140

Change-Id: Ib54802430fc785ac4cf6094c42c26bb654b361df

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-18 13:31:33 +00:00
4c83d1509c
Merge "Move constants to MODULE_LIB" am: 229cf59510 am: 39356af73f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640141

Change-Id: Ifc5436f5729ffcc40d069bfc649091d2b8821a0e

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-18 13:31:10 +00:00
80e68e5d1d
Merge "Add more connectivity module settings" am: 9abe34a466 am: 88d4fc79df
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641784

Change-Id: I269802c5a036181e9eaf90862dbf50b66610f78d

Paul Hu   authored and   Automerger Merge Worker   commited 2021-03-18 13:30:33 +00:00
82227141f6
Merge "Expose APIs for Settings"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-03-18 13:27:47 +00:00
53178361ae
Merge "Add a VpnManager.TYPE_VPN_OEM."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-03-18 13:12:08 +00:00
96d66bb7b8
Merge "Address remaining comments on aosp/1607893" am: 08b0411d4f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640140

Change-Id: I49b1ea7e3461ef0cad563d5d7933b5535f94d08c

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-18 12:59:06 +00:00
ec138734a7
Merge "Move constants to MODULE_LIB" am: 229cf59510
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640141

Change-Id: Ib22b9f3223af2cfe51438e2e19584ec089a4e9d2

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-18 12:55:57 +00:00
39356af73f
Merge "Add more connectivity module settings" am: 9abe34a466
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641784

Change-Id: If6fab011720145f2ba18df478e6660be442bcad5

Paul Hu   authored and   Automerger Merge Worker   commited 2021-03-18 12:53:52 +00:00
88d4fc79df
Expose getCapabilities
Expose getCapabilities() for EthernetNetworkFactory.

Bug: 182963415
Test: m ethernet-service
Change-Id: I430416af8fae3d4ee99f2f2abe529e3051e9e5cb

lucaslin   commited 2021-03-18 20:30:22 +08:00
e01f6d4df4
Merge "Address remaining comments on aosp/1607893"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-18 12:30:14 +00:00
08b0411d4f
Address remaining comments on aosp/1607893
Test: ConnectivityServiceTest
Change-Id: Icf70b20624604bfade37804311a77ef6be564c09

Chalard Jean   commited 2021-03-18 12:30:00 +00:00
4de6088dc9
Merge "Move constants to MODULE_LIB"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-18 12:29:38 +00:00
229cf59510
Merge "Add more connectivity module settings"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-18 12:22:55 +00:00
9abe34a466
Add SystemMessages protos to Connectivity
This follows the model used for the same protos by the Wifi module in
service-wifi.

SystemMessageProto is used by NetworkNotificationManager to define IDs
for notifications that are also counted in system notification metrics.

Bug: 171860710
Test: m
Change-Id: Iec674913fad9ad59c04249714a08b5a0d8ab0f84

Remi NGUYEN VAN   commited 2021-03-18 20:04:52 +09:00
e755824378
Add an API to listen for changes in network blocked status of an uid.
Given that ConnectivityService is moving to a mainline module, we need
a @SystemApi for it to listen for changes in blocked status of an uid.
So, we decided to create a new API for this which can provide
ConnectivityService with more info about why an uid is blocked (which
will be useful for adding a new similar onBlockedStatusChanged callback
in CM.NetworkCallback) and also captures data saver restriction without
having out to track it separately.

Currently, NPMS does some redundant computations because we are
calculating both uid rules and blocked reasons separately. In a
follow-up change, we will compute uid rules using blocked reasons
and later possibly remove that onUidRulesChanged callback.

Bug: 176289731
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest ./tests/net/java/com/android/server/ConnectivityServiceTest.java
Test: atest ./services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
Change-Id: Ib9949b8619c6b148f73630b314c4113d76c31ec1
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1

Sudheer Shanka   authored and   Remi NGUYEN VAN   commited 2021-03-18 10:42:25 +00:00
cc8f26dea8
Remove extra comment am: b78337d701
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13906655

Change-Id: Ia86521977e1064f58651bbdb068211a7929c2cfd

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-18 10:36:45 +00:00
1405039ed2
Remove extra comment
This fixes a merge conflict with downstream branches due to an
incomplete cherry-pick.

Bug: 171540887
Test: m

Merged-In: I0c0daa91ef272a19c548cf55eb2f764c95f8f844
Change-Id: I0ec602f573698578e4d72d38772c39a1b88b87d2

Remi NGUYEN VAN   commited 2021-03-18 07:11:48 +00:00
b78337d701
Add a VpnManager.TYPE_VPN_OEM.
This needed for OEMs that have VPN types not supported by AOSP.

Bug: 171872481
Test: new test coverage in VpnTransportInfoTest
Change-Id: Ic7529bef7f12d2c74a3be5b1a4a2d54fb0d0bfac

Lorenzo Colitti   commited 2021-03-18 05:54:53 +00:00
3541fcbcbc
Merge "Add framework-connectivity.impl" am: 0fcb8d6db4 am: 74a87c1b2a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635039

Change-Id: I3528f9db9537634a5d6dde8a09034bdbc5b1f374

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-18 04:02:22 +00:00
6e77056745
Add more connectivity module settings
Add more connectivity module settings and update all references
to ConnectivitySettingsManager.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: Ie96fbd0996ed3acb37099b6270bf3d4c2e558e9a

paulhu   commited 2021-03-18 11:58:29 +08:00
79260c21a8
Merge "Add framework-connectivity.impl" am: 0fcb8d6db4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635039

Change-Id: I9956c78228c2d04e20edf6fee1061861e26978b9

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-18 03:33:42 +00:00
74a87c1b2a
Expose APIs for Settings
ConnectivityManager will be a part of incoming connectivity
mainline. Settings will no longer to access the hidden methods.
For those methods that accept the interaction from users, they
should be exposed as formal interface to allow the
functionality. Expose them to API surface.

Bug: 172183305
Test: make update-api
Change-Id: Id4533b94291766bb060af0091b5ccb81a00630fd

Chiachang Wang   commited 2021-03-18 11:18:56 +08:00
0cefc1c20a
Merge "Add ConnectivitySettingsManager" am: 3e17e82ab1 am: af229a6c7b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641759

Change-Id: Ie780e244374478d3e7bcd00cecbdfcb5edc600d6

Paul Hu   authored and   Automerger Merge Worker   commited 2021-03-17 15:50:31 +00:00
b43a0ed287
Merge "Remove Protocol.BASE_* usage in Connectivity" am: 7ffb87e4ce am: e4a8d2ff33
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629266

Change-Id: Ib94847ab028a1ead9a283148206ec688ce02582e

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-17 15:50:15 +00:00
ec5b8f3b24
Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS" am: 3d136c56ca am: f3ba1620ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635043

Change-Id: I8bf8d6cc604d09b4bea0e46e9636a0387bc6041f

Paul Hu   authored and   Automerger Merge Worker   commited 2021-03-17 15:50:00 +00:00
afa9f0f918
Add framework-connectivity.impl
The library will be included in the connectivity module APEX when
migrating its sources out of framework-minus-apex.

Bug: 171540887
Test: m
Change-Id: I1595521eaced6e6997c076bb56b06ffdd22a4fa0

Remi NGUYEN VAN   commited 2021-03-18 00:29:08 +09:00
1142754c99
Merge "Add ConnectivitySettingsManager" am: 3e17e82ab1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641759

Change-Id: I84e3e2eb6f507abf6220b43886f6ab9e1fad4218

Paul Hu   authored and   Automerger Merge Worker   commited 2021-03-17 15:27:02 +00:00
af229a6c7b
Merge "Remove Protocol.BASE_* usage in Connectivity" am: 7ffb87e4ce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629266

Change-Id: Ieca69d4ff1d2a7f3b369bb4dcabaa702fbab4594

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-17 15:19:31 +00:00
e4a8d2ff33
Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS" am: 3d136c56ca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635043

Change-Id: Ia8fa547044f9674b1c465606e43c346ba0bc7c0e

Paul Hu   authored and   Automerger Merge Worker   commited 2021-03-17 15:14:21 +00:00
f3ba1620ea
Expose uids related APIs in NetworkRequest and NetworkCapabilities
NetworkRequest is moving into the incoming connectivity mainline
module. The hidden setUids becomes inaccessible outside the
module. Shims for support cts in different API levels will need
to use it to verify the behavior of NetworkRequest. Thus, expose
it to the API surface.

Also, VPN uses getUids and setUids to control network
capabilities. Networkcapabilities is a part of incoming
connectivity mainline module but VPN is not. Thus, exposing these
two methods are needed to allow VPN to continue using it.

Test: make update-api
Bug: 172183305
Change-Id: I107c329d4d7130d488772166eae8b5e7aaa2ff04

Chiachang Wang   commited 2021-03-17 23:13:39 +08:00
f379ceec8e
Replace the usage of UidRange
UidRange is used in a shared way between ConnectivityService
and VPN through the use of NetworkCapabilities. UidRange will
be part of the ConnectivityService mainline but Vpn.java will
stay in the framework. We need a way to replace the APIs using
UidRange, or to make UidRange system API. The only really
relevant surface here is NetworkCapabilities#{setUids, getUids}.
The need for UidRange could be replaced by an integer Range, so
replace the usage of UidRange by a integer Range in
NetworkCapabilities#{setUids, getUids} and update the relevant
callers.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9

Chiachang Wang   commited 2021-03-17 23:02:22 +08:00
bb2439a884
Merge "Add ConnectivitySettingsManager"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-17 14:57:32 +00:00
3e17e82ab1
Merge "Remove Protocol.BASE_* usage in Connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-17 14:53:26 +00:00
7ffb87e4ce
Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-17 14:44:17 +00:00
3d136c56ca
[automerger skipped] Merge "Remove extra comment" am: be83a4afc5 -s ours am: 3414a57e61 -s ours
am skip reason: skip tag Change-Id I7432fe4c87cd3cab04dcb6185c9a4f3f84376549 with SHA-1 d2107994d6 is already in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641959

Change-Id: Iefe558673fff3558f68d7e627ea55e64252d5ebd

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-17 13:32:31 +00:00
516d3b7c75
[automerger skipped] Merge "Remove extra comment" am: be83a4afc5 -s ours
am skip reason: skip tag Change-Id I7432fe4c87cd3cab04dcb6185c9a4f3f84376549 with SHA-1 d2107994d6 is already in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641959

Change-Id: Ifd4bbb99c60e9d538fc87d5015dc2b0f7af4d125

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-17 12:54:22 +00:00
3414a57e61