Commit Graph

5825 Commits

Author SHA1 Message Date
Yan Yan
067b3dffa4 Merge changes I65dbc509,I1e338d9c,Ib4a0ed69,Iac7077b4,I9c53d425, ...
* changes:
  Support converting IKE ID to/from PersistableBundle
  Support converting EAP-TTLS to/from PersistableBundle
  Support converting EAP-SIM, AKA and AKA' to/from PersistableBundle
  Support converting EapSessionConfig to/from PersistableBundle
  Support converting TunnelModeConfigRequest to/from PersistableBundle
  Support converting TunnelModeChildSessionParams to/from PersistableBundle
  Support converting ChildSaProposal to/from PersistableBundle
  Support converting IkeSaProposal to/from PersistableBundle
2021-03-04 18:30:17 +00:00
Cody Kesting
dcaf81ebff Merge changes from topic "vcn-status-cb"
* changes:
  Call VcnStatusCallback#onVcnStatusChanged on register.
  Remove VcnStatusCallback#onEnteredSafemode().
  Expose APIs for VcnStatusCallback.
2021-03-04 18:09:40 +00:00
Sudheer Shanka
ae0fa6d359 Merge "Add new network process capability." 2021-03-04 03:02:49 +00:00
Cody Kesting
5d623992e9 Remove VcnStatusCallback#onEnteredSafemode().
This CL removes VcnStatusCallback#onEnteredSafeMode(). This method was
previously used to notify callbacks when their VCN entered Safe Mode.
However, this is not needed now that
VcnStatusCallback#onVcnStatusChanged(int) is defined.

Bug: 1597023
Test: atest FrameworksVcnTests
Change-Id: I8e47de9bf6763cd38025a552bee710673dddf843
2021-03-03 10:08:50 -08:00
Cody Kesting
9f925c5fc9 Expose APIs for VcnStatusCallback.
This CL exposes the APIs needed to define VcnStatusCallback as well as
register and unregister them. VcnStatusCallbacks should be registered by
Carrier Apps to receive VCN-related status updates for their configured
VCNs. Potential status updates include a VCN entering safe mode or an
error with an underlying Network.

Bug: 163433613
Test: atest FrameworksVcnTests
Change-Id: I1bf01139d4feea71f650acdbf98c6634c66acbbf
2021-03-03 10:08:49 -08:00
Yan Yan
b9fdfa8270 Merge "Use VERSION_CODES.S instead of VERSION_CODES.R + 1" 2021-03-03 18:04:52 +00:00
James Mattis
1258b5fec3 Merge "Adding additional docs for OemNetworkPreferences" 2021-03-03 17:25:01 +00:00
Yan Yan
8c7f74fa35 Merge "Support new IpSecAlgorithm AUTH_AES_CMAC" 2021-03-02 18:24:27 +00:00
Treehugger Robot
4dd42cdd5f Merge "[FUI09] Expose NetworkStateSnapshot as system API" 2021-03-02 16:08:03 +00:00
junyulai
604fd08ca8 [FUI09] Expose NetworkStateSnapshot as system API
This is needed by NetworkStatsService and
NetworkPolicyManagerService to utilize the snapshots of
information of networks that grabbed from ConnectivityService.

Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I7e974ef7b23ba9ba6ee775eed9899b0c0e2eca55
2021-03-02 23:09:16 +08:00
Treehugger Robot
60faefffe9 Merge "[FUI17] Migrate NetworkStatsService to use NetworkStateSnapshot" 2021-03-02 13:21:32 +00:00
junyulai
6b70436047 [FUI17] Migrate NetworkStatsService to use NetworkStateSnapshot
This change migrates NetworkStatsService and related code to use
NetworkStateSnapshot which is used for replacing the NetworkState.

This patch also changes some formating which is suggested by
the linter.

Test: FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I547da8f411cb45bdadc376ac3cadf3f3c55bb282
2021-03-02 20:08:53 +08:00
Remi NGUYEN VAN
2e03331755 Merge "Move OemNetworkPreferences aidl to connectivity" 2021-03-02 09:29:07 +00:00
Remi NGUYEN VAN
5a81037576 Merge "Move UidRange to connectivity" 2021-03-02 09:27:50 +00:00
Remi NGUYEN VAN
ae171d864d Merge "Move Proxy, PacProxySelector out of Connectivity" 2021-03-02 07:49:00 +00:00
Remi NGUYEN VAN
4eb9b18e02 Merge "Move SocketUtils out of the connectivity module" 2021-03-02 06:44:01 +00:00
Sudheer Shanka
9771009668 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
Merged-In: Ia411ddef2e8cb77d371c22262d5b1e06a0396e29
2021-03-02 06:43:51 +00:00
Remi NGUYEN VAN
c983440dd8 Move UidRange to connectivity
UidRange is a data class that is an implementation detail of
Connectivity. Move it to the connectivity boundary.

Remaining usages of UidRange outside of Connectivity (in VPN) should be
migrated to other classes, like Range<Integer> or UidRangeParcel.

Bug: 181512874
Test: m
Change-Id: I6f2e3685ad1c07171dd90480d1e546329de8732d
2021-03-02 15:35:36 +09:00
Remi NGUYEN VAN
f359b2d6cc Move OemNetworkPreferences aidl to connectivity
Move the IOnSetOemNetworkPreferenceListener aidl definition to
framework-connectivity.
The interface is an internal implementation detail of
framework-connectivity, so it should be built inside the jar.

Bug: 181512874
Test: m
Change-Id: I898049b50fc620ee629587a9303f058e0a6d0272
2021-03-02 13:56:38 +09:00
Lucas Lin
67ba0bc206 Merge changes I06ab0f2d,I8b146aa1
* changes:
  Use UserHandle#getIdentifier to get the userid
  Add test for getStartUser(), getEndUser() and createForUser()
2021-03-02 04:13:32 +00:00
lucaslin
6e09f2a6ce Use UserHandle#getIdentifier to get the userid
UidRange uses PER_USER_RANGE to calculate and get the userid,
but PER_USER_RANGE is a hidden API, so use getIdentifier to get
the userid instead.

Bug: 170598012
Test: atest FrameworksNetTests:UidRangeTest
Change-Id: I06ab0f2da8a33d2b718bbc3a609d3d6a5fe0a095
2021-03-02 02:21:39 +00:00
Remi NGUYEN VAN
32a606fe54 Merge "Move QoS API classes to Connectivity" 2021-03-02 00:36:47 +00:00
Yan Yan
6a6a6349a7 Merge "Support converting IkeTrafficSelector to/from PersistableBundle" 2021-03-01 22:31:24 +00:00
Yan Yan
b8a6b4ef85 Support converting IKE ID to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: I65dbc509f23334df2f22d6c4658e31acc9bef787
2021-03-01 12:22:12 -08:00
Yan Yan
a3d6e04d27 Support converting EAP-TTLS to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: I1e338d9c8940636b38f4725787de30fbbc1323ec
2021-03-01 12:19:36 -08:00
Yan Yan
3344f916bd Support converting EAP-SIM, AKA and AKA' to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: Ib4a0ed69b57df10c5ede9524d0b03f4f03d68919
2021-03-01 12:19:25 -08:00
Yan Yan
63db000ae0 Support converting EapSessionConfig to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: Iac7077b4ca37dfc07055aac5b3a8118610a27999
2021-03-01 12:19:15 -08:00
Yan Yan
ca4e2a4041 Support converting TunnelModeConfigRequest to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: I9c53d4252edb0e8816c84d280b48c4725bd0edc8
2021-03-01 12:19:05 -08:00
Yan Yan
32fed8965b Support converting TunnelModeChildSessionParams to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(add new tests)
Change-Id: I4d27ac37ce750930cefa73de25e5deea74591d0e
2021-03-01 12:17:42 -08:00
Yan Yan
6ce7d0db64 Support converting ChildSaProposal to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(new tests added)
Change-Id: I726a29a65b10b23718fe3b1658d70a8b84cfd2de
2021-03-01 11:14:07 -08:00
Yan Yan
f14e3e03a6 Support converting IkeSaProposal to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(new tests added)
Change-Id: I108e5a946296f65bbe92549464aa68a2ec453659
2021-03-01 10:53:06 -08:00
Remi NGUYEN VAN
9200ec1579 Move Proxy, PacProxySelector out of Connectivity
PacProxySelector is tied to IProxyService, which does not have a formal
API.
Proxy is the interface with ConnectivityService, and all its methods are
public or module API.

Bug: 171540887
Test: m
Change-Id: I8ceba961a81661c3e11d8179955b594d3cab6ff7
2021-03-01 18:35:26 +09:00
Remi NGUYEN VAN
3550d4bab5 Move QoS API classes to Connectivity
The classes were added in S and are used to back ConnectivityManager
APIs. Add them to the connectivity boundary as they belong together with
ConnectivityManager.

Bug: 181512874
Test: m
Change-Id: I03b5978949b200a72813d1ebc4812d851fe3df37
2021-03-01 18:09:30 +09:00
Remi NGUYEN VAN
914dca36ee Move SocketUtils out of the connectivity module
SocketUtils contains system APIs for modules to interact for sockets,
wrapping internal APIs. It should be part of the platform to keep access
to the internal APIs.

This involves splitting NetworkUtils.protectVpn to NetworkUtilsInternal,
since SocketUtils and VpnService are the only users of that method.

The @UnsupportedAppUsage NetworkUtils.protectVpn has low usage
count, and is already available through VpnService.protect.

Bug: 181512874
Test: boots, VPN working
Change-Id: I7028d334975f7536c06afac7a22200c33db707ac
2021-03-01 16:50:08 +09:00
Junyu Lai
702ca13a66 Merge "[FUI08] Create NeworkStateSnapshot" 2021-02-26 10:53:36 +00:00
junyulai
c6ddf7afbc [FUI08] Create NeworkStateSnapshot
Since NetworkState has UnsupportedAppUsage APIs that cannot
be changed, create another class for follow-up patches
to expose as system API.

Test: NetworkStateSnapshotTest
Bug: 174123988
Change-Id: I54ef872847f34166aa34a79f6178c90ac12b6c72
2021-02-26 11:57:06 +08:00
Chris Weir
90261da202 Merge "Add support for tracking PANS data usage" 2021-02-25 21:37:42 +00:00
Yan Yan
7f13ec417e Use VERSION_CODES.S instead of VERSION_CODES.R + 1
Bug: 170424293
Test: IpSecAlgorithmTest
Change-Id: I4662b0d43c476b744536a41000d578e8b69286ef
2021-02-25 10:40:24 -08:00
Yan Yan
bd0b8751e6 Support new IpSecAlgorithm AUTH_AES_CMAC
Bug: 161716062
Test: IpSecAlgorithmTest, verified with CTS
Change-Id: Ideaf4225bd851fad8c8072505c6ad99d85ba616e
2021-02-25 10:35:10 -08:00
James Mattis
ab3437487e Adding additional docs for OemNetworkPreferences
Bug: 181036259
Test: make and device boot
Change-Id: I60375dc97f6ed1d2959aa920d3099c1841866e1b
2021-02-24 11:34:52 -08: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
Yan Yan
2a9bfb281f Support converting IkeTrafficSelector to/from PersistableBundle
Bug: 163604823
Test: FrameworksVcnTests(new tests added)
Change-Id: I7b2613d62fa555c3c1eb125a1d971771b954e9ca
2021-02-23 10:39:17 -08: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