Commit graph

13,045 commits

Message SHA1
Merge "Fix CaptivePortalTest before R"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-05 02:28:55 +00:00
73e63132a6
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

Remi NGUYEN VAN   commited 2021-03-05 08:56:55 +09:00
072b33fc6c
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

James Mattis   commited 2021-03-04 11:32:10 -08:00
3bf8b7a1b9
Using jniThrowErrnoException in android_net_NetworkUtils
Since libnativehelper now has an implementation of jniThrowErrnoException,
this method is now used when a system error occurs to avoid code
duplication.

Bug: 180958753
Test: m
Change-Id: I7752fb57e773bc61b47eac8d91695571257ee5b7

Sorin Basca   commited 2021-03-04 15:29:22 +00:00
2471c17965
Merge changes Ide2567b2,I0ee0ce92,Iac3f55af am: f0717a9ffe am: 2a22bdeec6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612257

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I28ac065b0574c94c8d8b0dfabaf15db0694b4f90

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-04 13:46:18 +00:00
e585766e12
Merge changes Ie8d98359,I4d5cadfd am: 63383e755e am: 044ef2ba4e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612254

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icbc9b89121bcb09fde41deb3f71322005b1ea2ed

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-04 13:46:09 +00:00
010f29032c
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

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-04 13:18:57 +00:00
2a22bdeec6
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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-04 13:16:29 +00:00
044ef2ba4e
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

Chalard Jean   commited 2021-03-04 22:15:27 +09:00
9a3a0eac07
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

Remi NGUYEN VAN   commited 2021-03-04 13:12:34 +00:00
2c6d33f451
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

Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-04 13:12:20 +00:00
f0717a9ffe
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

Chalard Jean   commited 2021-03-04 13:11:59 +00:00
018dbe4182
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

Chalard Jean   commited 2021-03-04 22:08:09 +09:00
52d7b73c0d
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

Chalard Jean   commited 2021-03-04 22:08:09 +09:00
07dc18662a
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

Aaron Huang   commited 2021-03-04 13:06:06 +00:00
fdffbaecb4
Merge changes Ie8d98359,I4d5cadfd
* changes:
  Fix a bug in RequestReassignment#toString
  Cleanup some of the PANS code

Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-04 12:39:04 +00:00
63383e755e
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

Remi NGUYEN VAN   commited 2021-03-04 10:45:02 +00:00
3fa91ba437
[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

junyulai   commited 2021-03-04 18:41:09 +08:00
5784080f24
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

Chiachang Wang   commited 2021-03-04 16:21:25 +08:00
feecccf308
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

Janis Danisevskis   commited 2021-03-03 22:14:41 -08:00
535b7b557c
Merge "Remove @hide CollectionUtils in QosCallbackTracker" am: e93b5d9bf3 am: fd5c00d173
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612296

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8596a13bd869c8b2a26eefc1b8e30e7334b72f98

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-04 06:11:58 +00:00
e2fb23858f
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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-04 05:02:00 +00:00
fd5c00d173
Merge "Remove PersistableBundle(Bundle) usage from ConnectivityService" am: a1e34b2d6e am: d99f67aaf6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556097

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I07b7071eaedad69cac1908a872941a31002cefd0

Aaron Huang   authored and   Automerger Merge Worker   commited 2021-03-04 04:23:54 +00:00
92131bfd78
Merge "Use Log instead of Slog in QosCallbackAgentConnection" am: 9c6d3c889f am: 350f592cc9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614020

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iad988b171f6871e728381fa046f03765391bf5fd

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-04 04:22:51 +00:00
c508365b28
Merge "Address comments on aosp/1612040." am: 0f6df3ba7d am: d0a19e01c1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1613962

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I292f206377968a10052e0759d26819583e164b5a

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-04 04:22:37 +00:00
95340c3e69
Merge "[CS05]Remove the hidden API usage of MetricsLogger" am: 6ef08c36a7 am: c5ed4d8124
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612039

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I34df69bec5ee2bab2b8fd4e366f4d3967b471fd5

Frank Li   authored and   Automerger Merge Worker   commited 2021-03-04 04:22:20 +00:00
e4bb3866d8
Merge "Remove @hide CollectionUtils in QosCallbackTracker"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-04 04:22:18 +00:00
e93b5d9bf3
Merge "[FUI19] Migrate ConnectivityService to use NetworkStatsManager" am: f9d8415ef7 am: e301afdcfd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1560408

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic41c4c6c923dea2a21ce7f4602e628743527b735

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-03-04 04:22:06 +00:00
5a99734509
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

Aaron Huang   authored and   Automerger Merge Worker   commited 2021-03-04 04:04:25 +00:00
d99f67aaf6
Merge "Remove PersistableBundle(Bundle) usage from ConnectivityService"
Aaron Huang   authored and   Gerrit Code Review   commited 2021-03-04 03:50:50 +00:00
a1e34b2d6e
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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-04 03:01:11 +00:00
350f592cc9
Merge "Use Log instead of Slog in QosCallbackAgentConnection"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-04 02:58:37 +00:00
9c6d3c889f
Merge "Address comments on aosp/1612040." am: 0f6df3ba7d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1613962

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id3ad9eb4cf16d37cddfaece70b4f72755fd4e3a2

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-04 02:56:42 +00:00
d0a19e01c1
Merge "[CS05]Remove the hidden API usage of MetricsLogger" am: 6ef08c36a7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612039

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8de53ff3755ae4f15bdaf1b4f6dbd1850e99ed94

Frank Li   authored and   Automerger Merge Worker   commited 2021-03-04 02:52:52 +00:00
c5ed4d8124
Merge "[FUI19] Migrate ConnectivityService to use NetworkStatsManager" am: f9d8415ef7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1560408

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I90895f9109aaa2fbe8d76b1b7904dff9d09cb512

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-03-04 02:42:52 +00:00
e301afdcfd
Merge "Address comments on aosp/1612040."
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-04 02:04:36 +00:00
0f6df3ba7d
Replace withCleanCallingIdentity with [clear|restore]CallingIdentity
To prevent using @hide method - withCleanCallingIdentity() from
mainline module, use clearCallingIdentity() &
restoreCallingIdentity() instead.

Bug: 172183305
Test: FrameworksNetTests, CtsNetTestCasesLatestSdk
Change-Id: I8221bb8717ba6809c5087ea2808cd4ccef948cfd

lucaslin   commited 2021-03-04 09:38:21 +08:00
9cc04196e9
Merge "[CS05]Remove the hidden API usage of MetricsLogger"
Frank Li   authored and   Gerrit Code Review   commited 2021-03-04 01:34:53 +00:00
6ef08c36a7
Use ArraySet#add() instead of ArraySet#append()
ArraySet#append() is a hidden API which is not accessible for
mainline module, use public one - ArraySet#add() instead.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I0742e2ec7aff008141b1de6d10eeca2910df71b1

lucaslin   commited 2021-03-04 09:29:30 +08:00
eda1a92ae9
Merge "[FUI19] Migrate ConnectivityService to use NetworkStatsManager"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-03-04 01:24:57 +00:00
f9d8415ef7
[automerger skipped] Merge "Merge RQ2A.210305.007" am: dd3848d115 -s ours am: 6524622d0f -s ours
am skip reason: Change-Id I2958205678f4340e96ce6e845718e994a0231afc with SHA-1 9882ff4bf8 is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1613627

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4f023fd4fe72b6254cf51af02ca8bd5967e49549

Xin Li   authored and   Automerger Merge Worker   commited 2021-03-03 23:37:15 +00:00
7ecf2cf1a7
[automerger skipped] Merge "Merge RQ2A.210305.007" am: dd3848d115 -s ours
am skip reason: Change-Id I2958205678f4340e96ce6e845718e994a0231afc with SHA-1 9882ff4bf8 is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1613627

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I05ab53a6a483b8e4dbe40afe6dab40e2b7d328ea

Xin Li   authored and   Automerger Merge Worker   commited 2021-03-03 22:35:44 +00:00
6524622d0f
Merge "Merge RQ2A.210305.007"
Xin Li   authored and   Gerrit Code Review   commited 2021-03-03 21:41:39 +00:00
dd3848d115
Merge "APIs for 5G slicing" am: 564ab64fab am: 33315832c8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1593931

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1232091caedbe49009667c5f34af543bb5c5be07

Sarah Chin   authored and   Automerger Merge Worker   commited 2021-03-03 19:29:48 +00:00
2281c116ad
Merge "Adding additional docs for OemNetworkPreferences" am: f13bcb0899 am: f2c389c4c5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1606593

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0a4cff353357a270f126a74d2648de755c64a6ee

James Mattis   authored and   Automerger Merge Worker   commited 2021-03-03 19:04:06 +00:00
3ce5c55680
Merge "APIs for 5G slicing" am: 564ab64fab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1593931

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4d2a9cd1442a1bd0f194d5bb2b17f98c3f29e747

Sarah Chin   authored and   Automerger Merge Worker   commited 2021-03-03 18:59:57 +00:00
33315832c8
Merge "APIs for 5G slicing"
Sarah Chin   authored and   Gerrit Code Review   commited 2021-03-03 18:42:20 +00:00
564ab64fab
Merge "Adding additional docs for OemNetworkPreferences" am: f13bcb0899
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1606593

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I947176ec2f71fcddb7bc432b23917eef219562f3

James Mattis   authored and   Automerger Merge Worker   commited 2021-03-03 18:24:33 +00:00
f2c389c4c5
Merge "Adding additional docs for OemNetworkPreferences"
James Mattis   authored and   Gerrit Code Review   commited 2021-03-03 17:25:01 +00:00
f13bcb0899
[FUI19] Migrate ConnectivityService to use NetworkStatsManager
Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: Iaefd99f87ae96bc9d97d139bcd92a3fe8de917d2

junyulai   commited 2021-03-03 20:01:51 +08:00
c9a235aadc