Commit graph

615 commits

Message SHA1
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

Remi NGUYEN VAN   commited 2021-03-24 23:52:58 +09:00
71d64e746d
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

Remi NGUYEN VAN   commited 2021-03-24 10:08:39 +00:00
b36fb99561
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

Remi NGUYEN VAN   commited 2021-03-24 10:08:39 +00:00
47cc651269
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

Remi NGUYEN VAN   commited 2021-03-24 10:08:39 +00:00
6b0c407133
Merge changes I975a9439,Idec1fe8e into sc-dev
* changes:
  [NS04.5] Have NetworkOffer embark a provider ID
  [NS04] Introduce Network Offers and their callbacks

Chalard Jean   authored and   Android (Google) Code Review   commited 2021-03-24 06:45:50 +00:00
4f591c3910
Merge "API to get network visible network capability name" into sc-dev
Sarah Chin   authored and   Android (Google) Code Review   commited 2021-03-24 05:27:45 +00:00
3c405692ad
Merge "Re-implement NetworkUtils#queryUserAccess." into sc-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2021-03-24 01:28:35 +00:00
bac86aaa50
API to get network visible network capability name
Test: atest DataConnectionTest, DcTrackerTest
Bug: 181916712
CTS-Coverage-Bug: 183553812
Change-Id: Iae63ac4d62641cee2bd0f0c5f50dd729750d514c

Sarah Chin   commited 2021-03-24 00:27:11 +00:00
34fbbbb6b9
[automerger skipped] Merge "Add NetworkRequest.Builder creating from an existing instance" am: 074c7d7537 am: f5c555f8b1 am: 73f867de7f -s ours
am skip reason: skip tag Change-Id I068462b2a1410daf67b0c95f2b643d396f079531 with SHA-1 7625498617 is already in history

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

Change-Id: Icd22cc8edbfbbfe0dc8baecdc966d11c9a43a2ff

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-23 14:05:23 +00:00
51d36fbe9f
[automerger skipped] Merge "[VCN15] expose addUnwantedCapability and related APIs" am: 84ebe6693a am: 767a374b4b am: d74b82c473 -s ours
am skip reason: skip tag Change-Id I3f2e6a99e015f09cc4405f6804eac4ae33e3dcc7 with SHA-1 e76b5f7004 is already in history

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

Change-Id: Id34011ffbdd997f29140b12cae5a0caeae745d3e

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-03-23 14:03:13 +00:00
0b798c5d49
Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" am: 1a6e0ea3fd am: 17b490ed13 am: 5a0360c6a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649288

Change-Id: Ibc6553b1471ee8e0ab362979ba9525c2e328a275

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-23 14:02:47 +00:00
d86c8c2c8a
Merge changes I638ed5cd,I29f15571,I21a22ed1 am: 750e8ca69e am: b1fbb5ca62 am: 787caa8c08
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1648068

Change-Id: I6d897cdcfb5b0e4809a32312071eb77623754f94

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-23 14:01:19 +00:00
f7cf543a86
Merge "Remove Network, NetworkRequest metrics from jobscheduler" into sc-dev
Aaron Huang   authored and   Android (Google) Code Review   commited 2021-03-23 13:22:32 +00:00
c34dcd5c3e
Re-implement NetworkUtils#queryUserAccess.
Currently, queryUserAccess talks to netd via FwmarkServer.
Doing this from the module would require exposing queryUserAccess
as an NDK API or reimplementing FwmarkClient.

Because queryUserAccess really only uses information that comes
from ConnectivityService/PermissionMonitor anyway, just use that
information without calling to net.

Test: atest HostsideVpnTests
Bug: 171540887
Change-Id: If855de1ea3e1fd2ed30f2795d9b4acfcf969a2dc

Lorenzo Colitti   authored and   Remi NGUYEN VAN   commited 2021-03-23 13:20:44 +00:00
e8585ddf8b
Merge "Move deduceRestrictedCapability to libs/net and rename it" into sc-dev
Aaron Huang   authored and   Android (Google) Code Review   commited 2021-03-23 12:50:40 +00:00
7609660f73
Merge "Expose NetworkAgent constructor taking a NetworkScore parameter" into sc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2021-03-23 12:45:24 +00:00
3cccf48918
[NS04.5] Have NetworkOffer embark a provider ID
...instead of a Messenger.
This will be useful later to compare whether a given offer is
offered by the same provider satisfying a request.

Bug: 167544279
Test: ConnectivityServiceTest
Change-Id: I975a9439021c7fa511c50ac982819b6dd146291e

Chalard Jean   commited 2021-03-23 21:41:11 +09:00
148dcce559
[NS04] Introduce Network Offers and their callbacks
This patch introduces the concept of a network offer that
providers send to Connectivity to register for relevant
requests. This lets them see only requests that they can
hope to satisfy considering their capabilities and score
filters.

This is meant to replace the filtering mechanism currently
implemented by NetworkFactory. The reason for replacing
this mechanism is that the old mechanism does caps and
score filtering on the factory side, which requires these
two filters to be contextless and available system-wide,
including in separate processes from the system server.
These constraints severely limit and complexify in
particular what the score comparisons may look like. In
the past the score comparison was only integer-based,
making the code duplication not much of a problem, but as
this scheme is becoming unsustainable by spreading the
complexity of the selection across the entire stack, a
centralized mechanism is now necessary.

This patch only introduces the new objects and has CS
keep track of them, but does not actually use them yet.
Followup patches will implement the logic of calling
the offer callbacks.

Test: FrameworksNetTests NetworkStackTests FrameworksWifiTests
Bug: 167544279
Change-Id: Idec1fe8eb4ac6f562bf098e3dd470f11024d04f2

Chalard Jean   commited 2021-03-23 21:41:11 +09:00
d1b498b16d
Merge "Expose NetworkScore to external caller" into sc-dev
Lucas Lin   authored and   Android (Google) Code Review   commited 2021-03-23 12:18:23 +00:00
d8e8a9557b
Merge "Add NetworkRequest.Builder creating from an existing instance" am: 074c7d7537 am: f5c555f8b1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649294

Change-Id: I96516eb0d976d6e6250d2e96c316c560bfa21ab5

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-23 12:09:42 +00:00
73f867de7f
Merge "Add NetworkRequest.Builder creating from an existing instance" am: 074c7d7537
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649294

Change-Id: Ib990cb25d50c11b103e248c0c13c584e78aa3450

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-23 11:36:07 +00:00
f5c555f8b1
Merge "Add NetworkRequest.Builder creating from an existing instance"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-03-23 10:46:20 +00:00
074c7d7537
Merge "[JS01]Remove hidden API usage of Connectivity Sevice" into sc-dev
Frank Li   authored and   Android (Google) Code Review   commited 2021-03-23 10:22:28 +00:00
d968d80146
Remove Network, NetworkRequest metrics from jobscheduler
These metrics are deprecated so remove them from jobscheduler.
Also remove dumpDebug method from Network, NetworkRequest and
NetworkCapabilities because there's no caller anymore.

This change also for connectivity mainline module. These
three classes are inculded in framework-connectivity so
external module cannot have dependencies on its hidden API.
With this change, the dependencies can be removed.

Bug: 178777253
Test: FrameworksNetTests
      JobStoreTest
      adb shell dumpsys jobscheduler --proto
      CtsIncidentHostTestCases:JobSchedulerIncidentTest
Change-Id: Ie0c540303ba06b8fba029d2b98ae753afb08c963

Aaron Huang   commited 2021-03-23 10:19:41 +00:00
967f77c269
Merge "Build service-connectivity with system_server API" into sc-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2021-03-23 09:18:53 +00:00
088c8f7707
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
CTS-Coverage-Bug: 172183305

Chiachang Wang   commited 2021-03-23 08:51:05 +00:00
3ee63e5132
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

lucaslin   commited 2021-03-23 16:17:37 +08:00
18158aa33b
Merge "Add NDK API for getprocnetwork" into sc-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2021-03-23 07:11:06 +00:00
56db6551f5
Add NetworkRequest.Builder creating from an existing instance
Provide a formal way to construct a new NetworkRequest from an
existing instance. The network capabilities inside the
NetworkRequest is hidden. There is no way to pass a
NetworkRequest and update its capabilities. Add
NetworkRequest.Builder creating from an existing instance to
allow to clone the network capabilities.

Bug: 172183305
Test: make update-api
Change-Id: I068462b2a1410daf67b0c95f2b643d396f079531
Merged-In: I068462b2a1410daf67b0c95f2b643d396f079531

Chiachang Wang   commited 2021-03-23 14:50:03 +08:00
e2179dd1cc
Build service-connectivity with system_server API
As all dependencies on hidden API have been removed, build
service-connectivity against system_server_current.

Bug: 171540887
Test: device boots, has connectivity
Change-Id: I454e8a0a8d0e0f9e6d21a8e8faf5a9e299962ad4

Remi NGUYEN VAN   commited 2021-03-23 06:06:03 +00:00
f19e30d337
[JS01]Remove hidden API usage of Connectivity Sevice
The Connectivity service will become the mainline module.
Therefore, remove the caller of using Connectivity's
hidden API outside the module and expose the required
connectivity API used in Jobscheduler.

Bug: 183456204
CTS-Coverage-Bug: 170598012
Test: atest JobStoreTest
Change-Id: Ie6bc81ff382fb242b98f35d28a96defc207c7987

lifr   commited 2021-03-23 13:58:48 +08:00
308bcccd2b
Merge "[VCN15] expose addUnwantedCapability and related APIs" am: 84ebe6693a am: 767a374b4b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639654

Change-Id: I6aee50f7f201361ae29e6442a0d28b79c6dfc1e2

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-03-23 05:51:55 +00:00
d74b82c473
Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" am: 1a6e0ea3fd am: 17b490ed13
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649288

Change-Id: Ifa285f00d08e47877ab73a2eb1cefa3d493024d7

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-23 05:51:32 +00:00
5a0360c6a1
Merge "[VCN15] expose addUnwantedCapability and related APIs" am: 84ebe6693a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639654

Change-Id: Ie88ff422c473d3891a054fa75b5175b30c10cec9

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-03-23 05:27:53 +00:00
767a374b4b
Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" am: 1a6e0ea3fd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649288

Change-Id: I71d541b3578169410349356a149528954e1c8789

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-23 05:18:03 +00:00
17b490ed13
Merge "[VCN15] expose addUnwantedCapability and related APIs"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-03-23 05:02:22 +00:00
84ebe6693a
Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-03-23 04:40:50 +00:00
1a6e0ea3fd
Merge changes I638ed5cd,I29f15571,I21a22ed1 am: 750e8ca69e am: b1fbb5ca62
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1648068

Change-Id: Ia0b6ffa74536e3f20f13282d08bd858fc9e979bf

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-23 02:10:45 +00:00
787caa8c08
Merge "[TL02]Remove hidden API usage of NetworkAgent" into sc-dev
Frank Li   authored and   Android (Google) Code Review   commited 2021-03-23 02:03:59 +00:00
6fa238f167
[TL02]Remove hidden API usage of NetworkAgent
The connection service will become the mainline module.
Remove the hidden API usage of NetworkAgent.

Bug: 170598012
CTS-Coverage-Bug: 170598012
Test: atest FrameworksNetTests FrameworksTelephonyTests
      atest FrameworksWifiTests
Change-Id: I4e4040ae7f94bdf479c7df9ec2ffabafbe06331c

lifr   authored and   Paul Hu   commited 2021-03-23 02:01:38 +00:00
c4fd62072b
Merge changes I638ed5cd,I29f15571,I21a22ed1 am: 750e8ca69e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1648068

Change-Id: I74e0c3eae3bf22c9a05968e2daf5b59da33f01bb

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-23 01:37:03 +00:00
b1fbb5ca62
Merge changes I638ed5cd,I29f15571,I21a22ed1
* changes:
  Expose registerDefaultNetworkCallbackAsUid.
  Support calling registerDefaultNetworkCallback for another UID.
  Store the effective UID in NetworkRequestInfo.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-03-23 01:27:58 +00:00
750e8ca69e
Merge "[VCN15] expose addUnwantedCapability and related APIs" into sc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2021-03-23 01:19:39 +00:00
1cd2428be0
Add NDK API for getprocnetwork
The API is the getter couterpart for setprocnetwork.
Use it in NetworkUtils so that the NDK API can be the source of truth
for the process network.

Bug: 171540887
Test: atest CtsNetTestCases
      Tests in change I311b58585033c2ca50ce5477ea9cd94b6f127507
Change-Id: Ie8f68cf1fa57deddb63324c1abf3d6fd5b0ef500

Remi NGUYEN VAN   commited 2021-03-23 01:01:06 +00:00
31f329e987
Have a new method in NetworkAgentConfig.Builder to set allowBypass
Have a new method in NetworkAgentConfig.Builder for Vpn to set
allowBypass.

Bug: 182963397
Test: m
Change-Id: I3f244464438325ee7f8a1b953d3fb28186293628

lucaslin   authored and   Lorenzo Colitti   commited 2021-03-23 09:01:40 +09:00
0e345e9b1a
[automerger skipped] Expose uids related APIs in NetworkRequest and NetworkCapabilities am: 0ffaec3d50 -s ours am: 697286cfdb -s ours
am skip reason: skip tag Change-Id I107c329d4d7130d488772166eae8b5e7aaa2ff04 with SHA-1 aacf237c27 is already in history

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

Change-Id: I382cbac60469250d2be5a2ffb2fb51eafa082548

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-22 19:56:22 +00:00
58c089a445
[automerger skipped] Replace the usage of UidRange am: 14a86c3cbd -s ours am: 7de9042831 -s ours
am skip reason: skip tag Change-Id I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9 with SHA-1 4956b3225d is already in history

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

Change-Id: Iedbd693caaa772adde8188c19bb17b2800fa6774

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-22 19:56:15 +00:00
38295ebfd1
Merge "Revert "Have a new method in NetworkAgentConfig.Builder to set allowBypass"" into sc-dev
Joshua Mccloskey   authored and   Android (Google) Code Review   commited 2021-03-22 19:20:20 +00:00
08e81c327b
[automerger skipped] Expose uids related APIs in NetworkRequest and NetworkCapabilities am: 0ffaec3d50 -s ours
am skip reason: skip tag Change-Id If76877e6bde7abe3b5ddde078f87eefd027e675c with SHA-1 32996ff68f is already in history

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

Change-Id: I1072a17b5977b5c2c4fdb8e04c59298c59c0d3c3

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-22 19:12:39 +00:00
697286cfdb
[automerger skipped] Replace the usage of UidRange am: 14a86c3cbd -s ours
am skip reason: skip tag Change-Id Idb7f353788c5779a4fbbd107595e9326b99fe0a8 with SHA-1 545aafdd16 is already in history

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

Change-Id: I3e7a0c612ee4ca37bf5567d5ec1297cf14671337

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-22 19:12:32 +00:00
7de9042831