Commit Graph

5938 Commits

Author SHA1 Message Date
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
junyulai
755356f449 [FUI20] Expose UnderlyingNetworkInfo as system Api
Test: atest android.net.UnderlyingNetworkInfoTest
Bug: 174123988
Change-Id: Id602fbe744669f472d27fb466d00dcc601bd8f17
2021-02-02 23:12:10 +08:00
Treehugger Robot
19547685bb Merge "Update frameworks to use unbundled version of BouncyCastle." 2021-02-02 14:37:05 +00:00
Sarah Chin
58fe38182d Update setSubscriptionOverride API to allow network types
Allow 5G unmetered override via a different API than
setSubscriptionPlans. OVERRIDE_UNMETERED can be set without defining
SubscriptionPlans, but OVERRIDE_CONGESTED behavior remains the same.
Both the unmetered and congested case of setSubscriptionOverride take in
networkTypes as an additional parameter

Test: atest FrameworksTelephonyTests
Test: atest SubscriptionManagerTest
Bug: 175723642
Change-Id: Ie196db5e236e478f1c29c3dfd1ca31acc205c54b
Merged-In: Ie196db5e236e478f1c29c3dfd1ca31acc205c54b
2021-02-01 18:36:19 -08:00
Cody Kesting
a382c9ca0c Register NetworkCallbacks in UnderlyingNetworkTracker.
This CL updates UnderlyingNetworkTracker to register NetworkCallbacks.
UnderlyingNetworkTracker uses two types of NetworkCallbacks:
  - bringup requests
  - selection requests

Bringup requests ensure that VCN-managed Networks are not reaped.
Separate bringup requests are filed for wifi and cell Networks. One cell
request is filed for each subscription ID (subId) in the VCN's
subscription group.

Selection requests are used to allow ConnectivityService to perform
Network selection for the VCN's selected underlying Network (the Network
that VCN traffic will be routed through).

Bug: 177364490
Test: atest FrameworksVcnTests
Change-Id: Ic4dc13a3f7acf08589ddb25b343af2677cd7cf65
2021-02-01 14:46:57 -08:00
Lorenzo Colitti
f353805511 Merge "Revert "Expose IPsec tunnel APIs from @SystemApi to public APIs"" am: 5a700b2725 am: f681bee340 am: 7720b1f3d9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1564979

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id8e99aeefffddf88240cf5f1d7117e022242708f
2021-02-01 17:12:33 +00:00
Lorenzo Colitti
5a700b2725 Merge "Revert "Expose IPsec tunnel APIs from @SystemApi to public APIs"" 2021-02-01 15:33:11 +00:00
Lorenzo Colitti
f82ebd7451 Merge changes Idcc9e32c,I58769bb7 am: d4caba4daf am: 2425886baa am: 4cb54827a0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552503

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3d15c00910467d51531a25c025efb491b446b6a4
2021-02-01 12:41:24 +00:00
Remi NGUYEN VAN
09119c2ceb resolve merge conflicts of 546e2e895f to sc-dev
Bug: None, merge conflict
Change-Id: Id07440d6a55111a1a7ddbf3df306f4466073fd1d
2021-02-01 11:29:28 +00:00
Lorenzo Colitti
d4caba4daf Merge changes Idcc9e32c,I58769bb7
* changes:
  Remove getFilteredNetworkState and add @NonNull in NetworkState.
  Add test coverage for get*NetworkInfo on metered networks.
2021-02-01 10:56:19 +00:00
Lorenzo Colitti
0053756e78 Revert "Expose IPsec tunnel APIs from @SystemApi to public APIs"
This reverts commit c92a798ee8.

Reason for revert: not necessary, since VCN already has access to system APIs

Bug: 174606949
Test: revert with no conflicts
Change-Id: Ife2d0fc08c540265d52cdf930d0b6df005990ac8
2021-02-01 08:13:32 +00:00
Lorenzo Colitti
d8cc12a87b Remove getFilteredNetworkState and add @NonNull in NetworkState.
getFilteredNetworkState is only used in two places, both of which
use only small parts of the NetworkState that is returned to
them. Remove the method and replace it with inline code in the
two callers. NetworkState is a fairly expensive object, and this
removes the need to perform lots of defensive copies of data that
the caller does not need.

Also remove the only call to the NetworkState constructor in
ConnectivityService. That leaves only one caller to the
NetworkState constructor, the one in NetworkAgentInfo. This
constructor is called with defensive copies of NetworkInfo,
LinkProperties, and NetworkCapabilities, so mark these three
parameters as @NonNull. It's also called with a non-null
Network, because NetworkAgentInfo is only constructed with
non-null Networks, so mark the network parameter @NonNull as
well.

In order to make the arguments in the NetworkState constructor
@NonNull, introduce a new constructor that sets everything to
null and make NetworkState.EMPTY call it.

Test: atest FrameworksNetTests
Change-Id: Idcc9e32c53533b0cf61494517e62d4c184fa7610
2021-02-01 16:12:04 +09:00
Remi NGUYEN VAN
a31d729863 Move module sources to packages/Connectivity
Files that are planned to be part of the connectivity module are grouped
in packages/Connectivity, so they can be built separately and moved in
one operation with their history into packages/modules/Connectivity.

This places the files in the existing framework-connectivity-sources
filegroup instead of the current framework-core-sources filegroup. Both
are used the same way in framework-non-updatable-sources.

Bug: 171540887
Test: m
Change-Id: I62d9d91574ace6f5c4624035d190260c3126b91e
2021-02-01 11:52:14 +09:00
Cody Kesting
6f8a8f06c4 Merge "Allow system components to request underlying network policies." am: ba04ef8481 am: 89a75849c2 am: 46309401db
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1533097

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8ff2d79f5d35888cd4bae6742eb40035603c5eeb
2021-01-29 23:39:23 +00:00
Junyu Lai
9da313fbb4 Merge "[FUI16] Expose setSubscriberId in NetworkAgentConfig as system API" am: 6194d765d2 am: 1800e22426 am: 22745a5c44
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556552

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If6e5747ccc97972a4c21058c600e72c5a3f3b61e
2021-01-29 23:38:56 +00:00
Junyu Lai
96ed3f6925 Merge "[FUI04] Refactor VpnInfo" am: 561626b20d am: 0824b59f74 am: 9e10a5a1ef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1537211

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icfa9918e41fc3f952a23956108df4db449741364
2021-01-29 23:38:06 +00:00
Junyu Lai
df209349c4 Merge "[VCN06] Support request background network" am: 7e0d8315d1 am: 5fa77ae82c am: 5ad75875bf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553866

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I50867bc7cb21eb134f20af9ef55c44c2bd8962e9
2021-01-29 23:36:41 +00:00
Lucas Lin
8600707574 Merge "Remove unused method from MatchAllNetworkSpecifier" am: 6a5d57c2ee am: 2de61be98e am: ef5f51a45b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1560475

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic11ea6619c7feebc8b7a52c253e6b13ab5981dd8
2021-01-29 23:36:02 +00:00
Cody Kesting
ba04ef8481 Merge "Allow system components to request underlying network policies." 2021-01-29 18:58:00 +00:00
Junyu Lai
6194d765d2 Merge "[FUI16] Expose setSubscriberId in NetworkAgentConfig as system API" 2021-01-29 17:15:28 +00:00
junyulai
0ee85f3bf8 [FUI16] Expose setSubscriberId in NetworkAgentConfig as system API
The wifi (mainline module) need to set the subscriberId for specific
wifi network.

Bug: 176396812
Test: TreeHugger
Change-Id: Ib568ce0c2d1b629e1c20e7ac8d8b78579cf4825c
2021-01-29 22:09:10 +08:00
Junyu Lai
561626b20d Merge "[FUI04] Refactor VpnInfo" 2021-01-29 13:54:53 +00:00
Junyu Lai
7e0d8315d1 Merge "[VCN06] Support request background network" 2021-01-29 11:02:02 +00:00
junyulai
d242947ae2 [FUI04] Refactor VpnInfo
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
  1. Change raw arrays into lists according to API guidelines.
  2. Write test.
  3. Rename class to UnderlyingNetworkInfo.
  4. Rename vpnIface to iface.
  5. Make underlyingIfaces @NonNull in order to adapt new
     unparceling code.
  6. implement equals and hashCode for testing.

Test: atest android.net.UnderlyingNetworkInfoTest
Bug: 174123988

Change-Id: I405c21e57c4af8a12a9dd0a1749b9e6690f87045
2021-01-29 17:44:32 +08:00
Junyu Lai
15f4a9cd7c [VCN06] Support request background network
This will be mainly used by VCN management service which will
need to hold the networks but preserve the backgrounded-ness
of the networks.

Test: android.net.ConnectivityManagerTest#testRequestType
Test: android.net.cts.ConnectivityManagerTest#testRequestBackgroundNetwork /
      --rerun-until-failure 100
Test: ConnectivityServiceTest#testBackgroundNetworks
Test: m -j doc-comment-check-docs
Bug: 175662146

Change-Id: I463c7a3139a286e50ea71e674060975ce228caa9
2021-01-29 14:42:32 +08:00
Cody Kesting
7de2e8443c Allow system components to request underlying network policies.
This CL updates VcnManager to allow system components with permission
NETWORK_FACTORY to request the current VcnUnderlingNetworkPolicy for a
specific Network's NetworkCapabilities and LinkProperties.

Bug: 175900686
Test: atest FrameworksVcnTests
Change-Id: I16416e619bdb03630582f5660260b0090730e9eb
2021-01-28 19:38:06 -08:00
Lucas Lin
6a5d57c2ee Merge "Remove unused method from MatchAllNetworkSpecifier" 2021-01-29 02:47:00 +00:00
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