Commit Graph

14477 Commits

Author SHA1 Message Date
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
4baffbe8e3 Merge "Reference framework-connectivity stubs explicitly" into sc-dev 2021-03-25 02:05:07 +00: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
Jayachandran Chinnakkannu
0deb814870 Merge "Add 5G/NR QOS support" 2021-03-24 17:44:48 +00:00
Treehugger Robot
266578d5cd Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." 2021-03-24 17:22:50 +00:00
Sudheer Shanka
f1520bb8dc Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager.
These constants will now be including all the reasons for why an
uid's network access can be blocked, instead of only the
restrictions that could be imposed by NPMS.

Bug: 183473548
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Merged-In: I4c544415e12adf442fd2415c371b1b70a39c3aa4
Change-Id: I6dcea43fbefa9eac8b5a971b822a5be5422a54b4
2021-03-25 01:33:26 +09:00
TreeHugger Robot
eb04adf4bc Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." into sc-dev 2021-03-24 16:02:56 +00:00
Remi NGUYEN VAN
71d64e746d Merge framework-connectivity impl and stub targets
Instead of using api_only: true, use a single java_sdk_library to
generate both framework-connectivity stubs and
framework-connectivity.impl.

Bug: 183600168
Test: m
Change-Id: I76d7cf1ba31a3f38ae6b9facbf1b668860c8c165
2021-03-24 23:52:58 +09:00
Remi NGUYEN VAN
6d575cace8 Add framework-connectivity to the Tethering APEX
Add framework-connectivity and its jni library dependency to the APEX.

Bug: 171540887
Test: device boots, has connectivity
Ignore-AOSP-First: Merge conflicts, will cherry-pick

Change-Id: I72fc7fee7bfcd909cbc79b4c34e8b3f29055d378
2021-03-24 23:05:29 +09:00
Remi NGUYEN VAN
02b94faf80 Reference framework-connectivity stubs explicitly
To merge the framework-connectivity and framework-connectivity.impl
targets, framework-connectivity stubs need to be referenced explicitly
in java_sdk_libraries, otherwise the build system will currently see
dependency cycles.

Bug: 183600168
Test: m
Ignore-AOSP-First: Needs manual cherry-picks
Change-Id: I556747f9ba934f8b44b6ea9a518adbccc84ac2a9
2021-03-24 23:05:13 +09:00
Remi NGUYEN VAN
b36fb99561 Add min_sdk_version to connectivity targets
All targets need min_sdk_version 30 to be included in the tethering
APEX. They will actually never be used on SDK 30 and are only loaded on
31, but this is necessary to be included in com.android.tethering.

Bug: 171540887
Test: m
Change-Id: I190fd1f3c9fabff057d0a2bd7f45b63a4fe447b3
2021-03-24 10:08:39 +00:00
Remi NGUYEN VAN
47cc651269 Build connectivity JNI against libc++_static
Instead of including the whole libc++ library by linking it dynamically,
use the static version so that unused symbols can be stripped.

This allows reducing the APEX size by 1MB (3.7MB -> 2.7MB), as otherwise
libc++ is included twice for 32 and 64 bit variants.

Bug: 171540887
Test: Device boots and has connectivity, size reduced

Change-Id: Ia66d795cf23d6f45997278300c103976433f7c5c
2021-03-24 10:08:39 +00:00
Remi NGUYEN VAN
6b0c407133 Remove dependency on libnetd_client
NetworkUtils can just use the NDK to achieve the same.

Also make sure network handles can have the local nameservers flag, for
the JNI API, and create/parse them accordingly in Network.

Bug: 171540887
Test: atest CtsNetTestCases (in particular MultinetworkApiTest,
          DnsResolverTest, NetworkTest)
Change-Id: I2e7b78263f7ca0cab9458854858a7423f6bd2854
2021-03-24 10:08:39 +00:00
Chalard Jean
4f591c3910 Merge changes I975a9439,Idec1fe8e into sc-dev
* changes:
  [NS04.5] Have NetworkOffer embark a provider ID
  [NS04] Introduce Network Offers and their callbacks
2021-03-24 06:45:50 +00:00
Chiachang Wang
f03ce99d71 [automerger skipped] Replace the usage of UidRange am: b439ce8bda -s ours
am skip reason: skip tag Change-Id I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536 with SHA-1 41918d6cd1 is already in history

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

Change-Id: I467054b8b492f3672f643a8ff2a286cc5d2578cf
2021-03-24 06:08:17 +00:00