565859 Commits

Author SHA1 Message Date
Chiachang Wang
f08d3d4359 Correct the logic in NetworkCapabilitiesTest
setOwnerUid() and setAdministratorUids() should run in R+.
Previous logic will skip them in S+. Correct the logic to
what it should be.

Bug: 172183305
Test: atest android.net.NetworkCapabilitiesTest
Change-Id: I46f7dab5eb50cbdcd58aa4c58f43829d10b6c3d8
2021-03-18 13:37:31 +00:00
Chiachang Wang
1b6c0b7a30 Merge changes from topic "replaceUidRange"
* changes:
  Expose uids related APIs in NetworkRequest and NetworkCapabilities
  Replace the usage of UidRange
2021-03-18 13:36:39 +00:00
Chiachang Wang
cf599f82fc Merge "Expose APIs for Settings" 2021-03-18 13:27:47 +00:00
Lorenzo Colitti
9794a9444e Merge "Add a VpnManager.TYPE_VPN_OEM." 2021-03-18 13:12:08 +00:00
Chalard Jean
0528521bea Use the NetworkScore API in VPN
Test: FrameworksNetTests
Change-Id: I72de86c0e58a2f2d01bc31c1a1afe640d48798b1
2021-03-18 12:32:26 +00:00
lucaslin
20ed872a17 Expose getCapabilities
Expose getCapabilities() for EthernetNetworkFactory.

Bug: 182963415
Test: m ethernet-service
Change-Id: I430416af8fae3d4ee99f2f2abe529e3051e9e5cb
2021-03-18 20:30:22 +08:00
Chalard Jean
b9650d8975 Merge "Address remaining comments on aosp/1607893" 2021-03-18 12:30:14 +00:00
Chalard Jean
410ab88177 Address remaining comments on aosp/1607893
Test: ConnectivityServiceTest
Change-Id: Icf70b20624604bfade37804311a77ef6be564c09
2021-03-18 12:30:00 +00:00
Chalard Jean
af1162983f Merge "Move constants to MODULE_LIB" 2021-03-18 12:29:38 +00:00
Paul Hu
f3d84f44de Merge "Add more connectivity module settings" 2021-03-18 12:22:55 +00:00
Remi NGUYEN VAN
2b97cb1d01 Add SystemMessages protos to Connectivity
This follows the model used for the same protos by the Wifi module in
service-wifi.

SystemMessageProto is used by NetworkNotificationManager to define IDs
for notifications that are also counted in system notification metrics.

Bug: 171860710
Test: m
Change-Id: Iec674913fad9ad59c04249714a08b5a0d8ab0f84
2021-03-18 20:04:52 +09:00
Sudheer Shanka
7dc302d612 Add an API to listen for changes in network blocked status of an uid.
Given that ConnectivityService is moving to a mainline module, we need
a @SystemApi for it to listen for changes in blocked status of an uid.
So, we decided to create a new API for this which can provide
ConnectivityService with more info about why an uid is blocked (which
will be useful for adding a new similar onBlockedStatusChanged callback
in CM.NetworkCallback) and also captures data saver restriction without
having out to track it separately.

Currently, NPMS does some redundant computations because we are
calculating both uid rules and blocked reasons separately. In a
follow-up change, we will compute uid rules using blocked reasons
and later possibly remove that onUidRulesChanged callback.

Bug: 176289731
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest ./tests/net/java/com/android/server/ConnectivityServiceTest.java
Test: atest ./services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
Change-Id: Ib9949b8619c6b148f73630b314c4113d76c31ec1
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
2021-03-18 10:42:25 +00:00
paulhu
01e4479247 Fix CS external dependencies on CarrierDefaultApp
- Use formal API getSystemService to get ConnectivityManager.
- Stop using setProcessDefaultNetworkForHostResolution(), it's
  only used for legacy API startUsingNetworkFeature() but
  CaptivePortalLoginActivity is used requestNetwork(). So remove
  it from CaptivePortalLoginActivity.

Bug: 183068713
Test: atest CarrierDefaultAppUnitTests
Change-Id: Ib3a5dcb70b71ec5b959aeb90a5e3596f3426ceb1
2021-03-18 14:50:24 +08:00
Lorenzo Colitti
4763300fab Add a VpnManager.TYPE_VPN_OEM.
This needed for OEMs that have VPN types not supported by AOSP.

Bug: 171872481
Test: new test coverage in VpnTransportInfoTest
Change-Id: Ic7529bef7f12d2c74a3be5b1a4a2d54fb0d0bfac
2021-03-18 05:54:53 +00:00
Ahaan Ugale
70e3812542 OWNERS for a few Voice Interaction files.
Change-Id: I8855c9bd420e0c1708ca4443e1acac038ec0082f
2021-03-18 05:14:00 +00:00
paulhu
7dbaa16b2c Add more connectivity module settings
Add more connectivity module settings and update all references
to ConnectivitySettingsManager.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: Ie96fbd0996ed3acb37099b6270bf3d4c2e558e9a
2021-03-18 11:58:29 +08:00
Remi NGUYEN VAN
0fcb8d6db4 Merge "Add framework-connectivity.impl" 2021-03-18 03:22:33 +00:00
Chiachang Wang
137fef06c7 Expose APIs for Settings
ConnectivityManager will be a part of incoming connectivity
mainline. Settings will no longer to access the hidden methods.
For those methods that accept the interaction from users, they
should be exposed as formal interface to allow the
functionality. Expose them to API surface.

Bug: 172183305
Test: make update-api
Change-Id: Id4533b94291766bb060af0091b5ccb81a00630fd
2021-03-18 11:18:56 +08:00
Zoey Chen
8eac3a3ff1 [Telephony] Return if context is null when register TelephonyCallback
Bug: 183064691
Test: make
Change-Id: Ic77a6085f05c942dcd7514bc78b7bfa46938ec38
2021-03-18 11:05:12 +08:00
Treehugger Robot
976a18e914 Merge "Replace hidden CM#isNetworkSupported() usage" 2021-03-18 02:39:21 +00:00
Kai Shi
857391f361 Add the LCE system API
Add the link capacity estimate system API.
Remove the system API of getCarrierBandwidth() and CarrierBandwidth as
they are replaced by the new LCE system API in PhoneStateListener.

Bug: 180434672
Bug: 176814680
Test: manual test of the new LCE system API in LinkBandwidthEstimator
Test: atest -c PhoneStateListenerTest

Merged-In: I5899acf02006a164e31f9b82aeaa7974dd6d2869
Change-Id: I5899acf02006a164e31f9b82aeaa7974dd6d2869
2021-03-17 18:56:11 -07:00
Remi NGUYEN VAN
a3648a387c Make isDataCapable a public API
There is no definitive API to determine whether a device supports mobile
data; this API fills the gap.

Bug: 146206136
Test: m
Change-Id: I5daa302063ee4e9c27dd9ba1a09d65af80ed9d99
2021-03-18 10:47:19 +09:00
Shuzhen Wang
3759c1623d Camera: Fix a removal-while-iterate bug
The onStatusChangedLocked removes entries from the ArrayMap. Needs to
iterate in the reverse order.

Test: Vendor testing
Bug: 182876702
Change-Id: I5891f24a25c83f096d23ca5675126889a7d2a61c
2021-03-17 16:56:43 -07:00
Chris Wailes
4313db2ab3 Update OWNERS file
This CL updates an OWNERS file to use an include directive instead of an
explicit list of owners.

Test: None
Change-Id: Ibea5a370c43f7b6d9d56275507cb9fb5e226da2a
2021-03-17 23:53:07 +00:00
Amit Mahajan
c2f06b0e63 Return 0 instead of throwing RuntimeException from getSmsCapacityOnIcc
Test: none
Bug: 170704921
Change-Id: I7d6985ab1aaf830c4560195189d01a661d478dbe
2021-03-17 15:43:57 -07:00
Andy Hung
dfb0754d31 Merge "SoundPool: Avoid busy waiting during stream restart" 2021-03-17 22:16:02 +00:00
Brad Ebinger
3dbd2a0063 Create new UCE shell commands for modifying PUBLISH for testing
Bug: 180033898
Test: Test commands using "adb shell cmd phone uce"
Merged-In: I6cda05b0540144e6d9199055fdca187f831c1479
Change-Id: I6cda05b0540144e6d9199055fdca187f831c1479
2021-03-17 21:39:40 +00:00
Jack Yu
79490a9c00 Merge "TelephonyRegistry: Pass featureId to LocationAccessPolicy" 2021-03-17 20:41:02 +00:00
Jeff Sharkey
58f7a60187 Merge "Expose VPN_UID" 2021-03-17 20:38:41 +00:00
Narayan Kamath
951ceccfd7 TelephonyRegistry: Pass featureId to LocationAccessPolicy
Bug: 162850073
Test: manual
Merged-In: I3a5afddfc151e06f5deb0220620bbd40849626c4
Change-Id: I3a5afddfc151e06f5deb0220620bbd40849626c4
(cherry picked from commit 923b6d86784d2109e6cd0953215c37d8cf460ee7)
2021-03-17 19:17:49 +00:00
Mohammad Samiul Islam
6a051228b0 Append root cause with error message while parsing APEX
Bug: 182409819
Test: manual
Change-Id: I30b1376f4d4738487e21a263f217777dc89949c4
2021-03-17 19:07:21 +00:00
Peter Collingbourne
7fe1ca63df Merge "Add support for a hw_timeout_multiplier system property." 2021-03-17 18:18:51 +00:00
Amit Mahajan
51937be778 Clarifying documentation for SliceInfo per API council feedback.
Test: none; documentation only change
Bug: 180125761
Change-Id: Ic26598802d0648e7a12ed0ec78c01afc1a72598f
2021-03-17 11:06:59 -07:00
Andy Hung
daa60c22d6 SoundPool: Avoid busy waiting during stream restart
A stream on the restart queue can cause the StreamManager to
busy-wait.  This was introduced by a fix
commit ba04dbe7732bc2d016bf81c81bd349d931de63f2.

Test: Verbose log on StreamManager.cpp, run SoundPool CTS tests.
Bug: 182923919
Merged-In: Iae794bc957869426a4e1e27cd3c088aa9dd83208
Change-Id: Iae794bc957869426a4e1e27cd3c088aa9dd83208
2021-03-17 10:45:07 -07:00
Treehugger Robot
89cbac790c Merge "Adding OWNERS to assets of device policy tests" 2021-03-17 17:28:27 +00:00
Benedict Wong
226af1dbfd Hide required underlying caps APIs
VCN underlying network capabilities should be transport-dependent in
order to allow using anything other than the INTERNET capability for
VCN types that support wifi offload. Specifically, if underlying
network capabilities are not transport-dependent, and Wifi only ever
supports the INTERNET capability, the VCN is unable to utilize wifi
offload together with requiring NET_CAPABILITY_IMS or
NET_CAPABILITY_CBS, since the IMS or CBS capability would be required
for both cellular and wifi underlying networks.

Until such time as a per-transport capability set is allowed, hide
the exposedCapability pieces, and document that all underlying networks
MUST have INTERNET capability in order to be used.

Bug: 182219992
Test: atest FrameworksVcnTests
Test: atest CtsVcnTestCases
Change-Id: I50d7f1be42e0e001f1413a3d5fe8aa4b7afec223
2021-03-17 10:26:21 -07:00
Janis Danisevskis
3194dc36b5 Keystore 2.0: Enable by default.
Keystore 2.0 is to replace Keystore. This patch removes
checking the keystore2 enable property and installs the Keystore 2.0 SPI
by default.

Bug: 171563717
Test: N/A
Merged-In: I13a3db8ca736cceb06e864457046ff9ca641322d
Change-Id: I13a3db8ca736cceb06e864457046ff9ca641322d
2021-03-17 08:47:28 -07:00
Remi NGUYEN VAN
6aa5d9862c Add framework-connectivity.impl
The library will be included in the connectivity module APEX when
migrating its sources out of framework-minus-apex.

Bug: 171540887
Test: m
Change-Id: I1595521eaced6e6997c076bb56b06ffdd22a4fa0
2021-03-18 00:29:08 +09:00
Chiachang Wang
c6b729eea8 Replace hidden CM#isNetworkSupported() usage
It's a refactor work for connectivity mainline module. The
hidden methods access is no longer allowed, so the usage for
isNetworkSupported() should be replaced. Settingslib use it to
check if device support telephony service. Use alternative
method to check if device supports such feature.

Bug: 172183305
Test: make RunSettingsLibRoboTests
Change-Id: I713c6410fcf9543d54d9b0057ed7b2ecdab201ee
Merged-In: I713c6410fcf9543d54d9b0057ed7b2ecdab201ee
2021-03-17 15:23:01 +00:00
Colin Cross
c4b72cd7ef Merge "Use stub-annotations to provide NonNull for hwbinder-stubs-docs" 2021-03-17 15:14:19 +00:00
Chiachang Wang
11403c6b1b Expose uids related APIs in NetworkRequest and NetworkCapabilities
NetworkRequest is moving into the incoming connectivity mainline
module. The hidden setUids becomes inaccessible outside the
module. Shims for support cts in different API levels will need
to use it to verify the behavior of NetworkRequest. Thus, expose
it to the API surface.

Also, VPN uses getUids and setUids to control network
capabilities. Networkcapabilities is a part of incoming
connectivity mainline module but VPN is not. Thus, exposing these
two methods are needed to allow VPN to continue using it.

Test: make update-api
Bug: 172183305
Change-Id: I107c329d4d7130d488772166eae8b5e7aaa2ff04
2021-03-17 23:13:39 +08:00
Chiachang Wang
e983de910b Replace the usage of UidRange
UidRange is used in a shared way between ConnectivityService
and VPN through the use of NetworkCapabilities. UidRange will
be part of the ConnectivityService mainline but Vpn.java will
stay in the framework. We need a way to replace the APIs using
UidRange, or to make UidRange system API. The only really
relevant surface here is NetworkCapabilities#{setUids, getUids}.
The need for UidRange could be replaced by an integer Range, so
replace the usage of UidRange by a integer Range in
NetworkCapabilities#{setUids, getUids} and update the relevant
callers.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9
2021-03-17 23:02:22 +08:00
Paul Hu
ef226d7a44 Merge "Add ConnectivitySettingsManager" 2021-03-17 14:57:32 +00:00
Remi NGUYEN VAN
5dad6d6e5b Merge "Remove Protocol.BASE_* usage in Connectivity" 2021-03-17 14:53:26 +00:00
Paul Hu
86203dde89 Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS" 2021-03-17 14:44:17 +00:00
Charles Chen
661351a645 Add OWNERS for ComponentCallbacksController
Bug: 181134729
Test: pre-upload check
Change-Id: I183c66c346b39ae6f731d197a0db31d00062ac7b
2021-03-17 22:27:20 +08:00
Yomna Nasser
1de59a9c59 Implementation of "Enable 2G" for Settings.
(1) Adds KEY_HIDE_ENABLE_2G_BOOL to CarrierConfigManager, and
(2) Adds new reason ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G.

Test: manual & atest -c Enable2gPreferenceControllerTest
Bug: b/163168917
Change-Id: I81052549f8dde491697c35365320145fd24c3842
Merged-In: I81052549f8dde491697c35365320145fd24c3842
2021-03-17 20:21:21 +08:00
Remi NGUYEN VAN
6a9a35c438 Merge "Remove extra comment" 2021-03-17 12:16:09 +00:00
Remi NGUYEN VAN
4ea08c2ab4 Remove Protocol.BASE_* usage in Connectivity
ConnectivityManager and NetworkAgent do not share their handler with any
other component, so there is no reason to use addresses that do not
overlap. Protocol.BASE_* was written to allow for interaction "between
different StateMachine implementations without a conflict", but the
classes do not use StateMachine, and they do not have such interactions.

Bug: 177046265
Test: atest FrameworksNetTests
Change-Id: I18c341d4a2c01cb9559d682a9ad1ff259e6b5855
2021-03-17 20:56:50 +09:00
Lucas Lin
f87b8a02a7 Merge "Modify the comment of getPrivateDnsMode" 2021-03-17 11:25:18 +00:00