Commit Graph

12350 Commits

Author SHA1 Message Date
Lucas Lin
ee5644f6b5 Merge "Use ArraySet#add() instead of ArraySet#append()" am: 627c6a5258
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615181

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1991567f130f3afee6c6bcb78a9254b45e14f6e4
2021-03-09 05:31:26 +00:00
Lucas Lin
627c6a5258 Merge "Use ArraySet#add() instead of ArraySet#append()" 2021-03-09 04:52:42 +00:00
Remi NGUYEN VAN
37aa459906 Merge "Move OemNetworkPreferences to Connectivity" am: c61a6fc426
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620981

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9adc394b0c203cdb1045f50e83487ea0c2000632
2021-03-08 09:12:05 +00:00
Remi NGUYEN VAN
c61a6fc426 Merge "Move OemNetworkPreferences to Connectivity" 2021-03-08 08:41:04 +00:00
Paul Hu
cdb81da32c Merge "Replace Inet[4|6]Address#ANY" am: 3483a8be68
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615184

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I45cf2b37c775da158cdec2d3b7f50ac491d2fca8
2021-03-08 08:05:59 +00:00
Paul Hu
3483a8be68 Merge "Replace Inet[4|6]Address#ANY" 2021-03-08 07:20:21 +00:00
paulhu
ee4cd637e3 Replace Inet[4|6]Address#ANY
Connectivity is becoming a mainline module in S but mainline
modules are not allowed to use non-formal APIs. Thus, replace
non-formal API Inet[4|6]Address#ANY to
NetworkStackConstants#IPV[4|6]_ADDR_ANY.

Bug: 181756157
Test: FrameworksNetTests
Change-Id: Id4d2fc551c1384f549a586e87ab68356ba05b995
2021-03-08 07:18:31 +00:00
Frank Li
defaaf05a4 Merge "[CS10]Remove the hidden API usage of BitUtils" am: 02d57fc2ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615192

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia0dcd92a896a759e65ada070f16394db216b07b8
2021-03-08 02:14:44 +00:00
Remi NGUYEN VAN
9930f13c67 Move OemNetworkPreferences to Connectivity
The data class supports a ConnectivityManager API, so it should be
together with the ConnectivityManager API surface.

Bug: 181512874
Test: m
Change-Id: I5642486ea0febcb08cadcbd4cd3f0c6056deae0e
2021-03-08 09:26:41 +09:00
lifr
c33ea4de7d [CS10]Remove the hidden API usage of BitUtils
The connection service will become the main line module.
It is difficult to include BitUtils in the module. and so
Move the hidden API needed in BitUtils to NetworkCapabilitiesUtils.

Bug: 170598012
Test: atest ConnectivityServiceTest
      atest NetworkCapabilitiesTest
      atest DnsUtilsTest
Change-Id: Ibc81827e25a54fc3ff94f78d810fe4f5073e3a98
2021-03-06 16:21:16 +00:00
James Mattis
00f75b0b32 Merge "Applying OEM network pref to all users" am: 3f0925ee2e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612760

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id805612e7b807dd789c4ff88a933660fb11b12cf
2021-03-05 21:39:23 +00:00
James Mattis
3f0925ee2e Merge "Applying OEM network pref to all users" 2021-03-05 19:09:24 +00:00
Remi NGUYEN VAN
65982d493b Merge "Move NetworkState to Connectivity" am: 4d2ad2a68a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620379

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie8eda98704327d894b59c335753739600b87f670
2021-03-05 11:33:30 +00:00
Remi NGUYEN VAN
4d2ad2a68a Merge "Move NetworkState to Connectivity" 2021-03-05 10:27:57 +00:00
Aaron Huang
3c79f13642 Merge "Use NetworkCallback in BatteryStatsService to get connectivity change" am: 74850ac20e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574864

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If6fd08a8ba2bcbe4a955c245f49be517794f8a91
2021-03-05 07:45:53 +00:00
Aaron Huang
74850ac20e Merge "Use NetworkCallback in BatteryStatsService to get connectivity change" 2021-03-05 07:03:51 +00:00
Treehugger Robot
f216522f0f Merge "[FUI22] Support getAllNetworkStateSnapshot" am: bcbc04f329
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I70cbeb9d2b5b4cb2d09d31444b5d60e887b7e8c2
2021-03-05 05:53:33 +00:00
Remi NGUYEN VAN
4386582dd2 Merge "Replace user with debuggable check in ConnectivityService" am: a923322f24
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615085

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ieb729be68e810972506b1d8a3960dfc371a294b1
2021-03-05 05:50:47 +00:00
Chalard Jean
9b385fa220 Merge "Generalize some PANS methods" am: b639d79547
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612258

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7baa17a0f882ec21f766c9f7dc2c0694853fb467
2021-03-05 05:47:57 +00:00
Chiachang Wang
658a53ccef Merge "Have the DataConnectionStat started from BSS" am: 86dce50c72
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607895

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7f9e9d496c92e86609871c93a08b819b3704314f
2021-03-05 05:37:43 +00:00
Janis Danisevskis
d8fb75701d Merge "Keystore 2.0: Make VPN Keystore 2.0 ready." am: c410b053b9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1569502

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I97b24a5462f42773df919bd1d7acf9a9c5dcd43c
2021-03-05 05:17:12 +00:00
Treehugger Robot
bcbc04f329 Merge "[FUI22] Support getAllNetworkStateSnapshot" 2021-03-05 05:16:43 +00:00
Remi NGUYEN VAN
a923322f24 Merge "Replace user with debuggable check in ConnectivityService" 2021-03-05 05:09:46 +00:00
Treehugger Robot
a2229ce85b Merge "Fix CaptivePortalTest before R" am: 73e63132a6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1618939

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I29443e1af761cca33185638e5bd84771e0bc9192
2021-03-05 05:03:21 +00:00
Chalard Jean
b639d79547 Merge "Generalize some PANS methods" 2021-03-05 04:48:39 +00:00
Chiachang Wang
86dce50c72 Merge "Have the DataConnectionStat started from BSS" 2021-03-05 02:59:33 +00:00
Janis Danisevskis
c410b053b9 Merge "Keystore 2.0: Make VPN Keystore 2.0 ready." 2021-03-05 02:57:34 +00:00
Treehugger Robot
73e63132a6 Merge "Fix CaptivePortalTest before R" 2021-03-05 02:28:55 +00:00
Remi NGUYEN VAN
072b33fc6c Move NetworkState to Connectivity
NetworkState is becoming an internal implementation class, with
NetworkStateSnapshot replacing it as a proper API. Considering this it
belongs inside Connectivity.

Bug: 174123988
Test: m
Change-Id: I201f1a07c50d9da31e33f5c207875da8863ef57c
2021-03-05 08:56:55 +09: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
Chalard Jean
2a22bdeec6 Merge changes Ide2567b2,I0ee0ce92,Iac3f55af am: f0717a9ffe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612257

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic64d571ff8a1f2fdf6b15cde12c6b0a38b4a74b4
2021-03-04 13:18:57 +00:00
Treehugger Robot
044ef2ba4e Merge changes Ie8d98359,I4d5cadfd am: 63383e755e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612254

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3ec456b2f2fd88648461794dc2301a3825c3c155
2021-03-04 13:16:29 +00:00
Chalard Jean
9a3a0eac07 Generalize some PANS methods
These methods will be reused for 5G slicing and should
have a more generic name/signature.

This is a no-op refactoring.

Test: FrameworksNetTests
Change-Id: I13cf9fc405fef7dc650d5ea7df44d025f6713b46
2021-03-04 22:15:27 +09:00
Remi NGUYEN VAN
2c6d33f451 Replace user with debuggable check in ConnectivityService
IS_USER is a hidden symbol, whereas IS_DEBUGGABLE is part
of the module API.
The check is generally equivalent, as non-user builds are eng or
userdebug, which are debuggable.

Bug: 170598012
Change-Id: I7d09939652844eb2e3a6f0200b1ba50691a147da
Test: atest FrameworksNetTests
2021-03-04 13:12:34 +00:00
Chalard Jean
f0717a9ffe Merge changes Ide2567b2,I0ee0ce92,Iac3f55af
* changes:
  Fix a bug where callbacks would see blips
  Fix a bug where a request would not be refcounted
  Fix a bug where UID ranges would not be removed
2021-03-04 13:12:20 +00:00
Chalard Jean
018dbe4182 Fix a bug where callbacks would see blips
When a new OemPreference object is set, the requests
tracking that default will be re-created to track the
new default. This is true regardless of whether that
particular default has changed.

Because the new copied request doesn't know about the
old satisfier, the rematch code will mistakenly think
this callback didn't have a network and will send a
spurious onAvailable to it.

This patch fixes this by simply copying the satisfier
together with the rest of the NRI. The matching code
will then understand the correct previous status.

As a drive-by fix, this also fixes the annotations on
the reassignment contents that can be null. They have
more complex interactions (not everything can be null
at the same time), but the old annotations were just
putting @NonNull on nullable stuff.
In the same line, while there used to be a case with
a satisfier but no request when the satisfier is the
no-service network, there may now be a case where the
old satisfier is known but the old request isn't.

Test: FrameworksNetTests
Test: TODO : need a unit test for this
Change-Id: Ide2567b226722ea9d35ebd8205943363e27647a2
2021-03-04 13:11:59 +00:00
Chalard Jean
52d7b73c0d Fix a bug where a request would not be refcounted
This ends up crashing the system when the request
is unregistered, because the ref counter finds the
count associated with the relevant UID is zero.

Test: FrameworksNetTests
Test: TODO : this needs a new unit test
Change-Id: I0ee0ce925a826d35d8fd58cefb8a870e98ce9add
2021-03-04 22:08:09 +09:00
Chalard Jean
07dc18662a Fix a bug where UID ranges would not be removed
When a new preferences object is sent that no longer contains
a particular app, a new set of requests will be generated. All
requests corresponding to that app will be unregistered, and
no new ones will be filed since the preferences no longer
contain that app.

The place where the UID ranges are removed however is in
makeDefaultForApps(), which takes a request. As there no
longer is a default request for this app, makeDefaultForApps()
will never be called with a request for it, and the UID ranges
will never be removed.

This change applies an emergency fix with some side effects
when setting a new preference. This is acceptable, but should
ideally be fixed ; see TODO in the code for details.

Test: FrameworksNetTests
Test: TODO : Need a unit test for this
Change-Id: Iac3f55af5d00d174460e1d4cdd31f581835dbaa6
2021-03-04 22:08:09 +09:00
Aaron Huang
fdffbaecb4 Use NetworkCallback in BatteryStatsService to get connectivity change
Currently, battery stats service uses noteConnectivityChanged in
connectivity service(CS) to pass connection state and the type of
connection for BatteryStats. However, CS is going to be a mainline
module which can only access formal API. noteConnectivityChanged
is a hidden API and it pass LegacyNetworkType which has been
deprecated years ago, so it should avoid to expose this API with
a deprecated argument. Thus, register a NetworkCallback in
BattyeryStatsService to listen the network capabilities changed to
remove the noteConnectivityChanged from connectivity service.
Besides, let noteConnectivityChanged take display transport instead
of legacy network type.

Bug: 171686421
Test: atest FrameworksNetTests
      atest FrameworksCoreTests:BatteryStatsTests
(cherry-picked from ag/13749983)
Change-Id: I3dac94ec06f673aa719e124f1ef3d8169f68f9fb
Merged-In: I3dac94ec06f673aa719e124f1ef3d8169f68f9fb
2021-03-04 13:06:06 +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
Remi NGUYEN VAN
3fa91ba437 Fix CaptivePortalTest before R
The last change broke the test on Q and R. Fix it to check
Q and R behavior properly, so the test can be run in presubmit
on such devices too.

Bug: 181844595
Change-Id: I99847ea30d49d690d9011d4763a7345126807119
Test: atest CtsNetTestCasesLatestSdk
2021-03-04 10:45:02 +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
Chiachang Wang
feecccf308 Have the DataConnectionStat started from BSS
ConnectivityService is going to becoming a mainline module.
The DataConnectionStat is used to listen the telephony status
change and report to BSS. This does not really relate to
connectivity. DataConnectionStat was created in
ConnectivityService and use some hidden APIs which is not
allowed for a mainline module. Thus, move the creation and
monitor to BSS directly which is more appropriate place from
its functional perspective.

Also, move the DataConnectionStat out from module scope since
it does have too much relationship with connectivity module.

Bug: 171183530
Test: m ; verify the behavior with cellular state change
Change-Id: I0c2c1b90df7a107ee75e81fd49d39d65678204c0
Merged-In: I0c2c1b90df7a107ee75e81fd49d39d65678204c0
2021-03-04 16:21:25 +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
Treehugger Robot
fd5c00d173 Merge "Remove @hide CollectionUtils in QosCallbackTracker" am: e93b5d9bf3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612296

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icc65c4fb9c354b00ea98552021860170189ce15c
2021-03-04 05:02:00 +00:00
Treehugger Robot
e93b5d9bf3 Merge "Remove @hide CollectionUtils in QosCallbackTracker" 2021-03-04 04:22:18 +00:00
Aaron Huang
d99f67aaf6 Merge "Remove PersistableBundle(Bundle) usage from ConnectivityService" am: a1e34b2d6e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556097

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I56756f9e45baa506cb304bd6c560c4129df7417a
2021-03-04 04:04:25 +00:00
Aaron Huang
a1e34b2d6e Merge "Remove PersistableBundle(Bundle) usage from ConnectivityService" 2021-03-04 03:50:50 +00:00
Treehugger Robot
350f592cc9 Merge "Use Log instead of Slog in QosCallbackAgentConnection" am: 9c6d3c889f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614020

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0d5362567ab4c9f510582261ef365edfaabceaf5
2021-03-04 03:01:11 +00:00
Treehugger Robot
9c6d3c889f Merge "Use Log instead of Slog in QosCallbackAgentConnection" 2021-03-04 02:58:37 +00:00