Commit Graph

2098 Commits

Author SHA1 Message Date
Lorenzo Colitti
35432c1375 Merge "Set extraInfo on cellular TestNetworkAgents." am: ab2f3d3cb5 am: c612271990 am: 3732b76a96
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624039

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I41e016fa2cf4907905e3c4f9ab4dbc3d7c0ad418
2021-03-11 05:17:45 +00:00
Lorenzo Colitti
ab2f3d3cb5 Merge "Set extraInfo on cellular TestNetworkAgents." 2021-03-11 03:31:49 +00:00
Aaron Huang
0c39920728 Merge "Remove IBatteryStats from ConnectivityService module" am: f3827cf444 am: 433b9738b3 am: a100290e51
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1623262

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I58a89eee64c57fbf04e21ee0996eff435584f709
2021-03-11 03:08:13 +00:00
Aaron Huang
f3827cf444 Merge "Remove IBatteryStats from ConnectivityService module" 2021-03-11 02:04:41 +00:00
Lorenzo Colitti
ad4e8837af Set extraInfo on cellular TestNetworkAgents.
This makes the test more realistic, since telephony always puts
the APN name in the extraInfo field. It also makes it easy to
test that various APIs properly return the extra info without
plumbing a new parameter through TestNetworkAgentWrapper,
NetworkAgentWrapper, and InstrumentedNetworkAgent.

Also make the extraInfo and the legacyType available to tests.
This will be used in future tests that assert the contents of
extraInfo.

Bug: 181855958
Test: test-only change
Change-Id: If4eddb6cd9e70bb33e10d72aceebaea843244246
2021-03-10 23:33:08 +09:00
Chalard Jean
26453b1683 Merge "Fix a bug where listen callbacks would not be called" am: 3b50ce7a6f am: d7e0f35a90 am: 5962bf322b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620900

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I216167c2809ddc12e4a92faedf3bb4dc5c1a56cb
2021-03-10 02:37:36 +00:00
Chalard Jean
3b50ce7a6f Merge "Fix a bug where listen callbacks would not be called" 2021-03-10 00:32:58 +00:00
Remi NGUYEN VAN
579c8c0126 Merge "Add Ethernet, TestNetworkSpecifier API" into sc-dev 2021-03-09 22:43:46 +00:00
Aaron Huang
c3f79207ef Remove IBatteryStats from ConnectivityService module
Currently ConnectivityService calls the methods in
BatteryStatsService through BatteryStatsManager so
IBatteryStats can be removed from ConnectivityService.

Bug: 171686421
Test: FrameworksNetTests
Change-Id: I559369c9900e8100cdae187bc9cec603ed85a131
2021-03-09 21:39:17 +08:00
Zoey Chen
f619c9967d Merge changes from topic "PSL_TelephonyCallback"
* changes:
  [Telephony] Use TelephonyCallback instead of PhoneStateListener part1
  [PhoneStateListener] Redesign PhoneStateListener: Use TelephonyCallback
2021-03-09 10:36:03 +00:00
Aaron Huang
77ed87e072 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
Chalard Jean
d67ab4df87 Fix a bug where listen callbacks would not be called
NetworkAgentInfos cache the list of requests they satisfy,
and that list is used to send callbacks. Therefore, when
the TRACK_DEFAULTs are copied, this list needs to be
updated.

The best way to do this is to figure out what was the old
active request and find which requests corresponds to it
in the new list, and then upon registering adding the
active request to the relevant satisfier if present.

A few other ways can be considered like replacing the
request as it gets added, but this would temporarily
increase the number of callbacks allocated to the app
and risks crashing it for no good reason ; furthermore
the call to remove would have to be eschewed somehow
for those requests that are replaced. This is much
simpler.

Test: new test for this. This also passes the future
      tests for per-profile default network preference.
Change-Id: I001351e5c478c2c77cbf2844abca77b205291778
2021-03-09 19:05:55 +09:00
Remi NGUYEN VAN
6697878c6b Add Ethernet, TestNetworkSpecifier API
Rename StringNetworkSpecifier to EthernetNetworkSpecifier (its only
production user), and make it module-lib API.
The original StringNetworkSpecifier file is actually kept to satisfy
some invalid dependencies; it will be removed separately.

This allows specifying an Ethernet interface with a non-deprecated API:
until this change the only way to do so would be to use
NetworkRequest#setSpecifier(String), which is deprecated.

Similarly, add the TestNetworkSpecifier API for TestNetworkManager, to
replace previous usage of StringNetworkSpecifier. TestNetworkManager is
module API, so TestNetworkSpecifier should be module API too. This
allows tests to request the test interface specifically, without using
the deprecated NetworkRequest#setSpecifier(String).

Bug: 179329291
Test: m
Change-Id: Iee569f5c8bbdc4bc979610e1191308281f3d4620
2021-03-09 07:46:48 +00:00
Aaron Huang
e044c46257 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
Zoey Chen
dbc2df30cb [Telephony] Use TelephonyCallback instead of PhoneStateListener part1
Since the redesign of PhoneStateListener, use TelephonyCallback to get the callback of EVENT_*

Bug: 167684594
Test: make
Change-Id: Ia3b777b12142b104b5798804f50b34748f9bf28c
Merged-In: Ia3b777b12142b104b5798804f50b34748f9bf28c
2021-03-08 20:25:00 +08:00
Aaron Huang
dd92b6cf0d 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
2021-03-08 15:04:22 +08:00
James Mattis
c090ae6387 Merge "Applying OEM network pref to all users" am: 3f0925ee2e am: 00f75b0b32 am: 68fad37f38
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612760

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9988f9ecac19976dd78dbcf9a749adba5daa578c
2021-03-05 22:37:45 +00:00
James Mattis
3f0925ee2e Merge "Applying OEM network pref to all users" 2021-03-05 19:09:24 +00:00
Zoey Chen
c99db5dfd6 Merge "[Telephony] Use TelephonyCallback instead of PhoneStateListener part1" into sc-dev 2021-03-05 14:50:27 +00:00
Treehugger Robot
52ccd5b9dd Merge "[FUI22] Support getAllNetworkStateSnapshot" am: bcbc04f329 am: f216522f0f am: 54c1b0624f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I52f8339bd1cda35a3f26f28fd3c0165f6f6ff91e
2021-03-05 07:10:46 +00:00
Treehugger Robot
bcbc04f329 Merge "[FUI22] Support getAllNetworkStateSnapshot" 2021-03-05 05:16:43 +00:00
Janis Danisevskis
c410b053b9 Merge "Keystore 2.0: Make VPN Keystore 2.0 ready." 2021-03-05 02:57:34 +00:00
James Mattis
b4c62b8862 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
Merged-In: Iae1935944214efaa8a21636c55e6d8be816275f7
2021-03-04 13:13:48 -08:00
James Mattis
3bf8b7a1b9 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
d86b902b36 Merge changes Ie8d98359,I4d5cadfd am: 63383e755e am: 044ef2ba4e am: 010f29032c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612254

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7700b4ed9dd9105beb947944d63138330d8c565e
2021-03-04 14:51:09 +00:00
Treehugger Robot
63383e755e 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
5784080f24 [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
535b7b557c 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
9872e34c5c Merge "[FUI19] Migrate ConnectivityService to use NetworkStatsManager" am: f9d8415ef7 am: e301afdcfd am: 5a99734509
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1560408

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I48c92ae353490c05f1704b010b3c6f25505164c3
2021-03-04 05:06:53 +00:00
Junyu Lai
f9d8415ef7 Merge "[FUI19] Migrate ConnectivityService to use NetworkStatsManager" 2021-03-04 01:24:57 +00:00
Janis Danisevskis
0325b14121 Merge "Keystore 2.0: Make VPN Keystore 2.0 ready." into sc-dev 2021-03-03 22:28:41 +00:00
Sarah Chin
564ab64fab Merge "APIs for 5G slicing" 2021-03-03 18:42:20 +00:00
Treehugger Robot
333bb77a5f Merge "Extend timeout for receiving broadcasts" am: 08ef7ddaff am: 04707731d3 am: 132b0dcbad
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614339

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8ba4984427e72554c0aff2c173e72bdb93a9ea3c
2021-03-03 13:29:45 +00:00
junyulai
c9a235aadc [FUI19] Migrate ConnectivityService to use NetworkStatsManager
Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: Iaefd99f87ae96bc9d97d139bcd92a3fe8de917d2
2021-03-03 20:01:51 +08:00
Janis Danisevskis
42f77b882f 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
Change-Id: I27975113896ea137260a9f94a34fb1c3ca173fe3
2021-03-02 22:56:44 -08:00
Remi NGUYEN VAN
27ed37105b 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
Zoey Chen
78ca2ba3a7 [Telephony] Use TelephonyCallback instead of PhoneStateListener part1
Since the redesign of PhoneStateListener, use TelephonyCallback to get the callback of EVENT_*

Bug: 167684594
Test: make
Change-Id: Ia3b777b12142b104b5798804f50b34748f9bf28c
2021-03-03 13:25:54 +08:00
Sarah Chin
ce85c4c118 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
dc97407cfc Cleanup some of the PANS code
Test: FrameworksNetTests
Change-Id: I4d5cadfdd8e30a179948302e8c0c45f4d42b59ea
2021-03-03 14:16:21 +09:00
Paul Hu
e7c56922dc Merge "Use IDnsResolverUnsolicitedEventListener" am: 3503759a6f am: 3506a1b335 am: cf2e3208f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1542744

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifb6141adf3eeb096ac610e01a458d47492e68ea0
2021-03-03 02:22:31 +00:00
Paul Hu
3503759a6f Merge "Use IDnsResolverUnsolicitedEventListener" 2021-03-03 01:08:27 +00:00
Yan Yan
56c8a12db7 Merge "Support new IpSecAlgorithm AUTH_AES_CMAC" am: ca72617385 am: 7d67dda5c3 am: df431e094e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1579251

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2477f98c4aeaa6059944a204cc14db5b6fb5fc63
2021-03-02 21:35:55 +00:00
Treehugger Robot
62162a5b32 Merge "[FUI09] Expose NetworkStateSnapshot as system API" am: 7a593e640d am: d73af919b6 am: 2fd6d378c8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536708

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I41be29daeba58378ab374c346684a3d205f0d7c9
2021-03-02 21:10:48 +00:00
Treehugger Robot
49e0aa90b2 Merge "[FUI17] Migrate NetworkStatsService to use NetworkStateSnapshot" am: ebfdaa502f am: 15c7e774c2 am: c92d0ab048
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556553

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2207873ffb549f26026e33f14440be494e4b4175
2021-03-02 21:10:19 +00:00
Lucas Lin
2d939b27d4 Merge changes I35ed84fc,Ie6cfd77b,I4e4f929f,I751526e8 am: 51d01615d3 am: 25d2ee9e66 am: de7ef4ab0b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607733

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I54ef9fd59388908f38721671dd26f536fab719bb
2021-03-02 19:54:22 +00:00
Yan Yan
ca72617385 Merge "Support new IpSecAlgorithm AUTH_AES_CMAC" 2021-03-02 18:24:27 +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
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
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
paulhu
0a2aa80965 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