Commit Graph

921 Commits

Author SHA1 Message Date
Chiachang Wang
ebbc803638 Merge "Expose BIP and VSIM relavent definitions" into sc-dev 2021-03-26 02:38:34 +00:00
Sarah Chin
8fc279e0cc API to get network visible network capability name
Test: atest DataConnectionTest, DcTrackerTest
Bug: 181916712
CTS-Coverage-Bug: 183553812
Change-Id: Iae63ac4d62641cee2bd0f0c5f50dd729750d514c
Merged-In: Iae63ac4d62641cee2bd0f0c5f50dd729750d514c
2021-03-25 15:10:39 -07:00
Lorenzo Colitti
8ad5812ebc Add onBlockedStatusChanged(Network, int) to NetworkCallback.
This is similar to onBlockedStatusChanged(Network, boolean) but
it allows the callback holder to know the exact reason why
networking was blocked. It is useful to privileged system
components such as JobScheduler that are able to ignore some
blocked reasons but not others.

Also add a new BLOCKED_REASON_LOCKDOWN_VPN that is used when
networking is blocked because an always-on VPN is in
lockdown mode.

Also move BLOCKED_METERED_REASON_MASK to ConnectivityManager.
This is necessary because ConnectivityService must ensure that
the blocked status callbacks are correctly sent when meteredness
changes (e.g., a UID that is blocked on metered networks will
become unblocked on a network that becomes unmetered). In order
to do this it needs to know which reasons apply only on metered
networks.

Bug: 165835257
Test: unit tests in subsequent CLs in the stack
Change-Id: I647db4f5a01280be220288e73ffa85c15bec9370
2021-03-26 02:37:19 +09:00
paulhu
7a4eeed62f Add MOBILE_DATA_PREFERRED_APPS setting
This setting is OEM upstream requirement for mobile data
preferred apps feature.

Bug: 171872461
Test: atest FrameworksNetTests
Merged-In: Ic5e0515b2b948de3d333c8d8e073d0b15514562a
Change-Id: Iba17bf68cffbe39d1c08ad94364b41bbf851bf57
2021-03-26 02:37:19 +09:00
paulhu
6865eb6dda Add PRIVATE_DNS_MODE setting setter
Bug: 182538166
Test: atest FrameworksNetTests
Merged-In: If234426f041606c4881de1eca31b6f5bdb3c6bfe
Change-Id: Iaa9e6cc92f1805ab341c308fc60e947ec4c674f0
2021-03-26 02:37:16 +09:00
paulhu
9443095517 Expose ConnectivitySettingsManager as module-lib API
Have getter/setter methods for external modules that can
get/set the setting values.

Bug: 182538166
Test: atest FrameworksNetTests
Merged-In: I82225a43f95e3e1d3e52c4e7a0fc541c0087292e
Change-Id: I61cb00216494e35b6e0dfe444b177cad36ad8afb
2021-03-26 02:35:07 +09:00
Chiachang Wang
02385fefae [automerger skipped] Merge "Add network created callback support" am: 1b7563cb1e am: d9763ad11b am: 4f7c63a58a -s ours
am skip reason: skip tag Change-Id I8c2ff7bd6980ae838abc5669f9419d62741b8666 with SHA-1 18d4281317 is already in history

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

Change-Id: Ie637f132849c0d4f20b65b4e6e3e4f7d1bdf141a
2021-03-25 15:11:52 +00:00
Paul Hu
1cda176f02 Merge "Add MOBILE_DATA_PREFERRED_APPS setting" into sc-dev 2021-03-25 15:01:30 +00:00
Remi NGUYEN VAN
e0a1a2a73a Merge "Use connectivity APIs from framework-connectivity" into sc-dev 2021-03-25 14:51:55 +00:00
Chiachang Wang
4f7c63a58a Merge "Add network created callback support" am: 1b7563cb1e am: d9763ad11b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652209

Change-Id: Ia98837b70d22f5c15db77c54d58e142967bdd814
2021-03-25 14:22:19 +00:00
Chalard Jean
fa33bef466 [NS06] Implement the don't-reap mechanism
This exposes a mechanism for network providers to tell
the network stack that a given network must be kept up
for some specific reason. This is meant to be easier
for them than to have to file a request, in particular
because there is no guaranteed way to make sure the
request will be best matched by any given network.

Test: new test for this
Bug: 167544279
Change-Id: I238a3ee5ee9262477a23b897e4141769dd1505d1
2021-03-25 14:10:06 +00:00
Paul Hu
fe704c3d7e Merge "Add PRIVATE_DNS_MODE setting setter" into sc-dev 2021-03-25 13:59:18 +00:00
Paul Hu
50c73a6865 Merge "Expose ConnectivitySettingsManager as module-lib API" into sc-dev 2021-03-25 13:50:45 +00:00
Chiachang Wang
d9763ad11b Merge "Add network created callback support" am: 1b7563cb1e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652209

Change-Id: Ibd2d575b5e3bdfc164c4721bc5bbb0c8b90601e0
2021-03-25 13:42:54 +00:00
Chiachang Wang
1b7563cb1e Merge "Add network created callback support" 2021-03-25 13:22:17 +00:00
Chiachang Wang
d3881b98ed Expose BIP and VSIM relavent definitions
In order to support special APNs below, OEM may need extra
NetworkCapabilities and apn type definition to support the
carriers request. Add corresponding definition into API
surface.

VSIM: for Virtual SIM service
BIP: for Bearer Independent Protocol

Bug: 130869457
Test: make update-api
Change-Id: I41e881c6fe39e92d5cdac2d0a02fa8a8e814c9c5
2021-03-25 21:19:37 +08:00
paulhu
63cf0d0e82 Add MOBILE_DATA_PREFERRED_APPS setting
This setting is OEM upstream requirement for mobile data
preferred apps feature.

Bug: 171872461
Test: atest FrameworksNetTests
Change-Id: Ic5e0515b2b948de3d333c8d8e073d0b15514562a
2021-03-25 13:13:15 +00:00
Chalard Jean
428b913abd [NS05] Feed network offer callbacks
The design is very simply expressed :
An offer is needed for a request if and only if that offer
might beat the satisfier for that request.

The implementation of "might beat" is NetworkRanker#mightBeat.

Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Bug: 167544279
Change-Id: I0fe911eef2483ecbac48c733d56283b81538690a
2021-03-25 22:13:10 +09:00
paulhu
d559441862 Add PRIVATE_DNS_MODE setting setter
Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: If234426f041606c4881de1eca31b6f5bdb3c6bfe
2021-03-25 13:11:54 +00:00
Lucas Lin
067841c859 [automerger skipped] Merge "Expose some APIs from ConnectivityManager" am: 8e4ae68ddd am: a2ec6c3696 am: 8242b68d7d -s ours
am skip reason: skip tag Change-Id I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c with SHA-1 97fb10a3a6 is already in history

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

Change-Id: Id36817eef371fd456bbb4f95cd713e43b833bae9
2021-03-25 13:10:18 +00:00
Lucas Lin
af75e1b84a [automerger skipped] Merge changes Ic2357dcf,Iddf8c71a am: 514e8ad39c am: e7b2119b97 am: 66f4de0183 -s ours
am skip reason: skip tag Change-Id Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa with SHA-1 3ee63e5132 is already in history

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

Change-Id: Ib7ed1d9c595b30fadf6efee2ab2614197e156ce1
2021-03-25 13:08:16 +00:00
lucaslin
d5c10261cb [automerger skipped] Expose NetworkScore to external caller am: 39907ba9d6 am: 849c987cf6 am: 3b41360729 -s ours
am skip reason: skip tag Change-Id Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb with SHA-1 18158aa33b is already in history

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

Change-Id: If0f542ea1a8a5dfe422cfc560f68abe7de05fb37
2021-03-25 13:07:51 +00:00
Lucas Lin
8242b68d7d Merge "Expose some APIs from ConnectivityManager" am: 8e4ae68ddd am: a2ec6c3696
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653936

Change-Id: I9dac472715fc8f32cb6313f2df8aef872bec9632
2021-03-25 12:38:47 +00:00
Chiachang Wang
edf9d3f2d6 Merge "Add network disconnected callback" into sc-dev 2021-03-25 12:24:20 +00:00
Lucas Lin
66f4de0183 Merge changes Ic2357dcf,Iddf8c71a am: 514e8ad39c am: e7b2119b97
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653939

Change-Id: Icf3acbfb071fc2d24f0d31c719446604567e2281
2021-03-25 12:23:01 +00:00
lucaslin
3b41360729 Expose NetworkScore to external caller am: 39907ba9d6 am: 849c987cf6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653938

Change-Id: I807cae8d95e8d5fb1f017b1ba11d800772ba3e9c
2021-03-25 12:22:59 +00:00
Lucas Lin
a2ec6c3696 Merge "Expose some APIs from ConnectivityManager" am: 8e4ae68ddd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653936

Change-Id: I1a31a6162d5098770c0d5b19faa7af83553f6a2e
2021-03-25 12:17:18 +00:00
paulhu
b05c16b2a4 Expose ConnectivitySettingsManager as module-lib API
Have getter/setter methods for external modules that can
get/set the setting values.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: I82225a43f95e3e1d3e52c4e7a0fc541c0087292e
2021-03-25 20:12:43 +08:00
Lucas Lin
e7b2119b97 Merge changes Ic2357dcf,Iddf8c71a am: 514e8ad39c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653939

Change-Id: I9c5f96893488f1e103cba740a0bbfb474ffe90b9
2021-03-25 12:07:49 +00:00
lucaslin
849c987cf6 Expose NetworkScore to external caller am: 39907ba9d6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653938

Change-Id: I5f2fb6bb6f2de4d81fb3b750053ee5abbe82caeb
2021-03-25 11:53:29 +00:00
Lucas Lin
8e4ae68ddd Merge "Expose some APIs from ConnectivityManager" 2021-03-25 11:29:08 +00:00
Lucas Lin
514e8ad39c Merge changes Ic2357dcf,Iddf8c71a
* changes:
  Expose NetworkAgent constructor taking a NetworkScore parameter
  Expose NetworkScore to external caller
2021-03-25 11:28:28 +00:00
Chiachang Wang
e211de2893 Add network created callback support
Create a network callback to notify network agent after
netd has created the network, so that the NetworkAgent may
wait for this callback and ensure the pre-work to communicate
with netd completed.

Bug: 178725261
Test: make update-api
Change-Id: I8c2ff7bd6980ae838abc5669f9419d62741b8666
Merged-In: I8c2ff7bd6980ae838abc5669f9419d62741b8666
2021-03-25 18:27:24 +08:00
Chiachang Wang
9affe28062 Add network disconnected callback
Create a network callback to notify network agent after the
native network being destroyed by netd which means the network
is fully disconnected. The NetworkAgent may handle this event
after sending disconnect state to ConnectivityService to proceed
its pending works that have to be done after it.

Bug: 178725261
Test: make update-api
Change-Id: I602ff2c688909473b03b72c9407d4286608cff4c
CTS-Coverage-Bug: 178725261
2021-03-25 09:58:48 +00:00
Chalard Jean
59e0788b7d Merge "[NS04.8] Address comments from NS04 and NS04.5" into sc-dev 2021-03-25 09:34:05 +00:00
TreeHugger Robot
affca14fe6 Merge "Add network created callback support" into sc-dev 2021-03-25 08:52:56 +00:00
Chiachang Wang
4694a2ab04 Expose NetworkAgent constructor taking a NetworkScore parameter
Vpn constructs NetworkAgent with this exposed NetworkAgent
constructor. Given NetworkAgent is moving into the incoming
connectivity module, Vpn which is outside the module will not
be able to access it if it's not in the API surface. Thus,
expose it to allow Vpn to use it.

Bug: 182963397
Test: make update-api
Change-Id: Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa
Merged-In: Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa
CTS-Coverage-Bug: 172183305
  (cherry-picked from ag/13966707)
2021-03-25 08:40:27 +00:00
lucaslin
39907ba9d6 Expose NetworkScore to external caller
NetworkScore will be a part of mainline module, so the external
callers cannot call its hidden APIs. Expose needed APIs to
the external callers.

CTS-Coverage-Bug: 182963397
Bug: 182963397
Test: m
Change-Id: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
Merged-In: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
  (cherry-picked from ag/13947595)
2021-03-25 08:15:09 +00:00
lucaslin
29278eef92 Expose some APIs from ConnectivityManager
- Expose setRequireVpnForUids to Vpn.java
- Expose setLegacyLockdownVpnEnabled to LockdownVpnTracker.java
- Expose requestRouteToHostAddress to
  GnssNetworkConnectivityHandler.java

Bug: 182963397
Test: m
Change-Id: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c
Merged-In: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c
  (cherry-picked from ag/13927657)
2021-03-25 08:07:53 +00:00
Remi NGUYEN VAN
75c959e718 Use connectivity APIs from framework-connectivity
Instead of compiling framework-connectivity source into
frameworks-minus-apex, have the APIs loaded separately from
framework-connectivity.

Bug: 171540887
Test: device boots, has connectivity
Change-Id: I8f07ff2082c3de80821e121807e66a43a870de7b
2021-03-25 06:34:52 +00:00
Chalard Jean
61e231fa4b [NS04.8] Address comments from NS04 and NS04.5
Bug: 167544279
Test: ConnectivityServiceTest
Change-Id: Ia930b3d3e723075cb47e267d589c576ee2d4490f
2021-03-25 13:35:56 +09:00
Remi NGUYEN VAN
e7ca4a87ab Fix apex_available on service-connectivity
arc-services depends on service-connectivity, so it also needs to be
available to the platform.

Bug: 183668370
Test: m
Change-Id: Id82125e98abf59b1cc8cb3fceab376597f0496ed
2021-03-25 12:17:51 +09:00
Remi NGUYEN VAN
cbeeca6221 Merge "Merge framework-connectivity impl and stub targets" into sc-dev 2021-03-25 02:05:06 +00:00
Chiachang Wang
18d4281317 Add network created callback support
Create a network callback to notify network agent after
netd has created the network, so that the NetworkAgent may
wait for this callback and ensure the pre-work to communicate
with netd completed.

Bug: 178725261
Test: make update-api
Change-Id: I8c2ff7bd6980ae838abc5669f9419d62741b8666
CTS-Coverage-Bug: 178725261
2021-03-25 00:27:11 +00:00
Jayachandran Chinnakkannu
dd89c6876a Merge "Add 5G/NR QOS support" am: 0deb814870 am: 05e4507857 am: 6c981f1bd3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1643762

Change-Id: I74c0d7d771d0b7e067dddc582389f77b8a899542
2021-03-24 18:58:50 +00:00
Treehugger Robot
de22e68cff [automerger skipped] Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." am: 266578d5cd am: 5330af9215 am: 3b72adfd00 -s ours
am skip reason: skip tag Change-Id I4c544415e12adf442fd2415c371b1b70a39c3aa4 with SHA-1 1d0d9b4627 is already in history

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

Change-Id: If0f92d490fc903ba2037766a69365eb44af8027e
2021-03-24 18:57:34 +00:00
Jayachandran Chinnakkannu
6c981f1bd3 Merge "Add 5G/NR QOS support" am: 0deb814870 am: 05e4507857
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1643762

Change-Id: If32e710cfea988dbaa438ffee547707aa06e6545
2021-03-24 18:54:17 +00:00
Treehugger Robot
3b72adfd00 Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." am: 266578d5cd am: 5330af9215
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651532

Change-Id: I99fe564e3fd7e6e92416a3d76054e62969cdd48f
2021-03-24 18:53:30 +00:00
Jayachandran Chinnakkannu
05e4507857 Merge "Add 5G/NR QOS support" am: 0deb814870
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1643762

Change-Id: Icd4c21b9731256c9b3d39bffc5fddc43276c5fda
2021-03-24 18:26:19 +00:00
Treehugger Robot
5330af9215 Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." am: 266578d5cd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651532

Change-Id: If272068940e9a06efbb40149e2b4dd5fbb1185d6
2021-03-24 18:13:19 +00:00