Commit Graph

11879 Commits

Author SHA1 Message Date
Yan Yan
ca72617385 Merge "Support new IpSecAlgorithm AUTH_AES_CMAC" 2021-03-02 18:24:27 +00:00
Treehugger Robot
7a593e640d Merge "[FUI09] Expose NetworkStateSnapshot as system API" 2021-03-02 16:08:03 +00:00
junyulai
c6e8355dbd [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
ebfdaa502f Merge "[FUI17] Migrate NetworkStatsService to use NetworkStateSnapshot" 2021-03-02 13:21:32 +00:00
junyulai
527859f7a4 [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
d795b61a56 Merge "Move OemNetworkPreferences aidl to connectivity" 2021-03-02 09:29:07 +00:00
Remi NGUYEN VAN
ea3a01abf9 Merge "Move UidRange to connectivity" 2021-03-02 09:27:50 +00:00
Treehugger Robot
d55697b5e2 Merge "Add modules-utils-os to service-connectivity" 2021-03-02 08:59:35 +00:00
Treehugger Robot
e7b360f9f5 Merge "Replace checkNetworkStackPermission in TestNetworkService" 2021-03-02 08:55:28 +00:00
Remi NGUYEN VAN
14bcef6a65 Merge "Move Proxy, PacProxySelector out of Connectivity" 2021-03-02 07:49:00 +00:00
Remi NGUYEN VAN
24e5bceac5 Merge "Move SocketUtils out of the connectivity module" 2021-03-02 06:44:01 +00:00
Remi NGUYEN VAN
4e85d98a6f 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
Aaron Huang
92e767c065 Merge "Use the net-utils-device-common version of HexDump" 2021-03-02 06:25:34 +00:00
Remi NGUYEN VAN
49c389926a 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
22c42d573e 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
Lucas Lin
51d01615d3 Merge changes I35ed84fc,Ie6cfd77b,I4e4f929f,I751526e8
* changes:
  Fix comments left on aosp/1547454 and aosp/1556106
  Remove INetworkManagementService from ConnectivityService
  Remove unused INetworkManagementService
  Remove BaseNetworkObserver from Nat464Xlat
2021-03-02 04:07:35 +00:00
Remi NGUYEN VAN
1dd6922fda Add modules-utils-os to service-connectivity
service-connectivity needs the library so that module utilities are statically
linked, not picked up from the framework jar as hidden symbols.

Bug: 170598012
Change-Id: I1045b3784a4bdb902f44d848ccddb304986631c3
Test: m
2021-03-02 03:28:58 +00:00
Remi NGUYEN VAN
b2a34f3db1 Replace checkNetworkStackPermission in TestNetworkService
Use the underlying PermissionUtils directly instead.

Bug: 178352309
Change-Id: I840a7b7d53531604a214b73f1f518b2ebb10e71e
Test: atest FrameworksNetTests
2021-03-02 02:27:42 +00:00
lucaslin
cdda475652 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
3a142b99f1 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
de9477571f 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
accf696b71 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
Remi NGUYEN VAN
bdf98b8928 Merge "Split out the connectivity API surface" 2021-03-01 01:07:19 +00:00
Junyu Lai
dcd3962cbb Merge "[FUI08] Create NeworkStateSnapshot" 2021-02-26 10:53:36 +00:00
Remi NGUYEN VAN
2079e355ac Split out the connectivity API surface
Split out connectivity APIs to connectivity module directories. This
prepares future move of the connectivity code into a mainline module,
but still keeps it implemented by framework-minus-apex for now: the API
stubs are moved to framework-connectivity.stubs, but the implementation
on device remains in the same place.

This allows moving the connectivity code in/out of APEX with minimal
changes.

BYPASS_INCLUSIVE_LANGUAGE_REASON=Moving files, can't modify released API

Bug: 171540887
Test: device boots, connectivity working

Merged-In: I21c42f032efa6c10e36c749df3183ce9679303a7
(cherry-pick from internal branch with API files conflicts)

Change-Id: I21c42f032efa6c10e36c749df3183ce9679303a7
2021-02-26 19:23:25 +09:00
Aaron Huang
77eb53365b Use the net-utils-device-common version of HexDump
KeepaliveTracker is included in ConnectivityService mainline
module and it will not be able to access internal util class
com.android.internal.util.HexDump. Use the HexDump defined in
net-utils-device-common to remove dependency on internal util
class.

Bug: 177046265
Test: FrameworksNetTests
Change-Id: I1f5a6a749106b98e2baf22d6a290dcf8b51a6c36
2021-02-26 07:10:19 +00:00
junyulai
4b836cfb98 [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
Junyu Lai
993c655bf3 Merge "Fix copyright license of VpnTransportInfo" 2021-02-26 03:38:59 +00:00
Remi NGUYEN VAN
32dbde1641 Merge "Fix CaptivePortalDataTest on R" 2021-02-26 01:51:14 +00:00
Remi NGUYEN VAN
a68e748601 Merge "Add public alternative for protectFromVpn" 2021-02-26 01:50:32 +00:00
Chris Weir
e6b895b488 Merge "Update tests for PANS network usage metrics" 2021-02-25 21:37:42 +00:00
Yan Yan
7bd615ff95 Support new IpSecAlgorithm AUTH_AES_CMAC
Bug: 161716062
Test: IpSecAlgorithmTest, verified with CTS
Change-Id: Ideaf4225bd851fad8c8072505c6ad99d85ba616e
2021-02-25 10:35:10 -08:00
Paul Hu
4de7d07302 Merge "Use alternative PhoneStateListener formal API" 2021-02-25 12:14:53 +00:00
lucaslin
2459517a2a Add test for getStartUser(), getEndUser() and createForUser()
- Follow-up commit will modify getStartUser() and getEndUser(),
to make sure the result is consistent, add test before changing
getStartUser() and getEndUser().
- Add a test for createForUser() to ensure the last uid of
the previous user is smaller than the first uid of the next user.
- Move this test file to tests/net/common, so that it can be run
in CTS.

Bug: 170598012
Test: atest FrameworksNetTests:UidRangeTest
      CtsNetTestCasesLatestSdk:UidRangeTest
      Also run above tests on Q and R devices.
Change-Id: I8b146aa14b50911e50a39f266e8d8dc17df853b2
2021-02-25 18:32:40 +08:00
Junyu Lai
ef906819f9 Merge "[VCN07] Bypass VCN for non-internet app accessible cellular services" 2021-02-25 10:16:03 +00:00
lucaslin
e17f347585 Fix comments left on aosp/1547454 and aosp/1556106
Bug: 174837473
Test: atest FrameworksNetTests
Change-Id: I35ed84fcc53725fe29896ec37b77ef4fb4778fde
2021-02-25 15:10:29 +08:00
lucaslin
d5d3dc15ba Remove INetworkManagementService from ConnectivityService
Remove INetworkManagementService from ConnectivityService and
related files.

Bug: 174837473
Test: atest FrameworksNetTests FrameworksNetIntegrationTests
Change-Id: Ie6cfd77bbd64a8fd7539b0ea7fd15bf970e40c3d
2021-02-25 15:08:28 +08:00
lucaslin
ea5378c50f Remove unused INetworkManagementService
Bug: 174837473
Test: atest FrameworksNetTests
Change-Id: I4e4f929f518ae07bf5b4bd1e16d2a85f62ab9d9c
2021-02-25 15:08:18 +08:00
lucaslin
357f586a63 Remove BaseNetworkObserver from Nat464Xlat
Let ConnectivityService talk to Nat464Xlat through NetworkAgnetInfo
directly:
- Nat464Xlat will be created once there is a new network bringing up,
but Netd doesn't expose the method for unregistering unsolicited event.
- ConnectivityService has already registered netd unsolicited event
listener, so Nat464Xlat doesn't need to register unsolicited event
listenser by itself, it can get the unsolicited event from
ConnectivityService directly.

Bug: 174837473
Test: atest FrameworksNetTests
Change-Id: I751526e8ffa7d25591696ecd8d93b1585c4c20c7
2021-02-25 15:08:05 +08:00
Lucas Lin
692b07f7dd Merge "Replace BaseNetworkObserver with BaseNetdUnsolicitedEventListener" 2021-02-25 06:45:15 +00:00
junyulai
50f96a50bc Fix copyright license of VpnTransportInfo
Test: TH
Bug: None
Change-Id: Id1fe2c62a0fd60b9833d8b00d2fa2ddc2f031004
2021-02-25 10:31:56 +08:00
Chris Weir
b692cc8e5c Update tests for PANS network usage metrics
Update existing tests to use new NetworkTemplate/NetworkIdentity
constructors, and add additional tests for new PANS metrics features.

Bug: 175793874
Bug: 174485293
Test: Run the tests in this CL with atest

Change-Id: I6f50993397d886a266874da0047c02022a69f62e
2021-02-23 22:16:19 -08:00
Remi NGUYEN VAN
caaa4df54c Add public alternative for protectFromVpn
The method is called directly by VpnService#protect.

Bug: 171540887
Test: m
Change-Id: I7cbb1ef1301dcf8d27b2cc39c0431a0156fe3442
2021-02-24 14:49:35 +09:00
James Mattis
6177885a1a Unit test automation for Multi-Default Tracking
Unit test automation validating how multiple default networks are
tracked within ConnectivityService when set by network preferences
used with setOemNetworkPreference() API functionality.

Bug: 178632672
Bug: 172347841
Bug: 170068946
Test: atest FrameworksNetTests
Change-Id: Iae1935944214efaa8a21636c55e6d8be816275f7
2021-02-23 19:03:34 -08:00
Remi NGUYEN VAN
13ca219a45 Fix CaptivePortalDataTest on R
The test can only use setUserPortalUrl(Uri, int) and
setVenueInfoUrl(Uri, int) on S+.

Bug: 180870236
Change-Id: I1cfa765ad12a228e09eb146d1e6e5ba2e3aa3979
Test: atest FrameworksNetTestCases
2021-02-24 02:08:42 +00:00
Chiachang Wang
a611e12599 Merge "Remove UidRange.createForUser() with userId integers" 2021-02-23 07:17:07 +00:00
Paul Hu
fb2b8378b8 Merge "Use PermissionUtils" 2021-02-23 01:48:58 +00:00
Chiachang Wang
36c58380fe Merge "Move shared methods to net shared lib" 2021-02-23 00:58:59 +00:00
Treehugger Robot
27f44dc792 Merge "Clean up T&C implementation" 2021-02-22 19:58:43 +00:00
lucaslin
db201dac1d Replace BaseNetworkObserver with BaseNetdUnsolicitedEventListener
ConnectivityService will be a part of mainline module, to prevent
using @hide API of NetworkManagementService in TestNetworkService,
use function inside NetdUtils instead.

Bug: 170598012
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: Id615f7b900d26d0f5887adcd8221dc8bef239923
2021-02-23 01:12:55 +08:00