Commit Graph

1844 Commits

Author SHA1 Message Date
Aaron Huang
eac59ebbf8 Merge changes I1d1f0d2d,Ifbd4a978
* changes:
  Communicate with BatteryStatsService through BatteryStatsManager
  Add a new API in BatteryStatsManager for connectivity service
2021-03-09 10:33:56 +00:00
Aaron Huang
330a4c0bfa Communicate with BatteryStatsService through BatteryStatsManager
Mainline connectivity service is only allowed to use formal
APIs. Use new system API in BatteryStatsManager instead of
calling BatteryStatsService directly.

Bug: 171686421
Test: FrameworksNetTests
Change-Id: I1d1f0d2d456003e842ad77519667c0532995610d
Merged-In: I1d1f0d2d456003e842ad77519667c0532995610d
2021-03-09 06:29:30 +00:00
James Mattis
5062ffb6f5 Merge "Applying OEM network pref to all users" 2021-03-05 19:09:24 +00:00
Treehugger Robot
b55e8e82a3 Merge "[FUI22] Support getAllNetworkStateSnapshot" 2021-03-05 05:16:43 +00:00
Janis Danisevskis
d1320fac29 Merge "Keystore 2.0: Make VPN Keystore 2.0 ready." 2021-03-05 02:57:34 +00:00
James Mattis
ae9aeb0c3b Applying OEM network pref to all users
Updating handleSetOemNetworkPreference so that the given policy is
applied to all users on the device. Additionally, remove uids for all
users/apps so that stale uids don't stay present after rematch. Finally,
small cleanup on how we deal with remote exceptions.

Bug: 181581017
Bug: 176494815
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I214717ee0c78cfe8322e551c2c2e9dc01c0242b2
2021-03-04 11:32:10 -08:00
Treehugger Robot
75f450ab9e Merge changes Ie8d98359,I4d5cadfd
* changes:
  Fix a bug in RequestReassignment#toString
  Cleanup some of the PANS code
2021-03-04 12:39:04 +00:00
junyulai
ebd15164e9 [FUI22] Support getAllNetworkStateSnapshot
Currently, ConnectivityService has getAllNetworkState but it is
not ideal to expose as system API since the plan is to get rid
of NetworkState. Thus, create a new one that returns
NetworkStateSnapshot to fulfill the needs.

Note the original getAllNetworkState cannot be deleted now since
it has @UnsupportedAppUsage annotation.

Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: Icddd434552b0e9ecbc8299e7242ec88cf3145aca
2021-03-04 18:41:09 +08:00
Janis Danisevskis
463c2d5292 Keystore 2.0: Make VPN Keystore 2.0 ready.
* Use public stable API to load certificates from keystore.
* Also use grants to allow racoon to use keystore keys without
  special exceptions in keystore.
* Use LegacyProfileStore instead of Keystore for storing VPN profiles.

Bug: 175068876
Bug: 171305607
Test: atest android.net.cts.Ikev2VpnTest
      atest android.net.cts.IpSecManagerTest
      atest com.android.server.connectivity.VpnTest
      atest com.android.server.ConnectivityServiceTest
Merged-In: I27975113896ea137260a9f94a34fb1c3ca173fe3
Change-Id: I27975113896ea137260a9f94a34fb1c3ca173fe3
2021-03-03 22:14:41 -08:00
Junyu Lai
87a6d6acd2 Merge "[FUI19] Migrate ConnectivityService to use NetworkStatsManager" 2021-03-04 01:24:57 +00:00
Sarah Chin
0f46c91ee5 Merge "APIs for 5G slicing" 2021-03-03 18:42:20 +00:00
junyulai
e7c7d2a9e1 [FUI19] Migrate ConnectivityService to use NetworkStatsManager
Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: Iaefd99f87ae96bc9d97d139bcd92a3fe8de917d2
2021-03-03 20:01:51 +08:00
Remi NGUYEN VAN
74ba6de40f Extend timeout for receiving broadcasts
The test is currently flaky as broadcasts can take a long time
to be delivered, often more than 500ms.
Extend the timeout for broadcasts to 30s.

Historically the test would wait for broadcasts for at most 500ms,
but not verify that they were received before proceeding. This was
fixed recently by adding an assertion, but the assertion needs to
give enough time for the broadcast to be received.

Bug: 173331190
Change-Id: I0760f3418c635aa4d68de5aefdb7120a9d3e930b
Test: atest FrameworksNetTests
2021-03-03 06:26:16 +00:00
Sarah Chin
223bc35f3b APIs for 5G slicing
Create TrafficDescriptor class
Create new APN ENTERPRISE
Update setupDataCall and DataCallResponse to take TrafficDescriptor and
matchAllRuleAllowed
Move ApnTypes from Annotation to ApnSetting

Bug: 179312227
Test: atest FrameworksTelephonyTests
Change-Id: I7433976bfe25bcb2af85ffb9338959cbcc9f42f3
Merged-In: I7433976bfe25bcb2af85ffb9338959cbcc9f42f3
2021-03-03 14:16:21 +09:00
Chalard Jean
5d6e23bdfb Cleanup some of the PANS code
Test: FrameworksNetTests
Change-Id: I4d5cadfdd8e30a179948302e8c0c45f4d42b59ea
2021-03-03 14:16:21 +09:00
Paul Hu
0957fc8681 Merge "Use IDnsResolverUnsolicitedEventListener" 2021-03-03 01:08:27 +00:00
Yan Yan
5bab9c0448 Merge "Support new IpSecAlgorithm AUTH_AES_CMAC" 2021-03-02 18:24:27 +00:00
junyulai
14133c117d [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
junyulai
de41fc2022 [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
Lucas Lin
6a2bb12457 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
paulhu
7c0a2e61fe Use IDnsResolverUnsolicitedEventListener
Only part of events will report from DnsResolver through
INetdEventListener. So use IDnsResolverUnsolicitedEventListener
to get exactly supporting events from DnsResolver and it uses
Parcelable object to deliver data which can be more updateable
and extendable in the future.

Bug: 173485754
Test: atest FrameworksNetTests
      atest CtsNetTestCases
Change-Id: I8d2e700ae8861ed8ceccd287f3ca5bc2f1ed6dee
2021-03-02 11:37:47 +08:00
Junyu Lai
ff35256ebd Merge "Fix copyright license of VpnTransportInfo" 2021-02-26 03:38:59 +00:00
Chris Weir
2a6448ce32 Merge "Update tests for PANS network usage metrics" 2021-02-25 21:37:42 +00:00
Yan Yan
6ca69e5f31 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
5f72702134 Merge "Use alternative PhoneStateListener formal API" 2021-02-25 12:14:53 +00:00
Junyu Lai
c8c6433b56 Merge "[VCN07] Bypass VCN for non-internet app accessible cellular services" 2021-02-25 10:16:03 +00:00
lucaslin
23efc5812a 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
d5c2d07dab Remove unused INetworkManagementService
Bug: 174837473
Test: atest FrameworksNetTests
Change-Id: I4e4f929f518ae07bf5b4bd1e16d2a85f62ab9d9c
2021-02-25 15:08:18 +08:00
lucaslin
37a16d9574 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
junyulai
c8d3b9308f Fix copyright license of VpnTransportInfo
Test: TH
Bug: None
Change-Id: Id1fe2c62a0fd60b9833d8b00d2fa2ddc2f031004
2021-02-25 10:31:56 +08:00
Chris Weir
13c3b49fe9 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
James Mattis
ec1fb89d18 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
Chiachang Wang
88163e28a0 Merge "Remove UidRange.createForUser() with userId integers" 2021-02-23 07:17:07 +00:00
Chiachang Wang
9791a9ed0c 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
Lucas Lin
9b56fad5b9 Merge changes I852e3a53,I86755647,I0ed8b0c6
* changes:
  Remove unused INetworkManagementService from IpSecService
  Use NetdUtils instead of NetworkManagementService in Vpn
  Use NetdUtils instead of NetworkManagementService in IpSecService
2021-02-22 06:49:39 +00:00
paulhu
d42261fea3 Use alternative PhoneStateListener formal API
MultinetworkPolicyTracker is part of Connectivity mainline module
which cannot call @hide API to register PhoneStateListener. Thus,
replace it to formal API.

Bug: 171183530
Test: atest FrameworksNetTests
Change-Id: Ib02790623e82726aaada33f559226020d1e0019b
2021-02-22 14:31:58 +08:00
Paul Hu
6b5305b3b2 Merge "Stop using SysetmConfig#getSystemPermissions on PermissionMonitor" 2021-02-22 05:22:37 +00:00
junyulai
719814c97a [VCN07] Bypass VCN for non-internet app accessible cellular services
Deduce the NET_CAPABILITY_NOT_VCN_MANAGED capability from other
capabilities and user intention, which includes:
   1. For the requests that don't have anything besides
      VCN_SUPPORTED_CAPABILITIES, add the NOT_VCN_MANAGED to
      allow the callers automatically utilize VCN networks
      if available.
   2. For the requests that explicitly add or remove
      NOT_VCN_MANAGED,  do not alter them to allow user fire
      request that suits their need.

Test: atest NetworkRequestTest#testBypassingVcnForNonInternetRequest
Bug: 175662146
Change-Id: I2876264cee14b624c89ba3b380027a8b521ad8ea
  (cherry-picked from aosp/1549817)
2021-02-22 10:19:16 +08:00
James Mattis
fb0919fb6f Merge "Unit test automation for Multilayer Evaluation" 2021-02-20 21:23:45 +00:00
Junyu Lai
9d8d6ff5c3 Merge "[FUI15] Remove networkId in NetworkState" 2021-02-20 14:00:19 +00:00
paulhu
17ca040931 Stop using SysetmConfig#getSystemPermissions on PermissionMonitor
Repalace the API with SysetmConfigManager#getSystemPermissionUids
and update the design/test accordingly.

Bug: 177188455
Test: atest FrameworksNetTests
Test: atest FrameworksNetIntegrationTests
Test: atest CtsNetTestCases
Change-Id: I8b553b934252b93c60b815715680427a41620054
2021-02-20 16:20:19 +08:00
Chiachang Wang
2f435607da Merge changes I0a75c440,Ief9e8925,Ie03e8276,If0ac9a64,I716bd771
* changes:
  [IT06]Move INetworkActivityListener into connectivity module
  [IT05] Remove the unused network activity logic out from NMS
  [IT4.7] Add network activity info into dumpsys for debugging
  [IT4.6] Unbundle NMS out from ConnectivityManager
  [IT4.5] Update radio power from CS directly
2021-02-20 02:02:46 +00:00
James Mattis
485d92d348 Unit test automation for Multilayer Evaluation
Unit test automation for multilayer network hierarchy evaluation
when using the setOemNetworkPreference() API ConnectivityService.

Bug: 178632672
Bug: 176494815
Bug: 170068946
Test: atest FrameworksNetTests
Change-Id: Ia9b76f49a07eff6a3977faaa41fc67a10f307841
2021-02-19 17:41:01 -08:00
James Mattis
eefc5a1a5b Merge "Unit tests for Multi-Default with Existing APIs" 2021-02-20 01:38:52 +00:00
Lorenzo Colitti
e218007df3 Merge changes I0e6df469,I3d46d5f7
* changes:
  Fix testMobileDataAlwaysOn flakiness
  Speed up NetworkFactory tests.
2021-02-19 08:13:38 +00:00
Lorenzo Colitti
23e7e5c862 Fix all Log.wtfs in FrameworksNetTests.
These cause the tests to crash on eng builds, so disrupt
development.

Test: atest FrameworksNetTests passes on eng build
Change-Id: Ifa5131fdb8f57af812cf688970be6588d2879c29
2021-02-18 21:13:04 +09:00
Chalard Jean
5e8ed0d307 Fix testMobileDataAlwaysOn flakiness
Test: atest --iterations 100 CST#testMobileDataAlwaysOn
Change-Id: I0e6df4694752dab7a5938e8f8bd88c7da7c3fcd5
2021-02-18 16:45:27 +09:00
Chalard Jean
94cb442983 Speed up NetworkFactory tests.
Somehow this big slowdown escaped review.

Test: ConnectivityServiceTest
Change-Id: I3d46d5f7a986b3586b7e6044eb10aba756bb6ceb
2021-02-18 16:45:26 +09:00
Lorenzo Colitti
114b88957e Merge "Fix merge conflict." 2021-02-18 05:22:56 +00:00
lucaslin
1193a5d5f1 [IT4.6] Unbundle NMS out from ConnectivityManager
ConnectivityService is no longer to update idle timer to NMS but
send to INetd directly after this change. Replace the API
implementation in ConnectivityManager to refer into
ConnectivityService instead of NetworkManagementService to remove
the dependency between CM and NMS for ConnectivityService mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: If0ac9a6427dba5a732a15b5d7ca1351b71b07b7b
2021-02-18 11:48:06 +08:00