Commit Graph

110149 Commits

Author SHA1 Message Date
Treehugger Robot
55fe87b2f6 Merge changes from topic "bluetooth_oob_api"
* changes:
  Fix CTS Failure
  Bluetooth: Modify and append to the Out-of-Band API
2021-03-19 21:13:18 +00:00
Shuzhen Wang
171249e857 Merge "Camera: Fix a removal-while-iterate bug" 2021-03-19 18:34:00 +00:00
SongFerng Wang
3ccc2738e2 Merge "Implementation of "Enable 2G" for Settings." 2021-03-19 13:09:55 +00:00
Treehugger Robot
66794f915f Merge "Reland "Add an API to listen for changes in network blocked status of an uid."" 2021-03-19 10:12:15 +00:00
Remi NGUYEN VAN
7e26e33269 Merge "Add TEST_NETWORK_SERVICE to module API" 2021-03-19 02:32:00 +00:00
Remi NGUYEN VAN
2bf4c58ceb Add TEST_NETWORK_SERVICE to module API
TestNetworkManager is being unbundled; the TEST_NETWORK_SERVICE constant
is necessary for the module to register the manager with
registerContextAwareService.

Bug: 171540887
Test: m
Change-Id: I0690251ddfcdaa8a34830e110b75869a370de389
Merged-In: I0690251ddfcdaa8a34830e110b75869a370de389
2021-03-19 00:04:24 +00:00
Remi NGUYEN VAN
c9f553c7ed Merge "Move network selection utils to Connectivity" 2021-03-18 23:57:34 +00:00
Kai Shi
26ba4d0d09 Merge "Add the LCE system API" 2021-03-18 21:23:34 +00:00
Sudheer Shanka
da90e7a2bb Reland "Add an API to listen for changes in network blocked status of an uid."
This reverts commit 8623f2b3ca.

Reason for revert: The issue causing the build breakage has been fixed

Change-Id: I03fa406551b51aaa4d4d9255cf1a53f9b4bcc1bd
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
2021-03-18 19:11:55 +00:00
Benedict Wong
d4b7104f7b Merge "Hide required underlying caps APIs" 2021-03-18 17:05:37 +00:00
Anthony Stange
677f4420b9 Merge "Revert "Add an API to listen for changes in network blocked status of an uid."" 2021-03-18 16:52:08 +00:00
Anthony Stange
8623f2b3ca Revert "Add an API to listen for changes in network blocked status of an uid."
This reverts commit 7dc302d612.

Reason for revert: Breaking build - b/183106805
Bug: 183106805
Merged-In: Ib9949b8619c6b148f73630b314c4113d76c31ec1
Change-Id: I9789ed81e630f49c71034b6917188983bd11d774
2021-03-18 16:51:22 +00:00
Sudheer Shanka
5497657433 Merge "Add an API to listen for changes in network blocked status of an uid." 2021-03-18 15:29:17 +00:00
Remi NGUYEN VAN
3e6dde82a9 Move network selection utils to Connectivity
NetworkScore, IOnCompleteListener should be in the Connectivity scope,
as they are supporting classes for the ConnectivityManager APIs.

Bug: 181512874
Test: m
Change-Id: I6dc40a80e0bf5f86f5625b657b01eba969d41fcf
2021-03-18 23:57:26 +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
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
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
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
Jeff Sharkey
58f7a60187 Merge "Expose VPN_UID" 2021-03-17 20:38:41 +00:00
Peter Collingbourne
7fe1ca63df Merge "Add support for a hw_timeout_multiplier system property." 2021-03-17 18:18:51 +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
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
lucaslin
e4ea3d4c84 Expose VPN_UID
ConnectivityService will be a part of mainline module, so it
cannot access hidden API. Expose VPN_UID for ConnectivityService
to access.

Bug: 170598012
Test: m
Change-Id: I9f74fb97ba27e5feacf1820cf75e28ad73516d7d
2021-03-17 19:04:01 +08:00
Zoey Chen
dd68ace7e0 Merge "[Telephony] Exposed PhysicalChannelConfigListener as public API instead of system" 2021-03-17 06:46:27 +00:00
Chalard Jean
3ee9b7f251 Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441
* changes:
  Remove per-user preference when the user is removed
  Expose the enterprise per-profile networking API.
  Implement setNetworkPreferenceForUser.
  Public API for per-profile network preference.
  Add tests for setNetworkPreferenceForUser
2021-03-17 05:48:18 +00:00
Martin Brabham
3af765a863 Fix CTS Failure
Bug: 182849735
Test: atest CtsSystemApiAnnotationTestCases:android.signature.cts.api.AnnotationTest#testAnnotation -- --abi x86_64
Change-Id: I1b9e77b05cd23299bf179c854e136fa341c81566
2021-03-16 20:11:05 -07:00
Martin Brabham
96e6e4a0b3 Bluetooth: Modify and append to the Out-of-Band API
- Modify createOutOfBand to be a SystemApi, and accept p192 and p256 data objects.
 - Modify OobData to become a SystemApi and to provide a Builder pattern for creation.

CTS-Coverage-Bug: 182420103
Bug: 178007935
Test: compiles and runs
Tag: #feature
Change-Id: I46aec8c2cb64a8da8957d01d32b879d60df7a31c
Merged-In: I46aec8c2cb64a8da8957d01d32b879d60df7a31c
2021-03-16 20:10:56 -07:00
Chalard Jean
db9e849986 Merge "Annotate NSM heavy methods with @WorkerThread" 2021-03-17 02:03:22 +00:00
Treehugger Robot
62d82e0b33 Merge "Use ro.boot.qemu to check if the device is an emulator" 2021-03-16 16:31:57 +00:00
Nader Jawad
0ebddf5fdc Merge "Update owners for EdgeEffect" 2021-03-16 15:28:24 +00:00
Chalard Jean
b1cd4d7b9d Public API for per-profile network preference.
This patch defines the API, but does not make it public
yet as there is no implementation yet.

Test: none so far
Change-Id: I854a952dfe35cc80847eb62f522b1667b8e9b8a0
2021-03-16 12:13:27 +00:00
Chalard Jean
1a645067e5 Merge "[NS01] Add NetworkScore" 2021-03-16 06:36:07 +00:00
Nader Jawad
ddacdf59e8 Update owners for EdgeEffect
Change-Id: Ibe2c6d253cdc1c448fc405eb75a10860fe791834
2021-03-15 17:38:18 +00:00
Aaron Huang
16f50075b1 Merge changes from topic "pacproxy-service"
* changes:
  Make PacProxyService be a system service
  Revert^2 "Refactor setCurrentProxyScriptUrl to a void method"
2021-03-15 11:49:45 +00:00
Chalard Jean
5c4bb91134 [NS01] Add NetworkScore
As attested by numerous TODOs in the code, a new way of
representing network quality and policy is needed instead
of an int.

An int representing the quality of the network requires
all parties using it to know how all other parties are
using it, and implementation details about the decision
algorithm. For all intents and purposes, the selection
is left to individual network factories who try to
achieve a desired result while piecing together all
possible states of the system.

As the number of such cases and desires increases, this
becomes both intractable and unmaintainable. Indeed, at
this time in the codebase nobody can really predict exactly
how a given change in score will affect selection across
the board, and it is essentially impossible to figure out
the behavior of network selection by inspecting the code
because the moving parts are scattered throughout the
entire codebase.

Having an object encapsulating policy and quality values
will let us centralize the selection and make it again
possible to maintain without knowledge of all behaviors
of all network factories. It will also provide better
guarantees of respecting policy, and allow bugfixes that
were not possible before because they'd touch too many
parts of the code.

Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Change-Id: I3185a6412b9b659798faf0c6882699e9c63cc115
2021-03-15 09:49:47 +00:00
Aaron Huang
5d31a15d84 Make PacProxyService be a system service
PacProxyInstaller class is running a thread all the time and is
listening to intent ACTION_PAC_REFRESH so it would be better to
make it be a system service with a manager class PacProxyManager
which is obtained with getSystemService(PacProxyManager.class).
Besides, rename PacProxyInstaller to PacProxyService will
be easier to know it's the service for PacProxyManager.

ConnectivityService is going to be a mainline module and it
needs constructor of PacProxyService to be SystemApi.
However, in current design, it needs to pass a handler and
an int arguments to the constructor which would be difficult
to maintain if just expose the constructor directly.

So, define a listener for the event that the current PAC
proxy has been installed so that the handler and the int
arguments can be removed from the constructor.

Bug: 177035719
Test: FrameworksNetTests
Change-Id: I2abff75ec59a17628ef006aad348c53fadbed076
2021-03-15 14:40:58 +08:00
Treehugger Robot
17cc39f7d8 Merge changes from topic "uwb_api_change"
* changes:
  Pass SessionHandle to UWB Service when opening a session
  Return CancellationSignal when opening UWB session
  Address UWB API feedback
2021-03-12 21:50:17 +00:00
Cody Kesting
a93e2f9545 Merge "Update Policy Listener API naming." 2021-03-12 21:32:08 +00:00
Nicolas Geoffray
af174a5708 Merge "Remove some methods from DdmVmInternal." 2021-03-12 12:05:45 +00:00
Zoey Chen
943a0c590b [Telephony] Exposed PhysicalChannelConfigListener as public API instead of system
Bug: 182408018
Test: make
Change-Id: I294453b0c28b79e309063a1cd2f57644b3a6242c
2021-03-12 15:54:29 +08:00
Paul Hu
240fdc5d97 Merge "Expose Intent#ACTION_CLEAR_DNS_CACHE" 2021-03-12 07:47:10 +00:00
paulhu
97c860113a Expose Intent#ACTION_CLEAR_DNS_CACHE
DnsManager will broadcast ACTION_CLEAR_DNS_CACHE intent to clear
dns cache when network have changed. But DnsManager is in the
Connectivity mainline module which can not use non-formal API.
Thus, expose Intent#ACTION_CLEAR_DNS_CACHE as module lib API for
mainline module.

Bug: 182370679
Test: m update-api
Merged-In: I30b1b146dcae82926be7bdb8b343635a01eabefe

Change-Id: I30b1b146dcae82926be7bdb8b343635a01eabefe
2021-03-12 05:21:08 +00:00
Remi NGUYEN VAN
cb35ed09da Merge "Move ParseException to Connectivity" 2021-03-12 04:27:55 +00:00
Remi NGUYEN VAN
c77293b7a9 Merge changes from topic "ethernet_specifier"
* changes:
  Fix common tests on Q and R
  Add Ethernet, TestNetworkSpecifier API
2021-03-11 23:51:49 +00:00
Peter Collingbourne
6353c57d57 Add support for a hw_timeout_multiplier system property.
In order to test the platform in emulators that are orders of magnitude
slower than real hardware we need to be able to avoid hitting timeouts
that prevent it from coming up properly. For this purpose introduce
a system property, ro.hw_timeout_multiplier, which may be set to
an integer value that acts as a multiplier for various timeouts on
the system.

Bug: 178231152
Change-Id: I6d7710beed0c4c5b1720e74e7abe3a586778c678
Merged-In: I6d7710beed0c4c5b1720e74e7abe3a586778c678
2021-03-11 14:04:18 -08:00
mrenouf
7b969ae133 Update OWNERS for long screenshots framework code
Adds OWNERS line for internal binder interfaces.

Test: n/a
Change-Id: Ib6cdef76c5c9444f7187e33588bb3fdfbf5f5787
2021-03-11 21:23:44 +00:00
Cody Kesting
ae3c3593cb Update Policy Listener API naming.
This CL changes the policy listener API to be
VcnNetworkPolicyChangeListener (it was previously
VcnNetworkPolicyListener) per API Council guidance.

This CL also requires permission NETWORK_FACTORY for removing registered
policy listeners.

Bug: 181562364
Test: atest FrameworksVcnTests
Change-Id: I026eaefa62d8f64b9180fc182a7cf0605d83bf97
Merged-In: I026eaefa62d8f64b9180fc182a7cf0605d83bf97
(cherry picked from commit a96ec13821)
2021-03-11 09:48:22 -08:00
Remi NGUYEN VAN
c5479a0886 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
Merged-In: Iee569f5c8bbdc4bc979610e1191308281f3d4620

Change-Id: Iee569f5c8bbdc4bc979610e1191308281f3d4620
2021-03-11 23:02:02 +08:00
Chalard Jean
ed40025e25 Annotate NSM heavy methods with @WorkerThread
Test: TH
Bug: 181906747
Change-Id: Ia30273466c1b91a3dcc5d36dac61f92185dec96e
2021-03-11 10:47:46 +00:00
Remi NGUYEN VAN
ebacbf75b4 Move ParseException to Connectivity
ParseException is a public API class used to support Connectivity APIs,
so it should be in the same API surface as connectivity.

Bug: 181512874
Test: m
Change-Id: Ie1213de0d0facc8f409f7b4c2553abb382e4afbf
2021-03-11 17:19:18 +09:00