Commit Graph

5997 Commits

Author SHA1 Message Date
Sudheer Shanka
5d8fc4abae Merge "Add new network process capability." into sc-dev 2021-02-23 11:10:57 +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
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
Yan Yan
bf16b6d399 Merge "API: Expose VcnControlPlaneConfig" 2021-02-18 23:00:56 +00: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
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
Kholoud Mohamed
56fcd93bc7 Merge "Exposed some testAPIs in NetworkPolicyManager" am: 4338d7f97a am: 199dd9b367 am: eb740fdaae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1585006

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ica1c0d36a56890ea0af92dc28abcf03555bd4f07
2021-02-15 12:08:26 +00:00
Lorenzo Colitti
4e82e55794 Move the VPN code out of packages/Connectivity.
Bug: 173331190
Test: atest FrameworksNetTests HostsideVpnTests CtsNetTestCases
Change-Id: Idc6ed1a544e744f8661d1e387da278736d407489
2021-02-15 12:05:40 +00:00
Kholoud Mohamed
4338d7f97a Merge "Exposed some testAPIs in NetworkPolicyManager" 2021-02-15 11:12:27 +00:00
Treehugger Robot
d9334a47a0 Merge "Expose VpnTransportInfo as module-lib API." am: 4a7e41a6e6 am: 094211dec4 am: e510c506fe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1585572

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I71abed2260e6b57a96132c1e978f499809ce98cc
2021-02-15 06:24:53 +00:00
Treehugger Robot
4a7e41a6e6 Merge "Expose VpnTransportInfo as module-lib API." 2021-02-15 04:54:13 +00:00
Lorenzo Colitti
202658f0a4 Merge changes Ia68f482a,I4911e214,Ied379654,I66d18512,Ie8e1bd63 am: 45ec3191a7 am: 246444fef7 am: ed9730e6f9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1581293

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I698b6b082b121c004b2c8b05ef423da1bd8b871b
2021-02-15 01:32:50 +00:00
Lorenzo Colitti
d92d403e76 Expose VpnTransportInfo as module-lib API.
This information originates in non-mainline system server code
and needs to be passed to the connectivity mainline code.

Bug: 173331190
Test: already covered by CTS tests
Change-Id: Ic612b6a51f7ec13e2213c8754312cf716130c876
2021-02-15 09:34:19 +09:00
Lorenzo Colitti
45ec3191a7 Merge changes Ia68f482a,I4911e214,Ied379654,I66d18512,Ie8e1bd63
* changes:
  Check registering system default callback needs NETWORK_SETTINGS.
  Move VPN code from ConnectivityService to VpnManagerService.
  Add a skeleton VpnManagerService, and start it on boot.
  Convert LockdownVpnTracker to NetworkCallbacks.
  Minor fixes to VpnTransportInfo.
2021-02-15 00:00:47 +00:00
James Mattis
8eda5a7e2d Merge changes from topics "pans", "pans-permission" am: 601d16a336 am: d11f866ee6 am: 6c16aeadfb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1561317

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I20fdb2f06b473f9f92e62138e72bd30d4384a267
2021-02-14 09:51:16 +00:00
James Mattis
601d16a336 Merge changes from topics "pans", "pans-permission"
* changes:
  Marking setOemNetworkPreference as @SystemApi
  Adding permission for OEM managed preferences
  Implementation of setOemNetworkPreference
2021-02-13 20:54:57 +00:00
Yan Yan
e2703bbab6 Merge changes Ifc8ad902,I6d1b8d0e am: 8d659bb1ec am: bdaf1de829 am: cca000ac52
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1453730

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6f3235dd38e4c4912f986cbb27867ff14fe38e81
2021-02-12 22:46:32 +00:00
Yan Yan
8d659bb1ec Merge changes Ifc8ad902,I6d1b8d0e
* changes:
  [API] Expose IpSecTunnelInterface#setUnderlyingNetwork
  Update underlying network of IpSecTunnelInterface
2021-02-12 21:23:29 +00:00
James Mattis
0846b40040 Marking setOemNetworkPreference as @SystemApi
Marking setOemNetworkPreference in ConnectivityManager as @SystemApi.

Bug: 176496438
Bug: 176494815
Test: atest FrameworksNetTests
atest FrameworksNetIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I4681c88dc3a83f71c387b29610c33594e57cb43f
2021-02-11 20:38:21 -08:00
James Mattis
82da6ad33d Implementation of setOemNetworkPreference
Main implementation of ConnectivityService.setOemNetworkPreference. This
covers the main requirements of this method including listener
functionality.

Bug: 176495594
Bug: 177101287
Bug: 176494815
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I8d318ab07785e52dd84d6261fdea8f318dce9bc5
2021-02-11 20:38:18 -08:00
Lorenzo Colitti
3dc6dbe80f Move VPN code from ConnectivityService to VpnManagerService.
ConnectivityService itself does not depend on mVpns or the Vpn
class any more. Most of this CL is simply moving code from one
class to another:

- Move the AIDL calls from IConnectivityManager to IVpnManager.
- Move the implementation from ConnectivityService to
  the new VpnManagerService.
- Move the APIs from ConnectivityManager to VpnManager, but
  temporarily maintain some shims in ConnectivityManager for the
  moved calls so that existing callers do not have to be modified
  in this CL.
- Update VpnService to call IVpnManager instead of
  IConnectivityManager.
- Move the code that registers the VpnManager service from
  ConnectivityFrameworkInitializer to SystemServiceRegistry.

Bug: 173331190
Test: atest HostsideVpnTests FrameworksNetTests CtsNetTestCases
Change-Id: I4911e2144df721a94fa00da9edf0dc372a7091c2
2021-02-12 01:12:24 +09:00
Lorenzo Colitti
f83d22b77d Add a skeleton VpnManagerService, and start it on boot.
This adds a lot of unused code but this should make it easier to
review subsequent CLs.

Bug: 173331190
Test: builds, boots, "dumpsys vpnmanager" succeeds
Change-Id: Ied379654a0c3ab6242d3125661fe30f322395059
2021-02-12 01:07:29 +09:00
kholoud mohamed
c5616b51d1 Exposed some testAPIs in NetworkPolicyManager
Exposed setRestrictBackground, getRestrictBackground,
and resolveNetworkId as testAPIs.

Bug: 179476736
Test: Verified that CTS tests can access the APIs.
Change-Id: Ida4603d55a30187c03e23c7af6ff229065597bab
2021-02-11 13:58:31 +00:00
Yan Yan
8cd28adbc5 [API] Expose IpSecTunnelInterface#setUnderlyingNetwork
This API is required to perform MOBIKE. This API allows an IPsec
peer to change the underlying network of its established IPsec
tunnel without re-establishing the tunnel.

Bug: 169855650
Test: atest IpSecManagerTunnelTest (new tests added)
Change-Id: Ifc8ad902cbfbe4ad07e715f2fef0faa1bf9d68f3
2021-02-10 14:52:18 -08:00
Yan Yan
b2d0ef2dd4 Update underlying network of IpSecTunnelInterface
Bug: 169855650
Test: atest IpSecManagerTunnelTest
Change-Id: I6d1b8d0e49f89c67ddc2caf4ba63fb0b1eb062c0
2021-02-10 14:51:43 -08:00
Roland Levillain
a7f6e5ea40 Merge changes from topic "cherrypick-android_util-a0ae5zk4cb" into sc-dev
* changes:
  [Mainline] android.system package APIs migration
  Use public android.system.Int64Ref instead of Int32Ref which is hidden (CorePlatformApi) type of libcore
2021-02-10 18:23:48 +00:00