Commit Graph

5967 Commits

Author SHA1 Message Date
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
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
Serik Beketayev
ac711f9fbf [Mainline] android.system package APIs migration
By removing Int32Ref.

Bug: 179703584
Bug: 177619520
Test: mma
Change-Id: I9b63146ae563ed977f3112c9910f7a7c575de0b8
Merged-In: I9b63146ae563ed977f3112c9910f7a7c575de0b8
(cherry picked from commit 1a2d570c3a7122940097aa7e983a7240d163c41a)
2021-02-10 18:23:22 +00:00
Serik Beketayev
80f8c777e1 [Mainline] android.system package APIs migration
By removing Int32Ref.

Bug: 177619520
Bug: 179703584
Test: mma
Change-Id: I9b63146ae563ed977f3112c9910f7a7c575de0b8
Merged-In: I9b63146ae563ed977f3112c9910f7a7c575de0b8
(cherry picked from commit 63be514478)
2021-02-10 12:34:46 +00:00
Lorenzo Colitti
d438be4ba8 Merge changes from topics "vpnmove-getconnectionowneruid", "vpnmove-systemdefaultcallback", "vpnmove-vpntransportinfo" am: 250855cb84 am: 70e0f6035a am: 32942ed2a6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1572981

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I961b6442d53c1cb00af642866b7e49d151a9ab1e
2021-02-10 07:46:14 +00:00
Lorenzo Colitti
250855cb84 Merge changes from topics "vpnmove-getconnectionowneruid", "vpnmove-systemdefaultcallback", "vpnmove-vpntransportinfo"
* changes:
  Stop using mVpns in getConnectionOwnerUid.
  Add a VpnTransportInfo object.
  Add a registerSystemDefaultNetworkCallback method.
2021-02-10 06:38:41 +00:00
Cody Kesting
1d6229ef49 Merge "Fix PolicyListener testing surface." am: c5bc3bcd8f am: 3b1c79bdc9 am: fb11991c1e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1579686

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ief6ec93c745795c2fa96c50560e916196f68d3d5
2021-02-10 00:30:43 +00:00
Cody Kesting
c5bc3bcd8f Merge "Fix PolicyListener testing surface." 2021-02-09 23:03:25 +00:00
Cody Kesting
fecc2a3361 Fix PolicyListener testing surface.
This CL updates VcnManager to provide a test-only method for getting
currently registered VcnUnderlyingNetworkPolicyListeners. This is
preferrable over the current method, which accesses VcnManager's private
Map directly.

Bug: 8675309
Test: atest FrameworksVcnTests
Change-Id: I7afd60ff55868ae44bfa74910ae02daf8a81b107
2021-02-09 11:44:41 -08:00
Lorenzo Colitti
76e8a43e68 Add a VpnTransportInfo object.
This currently stores the VPN type and a session name, but can be
extended in the future.

Bug: 173331190
Test: added coverage in VpnTest
Test: added coverage in ConnectivityServiceTest
Test: added coverage in NetworkAgentTest
Change-Id: I450858a9fa332c8d896dbdb4c14337d5ec23677f
2021-02-10 02:52:16 +09:00
Junyu Lai
08078fe9ab Merge changes from topic "removeNI" am: c2d6240642 am: bd414490cb am: 4bd67ddfa9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536707

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3553ff41d85f44c481ea065e6cbda5d286f9e1fa
2021-02-09 05:49:15 +00:00
Junyu Lai
c2d6240642 Merge changes from topic "removeNI"
* changes:
  [FUI07] Stop making NetworkState with NetworkInfo from external callers
  [FUI06] Stop using NetworkInfo in NetworkState from external callers
2021-02-09 03:37:59 +00:00
junyulai
ed813ed767 [FUI07] Stop making NetworkState with NetworkInfo from external callers
Follow-up from previous patch. This change stop accessing the
constructor that needs NetworkInfo to create NetworkState, which
is no longer accessible after ConnectivityService become
mainline module. Instead, pass a legacy network type which is
dedicated for the need of the type.

Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I24157bc33e5a5819eccd6a3111d2049f531c1d43
2021-02-08 21:58:02 +08:00
junyulai
7514e1b8bb [FUI06] Stop using NetworkInfo in NetworkState from external callers
This is achieved by:
  1. Use legacy network type inside NetworkState to replace the
     needs of referencing NetworkInfo.getType().
  2. Let getAllNetworkState only return networks with isConnected()
     equals true. This allows callers such as NPMS or NSS does not
     have to reference to NetworkInfo.isConnected().

Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I1c4eb08d18ca973eb8f41d06258872eabc0006b8
2021-02-08 21:40:49 +08:00
James Mattis
3162f47ca2 Merge changes Iabad7300,I85363e28 am: f76916a1c9 am: 5ff53b176d am: 5362c1b0b7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1539241

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I05f6ae928a5bfa8b56837fa5c55803b2233d36a1
2021-02-06 06:07:15 +00:00
James Mattis
f76916a1c9 Merge changes Iabad7300,I85363e28
* changes:
  Stubbed setOemNetworkPreference in Connectivity
  Update OemNetworkPreferences to use 1:1 Map
2021-02-06 04:33:51 +00:00
Treehugger Robot
577fd4a912 Merge "Add @Nullable to Object#equals()" 2021-02-05 09:36:41 +00:00
Paul Hu
4c834140cf Merge "Replace NPMI#isUidNetworkingBlocked()" am: 830e1e9576 am: b3e4a2305d am: 505ac115c6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536313

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I53f5fb0996ad08c8a44c0560ab72725c47e39215
2021-02-05 08:15:29 +00:00
Roman Kalukiewicz
9b9af7777d Add @Nullable to Object#equals()
This is a partial cherry-pick of change:
I5eedb571c9d78862115dfdc5dae1cf2a35343580

for connectivity classes.

Bug: 170883422
Test: m
Merged-In: I5eedb571c9d78862115dfdc5dae1cf2a35343580
Change-Id: I7dc661863b73f4198ddb4f3a1566583d0f07db3c
2021-02-05 07:28:44 +00:00
Paul Hu
830e1e9576 Merge "Replace NPMI#isUidNetworkingBlocked()" 2021-02-05 06:38:02 +00:00
Sarah Chin
1c600eed49 Merge "Update setSubscriptionOverride API to allow network types" 2021-02-05 05:14:50 +00:00
James Mattis
0a815ee292 Update OemNetworkPreferences to use 1:1 Map
Updated OemNetworkPreferences to use a Map instead of an Array of Arrays
(SparseArray<List<String>>). This is for two reasons: to make the API
simpler and also prevent issues with duplicate entries for packages
mapped to more than one preference which is not supported.

Bug: 176597181
Bug: 176494815
Test: atest FrameworksNetTests
Change-Id: I85363e28b46b89ae60a85219313c2a45bd5e7dd5
2021-02-04 20:12:40 -08:00
paulhu
b4fc12eda7 Replace NPMI#isUidNetworkingBlocked()
ConnectivityService 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 NPM#checkUidNetworkingBlocked to replace it.

Bug: 170598012
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Test: atest CtsHostsideNetworkTests
Test: atest FrameworksCoreTests:NetworkPolicyManagerTest
Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
Change-Id: I7bee37522dc5c55c255b159fda9481eff663655a
2021-02-04 19:28:57 +08:00
Junyu Lai
91d89b4880 Merge "[FUI21] Move scrubSubscriberId to utils class" am: f6c7f61d27 am: f0b03b1763 am: 582c042052
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565195

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If957a1c5017ab9600bbdece527543885a17ed2aa
2021-02-03 10:25:20 +00:00
Junyu Lai
f6c7f61d27 Merge "[FUI21] Move scrubSubscriberId to utils class" 2021-02-03 08:52:17 +00:00
Junyu Lai
ea7f3662da Merge "[FUI20] Expose UnderlyingNetworkInfo as system Api" am: 75b50a5c73 am: ce1b075b2b am: 93af32819c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1563496

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia294d4ec349db10f5486b27f733d4f6d223079bf
2021-02-03 04:32:04 +00:00
Junyu Lai
75b50a5c73 Merge "[FUI20] Expose UnderlyingNetworkInfo as system Api" 2021-02-03 02:57:10 +00:00
Cody Kesting
898e9466ea Merge changes from topic "vcn-network-policy" am: e980914d42 am: 8804aed91c am: a06b6244e8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1555540

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iae9c814702f08d49ade0c47fbd5e903aa9887037
2021-02-02 22:41:02 +00:00
Cody Kesting
e980914d42 Merge changes from topic "vcn-network-policy"
* changes:
  Implement Network policy in VcnManagementService.
  Unit test UnderlyingNetworkTracker.
  Register NetworkCallbacks in UnderlyingNetworkTracker.
2021-02-02 20:33:50 +00:00
Treehugger Robot
34becf1760 Merge "Update frameworks to use unbundled version of BouncyCastle." am: 19547685bb am: 36adf13e62 am: c3c1cd54e4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1559779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaf00137fbdfc3dacd99537f9f4e2da0ffbc9a844
2021-02-02 15:59:03 +00:00
junyulai
c59f67a79c [FUI21] Move scrubSubscriberId to utils class
This patch also removes the functionality of returning
original subscriberId in eng build since it is not really useful.

Test: atest NetworkIdentityUtilsTest
Bug: 174123988
Change-Id: I721457e571aa9403a2200b3e4261b4895e4f7a3e
2021-02-02 23:45:54 +08:00