565992 Commits

Author SHA1 Message Date
David Zeuthen
b0a08c82bc Merge "PackageManager: Add FEATURE_HARDWARE_KEYSTORE, modify FEATURE_STRONGBOX_KEYSTORE." 2021-03-25 18:27:48 +00:00
Peter Wang
e00d2b03f3 Merge "[API Review] Change ACTION_MANAGE_ALL_SIM_PROFILE_SETTINGS API" 2021-03-25 17:47:07 +00:00
Lorenzo Colitti
8cbf5883ff Add unit tests for onBlockedStatusChanged(Network, int).
Bug: 165835257
Test: atest FrameworksNetTests
Change-Id: I0597df71aa94817835d7a2fb54bfcf9222a34b64
2021-03-26 02:37:20 +09:00
Lorenzo Colitti
5ab70251e8 Add onBlockedStatusChanged(Network, int) to NetworkCallback.
This is similar to onBlockedStatusChanged(Network, boolean) but
it allows the callback holder to know the exact reason why
networking was blocked. It is useful to privileged system
components such as JobScheduler that are able to ignore some
blocked reasons but not others.

Also add a new BLOCKED_REASON_LOCKDOWN_VPN that is used when
networking is blocked because an always-on VPN is in
lockdown mode.

Also move BLOCKED_METERED_REASON_MASK to ConnectivityManager.
This is necessary because ConnectivityService must ensure that
the blocked status callbacks are correctly sent when meteredness
changes (e.g., a UID that is blocked on metered networks will
become unblocked on a network that becomes unmetered). In order
to do this it needs to know which reasons apply only on metered
networks.

Bug: 165835257
Test: unit tests in subsequent CLs in the stack
Change-Id: I647db4f5a01280be220288e73ffa85c15bec9370
2021-03-26 02:37:19 +09:00
paulhu
6a29f472bf Add MOBILE_DATA_PREFERRED_APPS setting
This setting is OEM upstream requirement for mobile data
preferred apps feature.

Bug: 171872461
Test: atest FrameworksNetTests
Merged-In: Ic5e0515b2b948de3d333c8d8e073d0b15514562a
Change-Id: Iba17bf68cffbe39d1c08ad94364b41bbf851bf57
2021-03-26 02:37:19 +09:00
paulhu
5dfacdee51 Add PRIVATE_DNS_MODE setting setter
Bug: 182538166
Test: atest FrameworksNetTests
Merged-In: If234426f041606c4881de1eca31b6f5bdb3c6bfe
Change-Id: Iaa9e6cc92f1805ab341c308fc60e947ec4c674f0
2021-03-26 02:37:16 +09:00
Treehugger Robot
44008b63fb Merge "Create a new permission to override Overridable change ids" 2021-03-25 17:35:45 +00:00
paulhu
1108c1299c Expose ConnectivitySettingsManager as module-lib API
Have getter/setter methods for external modules that can
get/set the setting values.

Bug: 182538166
Test: atest FrameworksNetTests
Merged-In: I82225a43f95e3e1d3e52c4e7a0fc541c0087292e
Change-Id: I61cb00216494e35b6e0dfe444b177cad36ad8afb
2021-03-26 02:35:07 +09:00
Jayachandran Chinnakkannu
301abd2ef8 Merge "Fix QOS API review comments" 2021-03-25 16:08:44 +00:00
Benjamin Franz
229b809643 Create a new permission to override Overridable change ids
With this change we allow system packages with the new permission to
override ChangeIds specifically annotated as Overridable to set
overrides even on non-debuggable builds.

Bug: 174043039
Bug: 175874108
Test: atest FrameworksServicesTests:CompatConfigTest
Test: atest FrameworksServicesTests:PlatformCompatTest
Change-Id: Ib8d5d83b5fd62acb5808d10f5c413616f29ee65c
Merged-In: Ib8d5d83b5fd62acb5808d10f5c413616f29ee65c
2021-03-25 16:07:32 +00:00
Jay Patel
9575e87746 Merge "Remove pending actions when standby" 2021-03-25 14:34:57 +00:00
David Zeuthen
d9cbeba041 PackageManager: Add FEATURE_HARDWARE_KEYSTORE, modify FEATURE_STRONGBOX_KEYSTORE.
These feature flags will hold the KeyMint version for the default and
StrongBox HALs. They can be used by apps to convey that they'll only
work on devices which have a recent enough version of KeyMint.

For example, if an application requires ECDH to be implemented in
Secure Hardware it can convey this requirement by indicated that it
needs FEATURE_HARDWARE_KEYSTORE >= 100. Or if it needs this in the
StrongBox it can use FEATURE_STRONGBOX_KEYSTORE >= 100. As with other
feature flags, this can be used to only show the app on devices which
satisfy such requirements.

Test: Compiles
Bug: 160616951
Change-Id: I582e50fba92de0d598d7e86fcc3b1b2b4a91b103
2021-03-25 09:38:42 -04:00
Chiachang Wang
6e55574e2b Merge "Add network created callback support" 2021-03-25 13:22:17 +00:00
Selim Cinek
63863a9a2b Updating owners of SystemUI
Bug: N/A
Change-Id: Iab923d09542447869d19b63326af2ec156900337
Test: ensure new owners work
2021-03-25 13:07:36 +00:00
Lucas Lin
c0e7ab7c3e Merge "Move FullScore to connectivity mainline module" 2021-03-25 11:30:05 +00:00
Lucas Lin
8db8d890a0 Merge "Add annotation for Vpn#getNetwork()" 2021-03-25 11:29:38 +00:00
Lucas Lin
cf1dc9f287 Merge "Remove the usage of NETID_UNSET from Vpn.java" 2021-03-25 11:29:17 +00:00
Lucas Lin
f43adf215e Merge "Expose some APIs from ConnectivityManager" 2021-03-25 11:29:08 +00:00
Lucas Lin
93b20febd4 Merge "Remove the usage of hidden API - setIsAvailable() from Vpn" 2021-03-25 11:29:04 +00:00
Lucas Lin
1ff9b10f74 Merge changes Ic2357dcf,Iddf8c71a
* changes:
  Expose NetworkAgent constructor taking a NetworkScore parameter
  Expose NetworkScore to external caller
2021-03-25 11:28:28 +00:00
Lucas Lin
276f8e6a70 Merge changes I6d5dd0a8,I106b3e4f
* changes:
  Use public API Network#getNetId() to get netid
  Remove unused import IConnectivityManager
2021-03-25 10:49:35 +00:00
lucaslin
c3f7c8fd3c Use public API Network#getNetId() to get netid
Network class will be a part of mainline module, external callers
cannot call its hidden constant. Use public API - getNetId() to
get netid instead.

Bug: 182963397
Test: m
Change-Id: I6d5dd0a8c3879df7bdc1d58e36022045c303bb40
Merged-In: I6d5dd0a8c3879df7bdc1d58e36022045c303bb40
  (cherry-picked from ag/13927649)
2021-03-25 10:48:55 +00:00
Lucas Lin
c4c056b647 Merge "Use getAllInterfaceNames to get all interface names" 2021-03-25 10:44:51 +00:00
lucaslin
36705517ed Remove the usage of hidden API and simplify the design
- ConnectivityManager will be a part of mainline module, so its
hidden API cannot be called by external caller.
- There is no need to listen onNetworkSuspended() and
onNetworkResumed() because if the network is suspended, then
NET_CAPABILITY_NOT_SUSPENDED will be removed and
onCapabilitiesChanged() will be called and the network capabilities
will be different from the previous one. And when the network is
resumed, NET_CAPABILITY_NOT_SUSPENDED will be added back to the
network capabilities. So the current design can be simplified.

Bug: 182963397
Test: atest FrameworksVcnTests
Change-Id: Ib8f8ea1c95503c946b8229670512af2db8be3165
Merged-In: Ib8f8ea1c95503c946b8229670512af2db8be3165
  (cherry-picked from ag/13927656)
2021-03-25 10:29:27 +00:00
Chiachang Wang
9e1aba45a1 Add network created callback support
Create a network callback to notify network agent after
netd has created the network, so that the NetworkAgent may
wait for this callback and ensure the pre-work to communicate
with netd completed.

Bug: 178725261
Test: make update-api
Change-Id: I8c2ff7bd6980ae838abc5669f9419d62741b8666
Merged-In: I8c2ff7bd6980ae838abc5669f9419d62741b8666
2021-03-25 18:27:24 +08:00
lucaslin
6642bda243 Remove unused import IConnectivityManager
Bug: 182963397
Test: m
Change-Id: I106b3e4f68b4e5610a238931aa3e81afdd927422
Merged-In: I106b3e4f68b4e5610a238931aa3e81afdd927422
  (cherry-picked from ag/13921812)
2021-03-25 10:22:40 +00:00
lucaslin
fbb3787f53 Add annotation for Vpn#getNetwork()
- Add @VisibleForTesting & @Nullable for Vpn#getNetwork().
- Remove null check in caller side(test) of Vpn#getNetwork()
because if the code is working properly, it can never be null.

Bug: 182963397
Test: atest FrameworksNetTests
Change-Id: Ic52864003fbebd9f4e95d43fefc2e168437b0122
Merged-In: Ic52864003fbebd9f4e95d43fefc2e168437b0122
  (cherry-picked from ag/13946573)
2021-03-25 10:21:07 +00:00
lucaslin
737100e979 Remove the usage of NETID_UNSET from Vpn.java
Modify Vpn#getNetId() to Vpn#getNetwork() and uses NETID_UNSET
when getNetwork() returns null in ConnectivityServiceTest.

Bug: 182963397
Test: atest FrameworksNetTests
Change-Id: I69d449705b1dc541287c72af8dc7705dc4733109
Merged-In: I69d449705b1dc541287c72af8dc7705dc4733109
  (cherry-picked from ag/13927650)
2021-03-25 10:19:05 +00:00
lucaslin
3ebced3e17 Add static for constant
Bug: 182963397
Test: atest IpConnectivityMetricsTest
Test: atest NetdEventListenerServiceTest
Change-Id: I3826b9efc3418a724bd3753b9ad573adc3343b72
Merged-In: I3826b9efc3418a724bd3753b9ad573adc3343b72
  (cherry-picked from ag/13975513)
2021-03-25 10:16:34 +00:00
lucaslin
4431929829 Get NetworkCapabilities from NetworkCallback
Register network callback for all networks and record
NetworkCapabilities for every networks. Once onDnsEvent is
triggered, use the netId it passes in to find the corresponding
NetworkCapabilities instead of using netId to create a Network
object(hidden API) then get the NetworkCapabilities by
ConnectivityManager#getNetworkCapabilities.

Bug: 182963397
Test: m
Test: atest IpConnectivityMetricsTest
Test: atest NetdEventListenerServiceTest
Change-Id: I91d68ca33253831b78def1ddeb074ba944a5d6ad
Merged-In: I91d68ca33253831b78def1ddeb074ba944a5d6ad
  (cherry-picked from ag/13959432)
2021-03-25 10:16:20 +00:00
lucaslin
35a1c7fc3c Move FullScore to connectivity mainline module
Bug: 182963397
Test: m
Change-Id: I1ae795aa55afad1a2a74333cea52e4dcc3abc35a
Merged-In: I1ae795aa55afad1a2a74333cea52e4dcc3abc35a
  (cherry-picked from ag/13947597)
2021-03-25 09:48:49 +00:00
Chiachang Wang
4e0db4bb65 Expose NetworkAgent constructor taking a NetworkScore parameter
Vpn constructs NetworkAgent with this exposed NetworkAgent
constructor. Given NetworkAgent is moving into the incoming
connectivity module, Vpn which is outside the module will not
be able to access it if it's not in the API surface. Thus,
expose it to allow Vpn to use it.

Bug: 182963397
Test: make update-api
Change-Id: Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa
Merged-In: Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa
CTS-Coverage-Bug: 172183305
  (cherry-picked from ag/13966707)
2021-03-25 08:40:27 +00:00
lucaslin
5aea42137f Expose NetworkScore to external caller
NetworkScore will be a part of mainline module, so the external
callers cannot call its hidden APIs. Expose needed APIs to
the external callers.

CTS-Coverage-Bug: 182963397
Bug: 182963397
Test: m
Change-Id: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
Merged-In: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
  (cherry-picked from ag/13947595)
2021-03-25 08:15:09 +00:00
lucaslin
03005f9e0c Use getAllInterfaceNames to get all interface names
The current design is using hidden API - getStackedLinks() to
get LinkProperties then call getInterfaceName() to get the
interface name. In fact, this behavior could be replaced by
system API - getAllInterfaceNames().

Bug: 182963397
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Change-Id: Id2b19dc5099355af69d23a6d99d2b7e6c0e1e88a
Merged-In: Id2b19dc5099355af69d23a6d99d2b7e6c0e1e88a
  (cherry-picked from ag/13927660)
2021-03-25 08:10:28 +00:00
lucaslin
c51dc08958 Expose some APIs from ConnectivityManager
- Expose setRequireVpnForUids to Vpn.java
- Expose setLegacyLockdownVpnEnabled to LockdownVpnTracker.java
- Expose requestRouteToHostAddress to
  GnssNetworkConnectivityHandler.java

Bug: 182963397
Test: m
Change-Id: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c
Merged-In: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c
  (cherry-picked from ag/13927657)
2021-03-25 08:07:53 +00:00
lucaslin
8a96b31b4c Remove the usage of hidden API - setIsAvailable() from Vpn
In fact, NetworkAgent#getLegacyNetworkInfo() will call this API,
so VPN doesn't need to call it.
Remove the redundant behavior and the usage of hidden API.

Bug: 182963397
Test: m
Change-Id: I3b88f22fffde3dd4000d28342ed07209c7121a37
Merged-In: I3b88f22fffde3dd4000d28342ed07209c7121a37
  (cherry-picked from ag/13929100)
2021-03-25 08:00:49 +00:00
Dorin Drimus
2af1306a77 Merge "Adapt first time VPN connection warning to TV form factor" 2021-03-25 05:27:57 +00:00
Jayachandran C
eb1bdda971 Fix QOS API review comments
Bug: 155176305
Bug: 182317794
Test: atest ConnectivityServiceTest
      atest QosCallbackTrackerTest
Change-Id: I234318d6f32179ef3b79b3a480faf52b620fe58e
2021-03-25 04:42:35 +00:00
Treehugger Robot
201c39ba90 Merge "media: make ParameterDescriptor static" 2021-03-25 03:16:34 +00:00
Treehugger Robot
066cd28370 Merge "Fix null pointer exception if USBPort is removed" 2021-03-25 03:14:45 +00:00
Treehugger Robot
cdf9e7ef43 Merge "Remove BluetoothHeadset#setPriority which was deprecated in Android 11" 2021-03-25 02:43:05 +00:00
Charles Chen
7c58c18223 Make wm to own protolog JSON file
This file is used in protolog mechanism, a log system in WM packages.
WM should take the ownership.

Test: repohook check
fixes: 183642152
Change-Id: I39214156964017241562c07c3fc9a9fb7e80d0cb
2021-03-25 10:29:38 +08:00
Harpreet "Eli" Sangha
bef37a3dc8 Merge "UWB: Annotate AngleMeasurement Parameters" 2021-03-25 02:06:52 +00:00
junyulai
59b0a621e7 [SP31] Expose onSetWarningAndLimit System API
Test: atest NetworkPolicyManagerServiceTest NetworkStatsServiceTest
Bug: 149467454
CTS-Coverage-Bug: 183598414
Merged-In: I6f5e22e3a7b80a38cae9f3c5d7296a1dff34facf
Change-Id: I6f5e22e3a7b80a38cae9f3c5d7296a1dff34facf
  (cherry-picked from ag/13981689)
2021-03-25 09:32:43 +08:00
Treehugger Robot
565f1a95bd Merge "Use a longer test timeout in integration test" 2021-03-25 01:24:51 +00:00
junyulai
2c685749fa [SP29] Send interface warning bytes to NetworkStatsProvider
This change contains necessary modification in NPMS and NSS
to send warning bytes to NetworkStatsProvider. But since
no any provider has been upgraded to handle such parameter.
Thus, no behavior change is made in this patch.

Test: atest NetworkPolicyManagerServiceTest NetworkStatsServiceTest
Test: atest NetworkPolicyManagerServiceTest#testStatsProviderWarningAndLimitReached
Bug: 149467454
Bug: 170699770
Bug: 170179169
Merged-In: I6c4863030c36328db571294fd12a40e59864def5
Change-Id: I6c4863030c36328db571294fd12a40e59864def5
  (cherry-picked from ag/13982166)
2021-03-25 09:23:24 +08:00
Rambo Wang
92f92c7ce0 Merge "Redact location info from PhysicalChannelConfig" 2021-03-25 00:43:25 +00:00
John Reck
b9682da963 Add me to view/ OWNERS
Test: none
Change-Id: I254a8cc3cdf073f5c4487ebf96fbbfafa8c83134
2021-03-24 20:37:42 -04:00
Max Bires
e7f48b9926 Merge "Adding AIDL and functions for talking to RemoteProvisioner" 2021-03-25 00:03:09 +00:00
Wonsik Kim
f65fcbdbbd media: make ParameterDescriptor static
Bug: 183242434
Test: builds
Change-Id: Ifed0209d36f6d40b0a9fb95008b74eff5c96c742
2021-03-24 16:04:41 -07:00