Commit Graph

6017 Commits

Author SHA1 Message Date
Cody Kesting
f85baf2259 Merge changes I34ef76ec,Icf686c3d am: 7f60b13ff5 am: 7d8db6692d am: 2beb965c06
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1597313

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I761d254de2413b06c51bf7c4994f8d8c12a01fb5
2021-02-24 02:19:08 +00:00
Chiachang Wang
89d6183cdf Merge "Remove UidRange.createForUser() with userId integers" am: 9c92c37f56 am: 5809c1f054 am: 58becf95ef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1596511

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1a3c072f7b82e51b5fb71f8c591680cfc1d0041b
2021-02-24 02:14:37 +00:00
Paul Hu
575877afd9 Merge "Use PermissionUtils" am: 584e907d7a am: 93798f22e8 am: 85468ed557
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1559098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4833704b1494516871d8a2c8ba24c3ea741266d2
2021-02-24 02:11:59 +00:00
Cody Kesting
706e0ac272 Merge "Expose VCN Network policy APIs." am: 32a2e39563 am: e49bdb60e1 am: 1e33fdf6a7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1544188

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I269038dfbd8f36fa381015ed49e24693b1bafa59
2021-02-23 23:44:08 +00:00
Cody Kesting
3bc9cad1be Merge changes I1ceccedd,Ide2c7302 am: c70a7d6258 am: 788f94aff2 am: 2c8a5fd13c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1593102

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaa8272005503a3b984a943bd62c5a522d5f14bb1
2021-02-23 23:43:44 +00:00
Paul Hu
5b21c57c2a Merge "Expose NetworkWatchlistManager#getWatchlistConfigHash" am: 7d72edb937 am: 0727d8d08c am: 2e26868923
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1569981

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia8913c209a8c3f6387e99a32184580a562870735
2021-02-23 22:55:34 +00:00
Treehugger Robot
11d8571a24 Merge "Use RouteInfo API constructor in VpnService" am: 6b501d8acf am: ec10603f92 am: 6636979ed7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1593771

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9744bf5c35097e61ad09fda98f2c843aeb6b9545
2021-02-23 22:54:05 +00:00
Cody Kesting
7f60b13ff5 Merge changes I34ef76ec,Icf686c3d
* changes:
  Notify VcnStatusCallback#onVcnStatusChanged for Safe Mode.
  Define VcnStatusCallback#onVcnStatusChanged.
2021-02-23 21:23:17 +00:00
Sudheer Shanka
5d8fc4abae Merge "Add new network process capability." into sc-dev 2021-02-23 11:10:57 +00:00
Chiachang Wang
9c92c37f56 Merge "Remove UidRange.createForUser() with userId integers" 2021-02-23 07:17:07 +00:00
Paul Hu
584e907d7a Merge "Use PermissionUtils" 2021-02-23 01:48:58 +00:00
Cody Kesting
fb657c523b Define VcnStatusCallback#onVcnStatusChanged.
This CL defines VcnStatusCallback#onVcnStatusChanged for notifying
VcnStatusCallbacks when the status of their specified subscription group
changes. Specifically, status codes will be provided to notify callbacks
when a VCN is started, stopped, enters Safe Mode, and when there are no
matching VCNs.

Bug: 180659281
Test: atest FrameworksVcnTests
Change-Id: Icf686c3da6c5bdeeab88f60495d2ad438fa15692
2021-02-22 17:28:48 -08:00
Cody Kesting
f74c6031f1 Expose VCN Network policy APIs.
This CL exposes APIs used for a) receiving VCN Network policy updates
and b) applying VCN Network policies to a given Network. Specifically,
these APIs should be used to receive notifications from VcnManager
whenever a VCN Network policy may have changed - generally, following a
VCN starting up, tearing down, or entering Safe Mode.

When a VcnNetworkPolicyListener is notified of a policy change, the
listener should query VcnManager#applyVcnNetworkPolicy to receive the
updated VcnNetworkPolicyResult. This policy result informs the listener
of their resulting NetworkCapabilities and also whether a Network
teardown is required as a consequence of the policy change.

Bug: 177020190
Test: atest FrameworksVcnTests
Change-Id: Ied78a57973a4ceaa7ef4cd9feee64478137497b8
2021-02-22 17:23:40 +00:00
Cody Kesting
c70a7d6258 Merge changes I1ceccedd,Ide2c7302
* changes:
  Change Exception class references to use Class.getName().
  Define VcnNetworkPolicyListener for VCN transports.
2021-02-22 17:23:14 +00:00
Chiachang Wang
66ded137bf Remove UidRange.createForUser() with userId integers
UidRange will be a part of connectivity mainline module.
Mainline modules should use strongly-typed UserHandle arguments.
The method also refer to the hidden UserHandle.PER_USER_RANGE
which is not available after UidRange is moved into module.
Thus, replace the usage and remove the createForUser method that
takes userId parameter.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I3f33ea92c4a24342af9ec4b0367c50bb64ce6450
2021-02-22 18:51:14 +08:00
Paul Hu
7d72edb937 Merge "Expose NetworkWatchlistManager#getWatchlistConfigHash" 2021-02-22 05:23:04 +00:00
Treehugger Robot
6b501d8acf Merge "Use RouteInfo API constructor in VpnService" 2021-02-22 04:05:51 +00:00
Junyu Lai
6e0fc99a23 Merge "[FUI15] Remove networkId in NetworkState" am: 3237216211 am: f5fbe10aa7 am: eb70fc6721
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1542749

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I57c03c39a069e0ad9760ab5b411caf69a9fdcf45
2021-02-20 17:03:44 +00:00
Junyu Lai
3237216211 Merge "[FUI15] Remove networkId in NetworkState" 2021-02-20 14:00:19 +00:00
Sudheer Shanka
2c84695b71 Add new network process capability.
- Introduce network capability which allows apps to access network
  despite power restrictions.
- Update NPMS to allow apps network access only if they are in a
  higher proc_state or they are hodling the new network capability.

Bug: 177641226
Test: atest ./services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ia411ddef2e8cb77d371c22262d5b1e06a0396e29
2021-02-19 04:09:10 -08:00
paulhu
5119787a27 Expose NetworkWatchlistManager#getWatchlistConfigHash
Connectivity is becoming a mainline module in S and
ConnectivityService is used this API for getting watch list
configurations. However, Mainline modules are not allowed to use
non-formal APIs. Thus, make this API as module-lib api to support
the usage.

Bug: 172183305
Test: make update-api
Change-Id: I21ce5f158850892926b92cf6347c61a57ac95b72
2021-02-19 15:30:02 +08:00
Yan Yan
9236bf7e5c Merge "API: Expose VcnControlPlaneConfig" am: bf16b6d399 am: 7cccd926a9 am: 6bbb6b7751
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1583247

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1a759a0d34efb81998d9dfb070a59eefbab642c0
2021-02-19 02:27:39 +00:00
Remi NGUYEN VAN
09bbad130d Merge "Split parcelable .aidl files to aidl-export" 2021-02-19 02:21:25 +00:00
Cody Kesting
901dc86e4b Define VcnNetworkPolicyListener for VCN transports.
This CL defines VcnNetworkPolicyListener and VCN Network policy
functions for VcnManager. Specifically, VcnNetworkPolicyListeners should
be added and removed by Network factories as they bring up and teardown
data Networks.

VcnNetworkPolicyListeners are used by VcnManagementService to notify
transports when they should re-query for their updated
VcnNetworkPolicyResults - done via VcnManager#applyVcnNetworkPolicy.
Policy results inform transports what the current NetworkCapabilities
are based on their VCN policy, and also whether the transport should
teardown and restart.

Bug: 177020190
Test: atest FrameworksVcnTests
Change-Id: Ide2c73025f4ffceabf7955f219a79be5a9bdc0d9
2021-02-18 16:31:08 -08:00
Yan Yan
bf16b6d399 Merge "API: Expose VcnControlPlaneConfig" 2021-02-18 23:00:56 +00:00
paulhu
d7a93468a6 Use PermissionUtils
The checking permission methods on NetworkStack has migrated to
PermissionUtils. Let these methods refer to PermissionUtils but
still keep them because lots of frameworks modules are using
NetworkStack methods to check permission.

Also replace the NetworkStack#checkNetworkStackPermission to
PermissionUtils in CS.

Bug: 178352309
Test: atest FrameworksNetTests
Change-Id: Icd38aa17fe471b810978e21ea361c41719e7802d
2021-02-18 23:20:23 +08:00
Cody Kesting
266fa7fb71 Merge changes I0cadd145,I3be3cac4,I9ea6e9e8 am: 4ea84f0b97 am: 3283a2675d am: 488a3356d4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1590414

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idd8fde8dddda9170acd9f5172b9ce3a6a4ba9727
2021-02-18 04:11:11 +00:00
Benedict Wong
17f7fa76c2 Merge "Add VcnUnderlyingNetworkSpecifier" am: a7d23702bf am: f08e1215d2 am: 2d3fad77b6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1577283

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7535e67907c28c7b394492407c25f8afd06dbd58
2021-02-18 04:10:29 +00:00
Remi NGUYEN VAN
6e9ab0553d Use RouteInfo API constructor in VpnService
Instead of using the RouteInfo(destination, gateway) constructor which
is private API, use the RouteInfo(destination, gateway, iface, type)
constructor which is system API.

This separates the VpnService better from internal implementations, and
is necessary to move RouteInfo to the connectivity module.

Bug: 174436414
Test: m

Change-Id: Idc98b2258f3c78bdba40b5fcb97769b5ad99d016
2021-02-18 03:38:34 +00:00
Cody Kesting
4ea84f0b97 Merge changes I0cadd145,I3be3cac4,I9ea6e9e8
* changes:
  Correct comment for safe mode alarm in VcnGatewayConnection.
  Implement VCN error callback use.
  Define VcnStatusCallback#onGatewayConnectionError callback.
2021-02-18 03:07:14 +00:00
Benedict Wong
a7d23702bf Merge "Add VcnUnderlyingNetworkSpecifier" 2021-02-18 02:35:12 +00:00
Yan Yan
afc550f30b API: Expose VcnControlPlaneConfig
Each VcnGatewayConnectionConfig must have a VcnControlPlaneConfig
that contains all connection, authentication and authorization
parameters required to establish a gateway connection.

Bug: 163604823
Test: make update-api && make
Change-Id: If4a58e7b0391b485ee7c4482d422bec5e6ba4148
2021-02-18 02:26:27 +00:00
Remi NGUYEN VAN
4e8639649a Split parcelable .aidl files to aidl-export
The one-line "parcelable X" files need to be imported by targets that do
not build against SDK (the SDK has prebuilt definitions), so prepare a
dedicated directory for them.
This avoids having users of the classes include the whole src/
directory, which could contain definitions for classes that are not part
of the public API, so should not be imported.

Also move back to frameworks/base/core some .aidl definitions that
were separated from their associated class.

Bug: 171540887
Test: m
Merged-In: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
Change-Id: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
2021-02-18 01:17:04 +00:00
Remi NGUYEN VAN
c048b1c769 Merge "Split parcelable .aidl files to aidl-export" into sc-dev 2021-02-18 01:16:10 +00:00
Yan Yan
add92198a5 Merge "Store VcnControlPlaneConfig in VcnGatewayConnectionConfig" am: bf8113b93d am: 8f2b5071b3 am: 559fd17ee9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554684

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I349d2f7e4c6bbeb28e0cd79be1ed5b6480558144
2021-02-17 22:30:26 +00:00
Yan Yan
9fb7d8f7a2 Merge "Create VcnControlPlaneConfig and VcnControlPlaneIkeConfig" am: a931d4516d am: 14e64c42ad am: e0610fe112
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553154

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5f0336b434f42cba3bce793d8ec8d16a401bf117
2021-02-17 22:29:33 +00:00
Cody Kesting
fe0523949b Define VcnStatusCallback#onGatewayConnectionError callback.
This CL updates VcnStatusCallback to have a onGatewayConnctionError()
function. This function will be used to notify callers when Gateway
Connection errors occur, such as authentication failures or the session
unexpectedly dying.

Bug: 163433613
Test: atest FrameworksVcnTests
Change-Id: I9ea6e9e850eb9d8b0d374c5447895f1f04121696
2021-02-17 14:28:33 -08:00
Cody Kesting
3de749bcd4 Merge changes I3242ad0e,I5daced20,Iefd284ae am: f1d78f17c2 am: 3371693fda am: 0fd3dfe01b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1580104

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icd62dea9ccaaa967fef6c1cc06483e3d3cabbc1b
2021-02-17 19:47:39 +00:00
Benedict Wong
f8b63e30c1 Merge "Expose Basic VCN API surface" am: 54e89ebf18 am: eb9d1a8d9d am: 33e99e9e01
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554519

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0333cfeff35d75c7b53a91ef8d042cc1a82938da
2021-02-17 19:47:21 +00:00
Yan Yan
a9c1bab850 Store VcnControlPlaneConfig in VcnGatewayConnectionConfig
This CL requires callers to set a VcnControlPlaneConfig for
building VcnGatewayConnectionConfig

Bug: 163604823
Test: FrameworksVcnTests (new tests added)
Change-Id: If45cb2aa866d627f3bb9762309fe8b07bf729ba8
2021-02-17 11:25:04 -08:00
Yan Yan
c4fbd6a90c Create VcnControlPlaneConfig and VcnControlPlaneIkeConfig
VcnControlPlaneConfig contains control plane configuration for
a VCN gateway connection. VcnControlPlaneIkeConfig is a
subclass that contains IKE configuration.

The followup CL will store VcnControlPlaneConfig in
VcnGatewayConnectionConfig.

Bug: 163604823
Test: FrameworksVcnTests(new tests added)
Change-Id: If7a85ae44e77fc4477b56ffa50c6e99ee96132d0
2021-02-17 10:56:48 -08:00
Cody Kesting
f1d78f17c2 Merge changes I3242ad0e,I5daced20,Iefd284ae
* changes:
  Notify status callbacks when a VCN enters Safemode.
  Change all 'safemode' references to use 'safe mode'.
  Define VcnStatusCallback register/unregister.
2021-02-17 18:08:48 +00:00
Benedict Wong
54e89ebf18 Merge "Expose Basic VCN API surface" 2021-02-17 18:03:08 +00:00
Remi NGUYEN VAN
8d25d67d85 Split parcelable .aidl files to aidl-export
The one-line "parcelable X" files need to be imported by targets that do
not build against SDK (the SDK has prebuilt definitions), so prepare a
dedicated directory for them.
This avoids having users of the classes include the whole src/
directory, which could contain definitions for classes that are not part
of the public API, so should not be imported.

Also move back to frameworks/base/core some .aidl definitions that
were separated from their associated class.

Bug: 171540887
Test: m
Change-Id: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
2021-02-17 16:12:49 +09:00
Cody Kesting
f14145e37a Define VcnStatusCallback register/unregister.
This CL defines VcnStatusCallbacks, which are callbacks used to register
for status updates to a specific subscription group. These Callbacks may
be registered with VcnManager at any time, but will only be invoked for
the specifies subscription group and only if the registering app has
carrier privileges for that subscription.

Bug: 163433613
Test: atest FrameworksVcnTests
Change-Id: Iefd284ae2d09676d195e2a12bf660be3596da59b
2021-02-16 21:33:40 -08:00
Benedict Wong
049c180ae2 Expose Basic VCN API surface
This change exposes the Basics of the VCN API surface, including:
- VCN Configurations
- VCN Gateway Configuration superclass (Builder in subclasses)
- VcnManger with configuration management APIs

Bug: 168833866
Test: atest FrameworksVcnTests
Test: atest android.net.vcn
Change-Id: Ia1b3597d903dd84267f66546a90437f9ac45b2de
2021-02-16 21:31:00 -08:00
Lorenzo Colitti
c5d780797e Merge "Use UserHandles instead of userId integers." am: 2531219560 am: a2831e1346 am: 7eac1eedbc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1589632

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8b6bdedc099cb421b52dd35b4ccfdfaf0d9c9633
2021-02-17 02:53:29 +00:00
Lorenzo Colitti
438ac4a7f2 Use UserHandles instead of userId integers.
userId integers are not public API and code should use UserHandle
instead.

Bug: 170598012
Test: passes existing tests
Change-Id: Ic27b93ccfe6bbc97e7419293ce165fee6cd51e6d
2021-02-16 08:06:23 +00:00
Lorenzo Colitti
dccf769038 Merge "Move the VPN code out of packages/Connectivity." am: 8269d21dec am: 6011d5240c am: f684b8d431
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1589331

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0acb8b9e93f839986aa6580832f1cdab12b3baf2
2021-02-16 02:24:39 +00:00
Benedict Wong
53abcd3c86 Add VcnUnderlyingNetworkSpecifier
This change adds a VcnUnderlyingNetworkSpecifier as hidden API, for
internal use only. The purpose of the VcnUnderlyingNetworkSpecifier is to
match the specifiers for ONLY underlying (Telephony|Wifi) networks,
ensuring that the VCN does NOT create a routing loop

Bug: 179439329
Test: atest FrameworksVcnTests
Test: atest android.net.vcn
Change-Id: I0e158e1889d4462c117c46d9038f58d5adcc7e30
2021-02-15 17:39:42 -08:00