Commit Graph

5889 Commits

Author SHA1 Message Date
Junyu Lai
26c41600a4 Merge "[VCN01] Add NOT_VCN_MANAGED capability" am: ce07556044 am: 6373b3b084 am: 8062b53a7c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1549897

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ide501fcf659637c0ec175d3f6f5926c2482734e0
2021-01-28 14:58:38 +00:00
Junyu Lai
ce07556044 Merge "[VCN01] Add NOT_VCN_MANAGED capability" 2021-01-28 13:04:59 +00:00
Chiachang Wang
9fe5db2fd8 Merge "Replace hidden getFileDescriptor$()" am: 842319b819 am: 4b2d4e4e3b am: 9bb7ef7bd2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553966

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iebc2b32fa7ed14b5326ec7649831fbc8e08b1e9d
2021-01-28 08:06:05 +00:00
Chiachang Wang
842319b819 Merge "Replace hidden getFileDescriptor$()" 2021-01-28 06:36:11 +00:00
Lucas Lin
09454b278b Merge "Use createStringArray instead of readStringArray" am: 66cd788d4e am: 9a1b958e67 am: d19a5eace9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1559093

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I743f07815b4d2d112d0f8bbeb9d313f6f3d3a8e0
2021-01-28 05:33:07 +00:00
Lucas Lin
65fd64d494 Merge "Check if NetworkSpecifier is an instance of MatchAllNetworkSpecifier" am: ec3f650de7 am: b82753716e am: dbc70f90c7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556546

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1f7bafc63926c7c68c7c3cdd13069234487888fa
2021-01-28 05:32:36 +00:00
lucaslin
31d270a4d7 Use createStringArray instead of readStringArray
To prevent ProxyInfo calling hidden API, use public one -
Parcel#createStringArray() instead.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I1a5376872d743e1863982bb95d579aeba7159d33
2021-01-28 04:03:59 +00:00
Lucas Lin
ec3f650de7 Merge "Check if NetworkSpecifier is an instance of MatchAllNetworkSpecifier" 2021-01-28 04:01:49 +00:00
Chiachang Wang
b219ee2cde Replace hidden getFileDescriptor$()
It's the preparation for the incoming ConnectivityService
mainline. The mainline modules can not access hidden APIs.
Thus, the hidden APIs usage should be removed.

The getFileDescriptor$() in Socket or DatagramSocket is
hidden for internal usage. It should be used in a module and
not prefer to expose as an API. Thus, replace it with
ParcelFileDescriptor APIs to get the fd via
ParcelFileDescriptor.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I05b31a48315e7e6d95e22123103e544a7136a449
2021-01-28 11:33:13 +08:00
Treehugger Robot
f5c35bcfa7 Merge "[FUI03] No-op refactoring of VpnInfo" am: f9dbe61693 am: b0989fd2d2 am: 046ebf41b7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547637

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I05e6b14fca44919610317831c147413b0a431224
2021-01-27 14:16:00 +00:00
Junyu Lai
a125e1a6cc [VCN01] Add NOT_VCN_MANAGED capability
Add new capability to indicate whether a network is
managed by Virtual Carrier Network (VCN). This is needed
to identify networks between VCN managed network and
others. And this capability will be:
  1. mutable
  2. requestable
  3. set by default for network agents and requests
  4. allowed for test networks

Note that this commit is identical to aosp/1529959 except the
capability remains hidden to address the javadoc problem first.
And this CL also needs to be bound with the counter part change
to prevent build breakage.

Test: 1. atest FrameworksNetTests CtsNetTestCases
      2. adb shell dumpsys connectivity
      3. atest ConnectivityServiceTest#testLoseMutableAndRequestableCaps
Bug: 175662146

Change-Id: I37a6f492c2aba72836e36851b50b67398f8bdd36
2021-01-27 16:13:01 +08:00
Chiachang Wang
686fa2e950 Merge "Expose UdpEncapsulationSocket.getResourceId()" am: 8dc248c84a am: 18896c83ed am: 14dfb0cfe7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547642

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I67420def56b12c3008daaa001b8f09680439d940
2021-01-27 08:05:05 +00:00
Chiachang Wang
0df3d8876c Merge "Update jni to get int descriptor in native layer" am: 1bd8cd59a5 am: e1874186ba am: 54e430d69a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553967

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibc0ac9def6a0a05658235b61f36ef8829906c341
2021-01-27 08:04:37 +00:00
Benedict Wong
b8a7476bb7 Merge "Prep VCN files for exposing APIs" am: f0aa57318d am: 278b748966 am: 78e931383c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554718

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7f018bfe94e7e020bcf262dae70687ded56d222e
2021-01-27 08:04:08 +00:00
Treehugger Robot
3827e8c95e Merge changes I713bc2ec,Ib9ab07c9 am: 3795a7d1d2 am: d8b7ab2076 am: 2d6430198c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1537264

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4b291a4e82b89d3808e9bcd980d5b2aa4d2b1b71
2021-01-27 07:53:30 +00:00
Yan Yan
57969c028e Merge "Expose IPsec tunnel APIs from @SystemApi to public APIs" am: 5b8a0c8d89 am: 67d7fde5ad am: e0662139e0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1517517

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie6f17fde71e1c7ca36e88e554874939cfc9e78ab
2021-01-27 07:51:43 +00:00
lucaslin
eb1c486ab9 Check if NetworkSpecifier is an instance of MatchAllNetworkSpecifier
To prevent mainline module related file to access a hidden API,
check whether the NetworkSpecifier is an instance of
MatchAllNetworkSpecifier by itself.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: I4d49cb70ff3c8a7e1ffa32e38207c74a6375e51a
2021-01-27 15:32:43 +08:00
junyulai
fa528b2d20 [FUI03] No-op refactoring of VpnInfo
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
  1. Move VpnInfo to android.net
  2. Add nullability annotations
  3. Make members final

Bug: 174123988
Test: TH
Change-Id: I1530bb45d0e84c28c6deac33596bc686058afc0d
2021-01-27 15:03:06 +08:00
Chiachang Wang
8dc248c84a Merge "Expose UdpEncapsulationSocket.getResourceId()" 2021-01-27 04:41:18 +00:00
Chiachang Wang
db2cec6024 Update jni to get int descriptor in native layer
ConnectivityService is going to become a mainline module which
can not access the hidden APIs. The int descriptor of a
FileDescriptor is hidden for internal use only. The Network and
NetworkUtls will be parts of CS module. The corresponding usage
should be removed. There is no way in a module to access the
descriptor, so update the jni to set a FileDescriptor to native
to get the int descriptor inside the platform.

Also, update the other references in android_net_NetUtils for
getting fd to use the NDK functions in the libnativehelper.

Bug: 170598012
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Test: manually connect to a VPN
Change-Id: I2143c079feac53917a6e7bf7422f3180f51437fb
2021-01-27 02:44:14 +00:00
Benedict Wong
f0aa57318d Merge "Prep VCN files for exposing APIs" 2021-01-27 02:34:09 +00:00
Chiachang Wang
5e26cc8c56 Expose UdpEncapsulationSocket.getResourceId()
ConnectivityManager.createSocketKeepalive() will need to get
the socket resource ID as a parameter for creating a new
NattSocketKeepalive. ConnectivityManager is a part of incoming
ConnectivityService mainline, so expose getResourceId() as an
API since the hidden APIs are not accessible for a mainline
module. This API should not be exposed to apps, so make it a
MODULE_LIBRARIES system API.

Bug: 172183305
Test: make update-api
Change-Id: Ic0722352ea186fcb18a2d91cc3969f771fde9e86
2021-01-27 09:27:26 +08:00
Benedict Wong
44192ee464 Prep VCN files for exposing APIs
Add @hide to methods to clearly show what is being exposed and cleanup
some visibilty/final modifiers.

Bug: 168833866
Test: atest FrameworksVcnTests
Test: atest android.net.vcn
Change-Id: I8e03133053b59fd5b8df640e4b22761f572f9548
2021-01-26 15:28:24 -08:00
Treehugger Robot
3795a7d1d2 Merge changes I713bc2ec,Ib9ab07c9
* changes:
  [FUI05] Remove wimax data usage unit test
  [FUI14] Get SSID from NetworkCapabilities
2021-01-26 13:13:24 +00:00
Yan Yan
5b8a0c8d89 Merge "Expose IPsec tunnel APIs from @SystemApi to public APIs" 2021-01-26 02:19:58 +00:00
Daniel Bright
bfa6543938 Merge "Add method to match address \ port with QosFilter" am: 8910e2c51b am: ccc311dde9 am: 28f288ea56
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1510591

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id9951a0be8821192e3fb403787d096c538d691cf
2021-01-26 00:22:58 +00:00
junyulai
78e0f545a0 [FUI14] Get SSID from NetworkCapabilities
This allows subsequent patches to remove the need of exposing
SSID in NetworkState.

Test: atest NetworkStatsServiceTest
Bug: 174123988
Change-Id: Ib9ab07c9610954c9a5de035a3aefbf6d0bb0b53b
2021-01-22 23:58:14 +08:00
Paul Hu
a2aced5183 Merge "Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()" am: ce1b5d00d9 am: e8a98db615 am: 57f66184e3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1534910

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie09f19ae607041e94a6e6bbce3f745d7ca868201
2021-01-22 15:53:48 +00:00
Chalard Jean
98c9ac6d37 Merge "Add Qos Callback support" am: 8e39c04b56 am: d52695827d am: cc08384548
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1386623

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If0a123f16951c88cc5881fba8865fae822ba92f0
2021-01-22 14:52:58 +00:00
Daniel Bright
c947317a4b Add method to match address \ port with QosFilter
* The match method is only for local address and port since we have
no other use case.

Bug: 155176305
Test: Added new test
Change-Id: I7b45f9912af6a192fc60606f5e0b4cc479aea93f
2021-01-22 06:24:41 -08:00
Paul Hu
ce1b5d00d9 Merge "Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()" 2021-01-22 14:18:47 +00:00
Chalard Jean
8e39c04b56 Merge "Add Qos Callback support" 2021-01-22 13:09:24 +00:00
Remi NGUYEN VAN
41af40f61b Merge "Mark connectivity test utilities as module API" am: c74d6f3115 am: ea30ec0379 am: 35c1ee2a54
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547643

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3537f92a718d8494234e698df20b535383dc8e90
2021-01-22 11:35:33 +00:00
paulhu
f0b4cd7fed Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()
Connectivity service is going to become a mainline module which
will not able to access hidden APIs. NetworkPolicyManagerInternal
is a internal serivce that CS can't be access after be a mainline
module. Thus, create NPMS#isUidRestrictedOnMeteredNetworks() and
NPM#isUidRestrictedOnMeteredNetworks() to replace
NPMI#isUidRestrictedOnMeteredNetworks().

Also correct the permission check in isUidNetworkingBlocked()
that needs to check OBSERVE_NETWORK_POLICY only.

Bug: 170598012
Test: atest FrameworksNetTests
Test: atest FrameworksCoreTests:NetworkPolicyManagerTest
Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
Test: atest CtsNetTestCases
Test: atest CtsHostsideNetworkTests
Change-Id: I5801a3a2076f3eb199a0226c38c85014b26c64e7
2021-01-22 16:14:28 +08:00
Remi NGUYEN VAN
649e3a28dd Mark connectivity test utilities as module API
The API surface is planned to move to the Connectivity module, meaning
that it will be maintained across multiple Android releases.
This is incompatible with TestApi semantics, which are designed to be
removable across releases. Effectively the APIs become SystemApi, so
mark them as such considering that TestApi is not supported by modules.

Remove the NetworkCapabilities.getCapabilities test API that is not
essential for tests, and mark other APIs as module API.

Test: m
Bug: 174436414
Change-Id: Ic04551a9874b3d756cf5e6c77ceabfc7c85d52a6
2021-01-22 16:16:57 +09:00
Daniel Bright
2cc8ead3d6 Add Qos Callback support
* Provide App Developers Qos related info associated to
  a bound socket through ConnectivityManager
* Qos sessions are generated and filtered by Network Agents
  and sent back through the Connectivity Service to the
  API consumer.
* The structure of the code within com.android.server
  is designed to support different types of filters in the
  the future.
* The first type of Qos Attributes are related to EPS
  Bearers in order support RCS.

Bug: 155176305
Test: Added to cts/NetworkAgentTest
Test: Added to ConnectivityServiceTest
Change-Id: I145dd065d9deeee449eb9695ab3f6c8556ee7c09
2021-01-21 20:14:52 -08:00
Remi NGUYEN VAN
d19d9a120b Merge "Use network list in UNDERLYING_NETWORKS_CHANGED" am: a6f4de3432 am: 04b88cae4f am: c408b6f4b3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536308

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I28e3fc36dd42316f3cc618c29d610a02ffad8722
2021-01-22 02:31:40 +00:00
Yan Yan
c92a798ee8 Expose IPsec tunnel APIs from @SystemApi to public APIs
Since IKE APIs to negotiate IPsec tunnel migration (MOBIKE) are
public, all IPsec tunnel APIs should also be public so that public
callers are able to create, manage and migrate IPsec tunnels

Bug: 174606949
Test: atest IpSecManagerTunnelTest
Change-Id: I86aec334cfc937953f9c2b411cc55862032aae4d
2021-01-21 10:45:24 -08:00
Sarah Chin
af54fe6b6d Merge "Update setSubscriptionOverride API to allow network types" 2021-01-21 18:28:18 +00:00
Remi NGUYEN VAN
f7347c3b73 Use network list in UNDERLYING_NETWORKS_CHANGED
The bundle is no longer necessary, as this message is not sent across
processes: the network list can be sent directly in the message obj
pair.

Bug: 173574274
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: Iae049a24212ff9df19b29aead20bf4a594f05f99
2021-01-21 22:36:54 +09:00
Chiachang Wang
21985b42ac Merge "Use ParcelFileDescriptor instead of FileDescriptor in the aidl" am: 39efdb2451 am: 2de3786907 am: c5698a5bc9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8c873db971acd19cba9dd45a874e036587f88940
2021-01-21 09:25:51 +00:00
Paul Hu
df28bddbfd Merge "Replace Context @hide API in MultinetworkPolicyTracker" am: e8bf3e902b am: 465b565d49 am: 892fa611ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554096

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibf4d66456d3b3675d16a80b1538949c3807ddcbc
2021-01-21 09:18:45 +00:00
Chiachang Wang
92b94e1ec5 Use ParcelFileDescriptor instead of FileDescriptor in the aidl
Using FileDescriptor in the aidl will refer to
Parcel.readRawFileDescriptor() and Parcel.writeRawFileDescriptor()
whilie trying to do parcel operations. Those two APIs are hidden
and not accessible for the incoming ConnectivityService mainline
module. For such use cases in a module, it should be replaced by
using ParcelFileDescriptor that is designed for such usages.

Bug: 170598012
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: Ia7e3a71ccb4b136cc55c9e90a384870c32cfd37b
2021-01-21 08:40:12 +00:00
Paul Hu
e8bf3e902b Merge "Replace Context @hide API in MultinetworkPolicyTracker" 2021-01-21 07:53:19 +00:00
Remi NGUYEN VAN
14d5c2eaa7 Merge "Mark TestNetworkManager as module API" am: 24ea1e0377 am: ae781e1b30 am: 0397559e6f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547638

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2a8aa17d6acdaed8ee7419990493b631c0eb6d1c
2021-01-21 07:28:46 +00:00
Remi NGUYEN VAN
24ea1e0377 Merge "Mark TestNetworkManager as module API" 2021-01-21 06:02:25 +00:00
Remi NGUYEN VAN
8700d3345b Mark TestNetworkManager as module API
The API surface is planned to move to the Connectivity module, meaning
that it will be maintained across multiple Android releases.
This is incompatible with TestApi semantics, which are designed to be
removable across releases. Effectively the APIs become System/module
API, so mark them as such considering that TestApi is not supported by
modules.

Test: m
Bug: 174436414
Change-Id: Icd32fcbb65e9a4bb2b67cb9da7c971281be0781a
2021-01-21 10:45:04 +09:00
Frank Li
3c1db05464 Merge "Deprecated IP connectivity metrics system api" am: 6822a558b2 am: db8bc33ea7 am: bd2eb8b1e5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1549818

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic983d10b0f3534f90ed38a6155258e63ab29f2cc
2021-01-20 18:54:34 +00:00
paulhu
24e3388080 Replace Context @hide API in MultinetworkPolicyTracker
MultinetworkPolicyTracker is part of Connectivity mainline module
which cannot call @hide API Context#registerReceiverAsUser. Thus,
replace it to Context#registerReceiverForAllUsers.

Bug: 170634463
Test: atest FrameworksNetTests
Test: Manully check that receiving intent and unregistering
      receiver can work normally.
Change-Id: Ie22a3aa40bc9243082672a64dba7c7940f9ff21a
2021-01-21 01:19:09 +08:00
lifr
6e6149c471 Deprecated IP connectivity metrics system api
- In order to easily maintain the connectivity service.
Refactor the connectivity service by removing all legacy
metrics code & API.
- The commit will deprecate legacy metrics system api.
(The legacy metrics code will be removed in a separate commit.)
Therefore, those legacy metrics event may not be sent in
Android S and above.

Bug: 177043087
Test: atest ConnectivityServiceTest
      atest IpConnectivityMetricsTest
      atest ConnectivityServiceIntegrationTest
Change-Id: Ia057776869a7d38041b6eaf17904f6c54a7b4fca
2021-01-20 02:06:18 +00:00