Commit Graph

121132 Commits

Author SHA1 Message Date
Lorenzo Colitti
682686bdff Stop using IIpConnectivityMetrics in ConnectivityService.
Currently, ConnectivityService calls the IpConnectivityMetrics
service class directly to log default network events. This is
incompatible with ConnectivityService being in a mainline module.
Replace direct access to IIpConnectivityMetrics with public
methods in IpConnectivityLog, which is @SystemApi class.

The new methods are not yet @SystemApi, but they can be made so
if desired. Alternatively, these metrics could be deleted.

Also remove the IpConectivityMetrics service from the
service-connectivity JAR, and go back to starting it from
SystemServer.java, which is what was happening a few hours ago
before aosp/1542626 was merged.

Test: builds, boots
Test: atest FrameworksNetTests
Test: "dumpsys connmetrics" shows events, including default network events
Change-Id: I9d6147d93590363a2f8f83f39f05c03d001b4851
2021-01-12 23:19:49 +09:00
Paul Hu
158e8ae1f1 Merge "Replace NetworkPolicyManagerInternal#isUidNetworkingBlocked()" 2021-01-12 09:53:05 +00:00
Treehugger Robot
46c82c2739 Merge "[VCN02] Make LingerTimer takes request Id instead of NetworkRequest" 2021-01-12 08:59:04 +00:00
paulhu
cb693f8e2c Replace NetworkPolicyManagerInternal#isUidNetworkingBlocked()
Connectivity service is going to become a mainline module which
will not able to access hidden APIs. NetworkPolicyManagerInternal
is a internal serivce that CS can't be access after be a mainline
module. Thus, replace NPMI#isUidNetworkingBlocked() to similar
method NPMS#isUidNetworkingBlocked() and create new API
NPM#isUidNetworkingBlocked() to support CS usage.

Bug: 170598012
Test: atest FrameworksNetTests
Test: atest FrameworksCoreTests:NetworkPolicyManagerTest
Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
Test: atest CtsNetTestCases
Test: atest CtsHostsideNetworkTests
Change-Id: Ic3427c71c395de787320f303c9513874b4d64f98
2021-01-12 10:53:05 +08:00
Jing Ji
3d4e998ee6 Merge "Add OWNERS coverage in package android.app" 2021-01-11 23:57:04 +00:00
Treehugger Robot
08763cddab Merge "Add additional biometrics OWNERS" 2021-01-11 23:46:09 +00:00
Jakub Pawlowski
f04d2d58c2 Merge "gatt: Allow to set eatt support" 2021-01-11 22:28:49 +00:00
Kevin Chyn
835f50b21a Add additional biometrics OWNERS
Test: Builds
Change-Id: Ief8ea06dcc5803298294c639956cdfa97fa8be10
2021-01-11 13:43:29 -08:00
Łukasz Rymanowski
9bf1c7c57c gatt: Allow to set eatt support
With this patch it is possible to enable eatt_support as a GATT Client
or GATT Server.

Tag: #feature
Bug: 159786353
Test: manually verified against device supporting EATT
Sponsor: jpawlowski@
Change-Id: I6835a2bbd1b0ab9d6d64ee2bac5dfc96c0563afd
2021-01-11 20:49:56 +01:00
Dmitri Plotnikov
f8248eb2eb Add PowerEstimators to the per-file OWNERS
Test: N/A
Change-Id: I7777551640227d7bfefbaa68f03e82167be39237
2021-01-11 10:50:28 -08:00
Benedict Wong
20bfe66a02 Merge changes I3b769562,I63203188,Ia9396d66,Ifec34fad
* changes:
  Pull VcnNetworkProvider out into a separate class
  Verify carrier privileges for VCN-providing packages
  Add TelephonySubscriptionTracker to VcnMgmtSvc
  Add basic VcnMgmtSvc --> Vcn signals (startup, teardown, NetworkReq)
2021-01-08 22:29:40 +00:00
Treehugger Robot
022ba65d34 Merge "Add control functions to RangingSession" 2021-01-08 21:45:47 +00:00
Treehugger Robot
ae4301b9ec Merge "Bluetooth: Implement API to get device identification information" 2021-01-08 21:42:32 +00:00
Treehugger Robot
dacb8190e1 Merge "Revert "Clear BPF data in KernelCpuUidTimeReader.removeUid()"" 2021-01-08 18:57:11 +00:00
Treehugger Robot
494a17f573 Merge "Add OWNERS files for app hibernation" 2021-01-08 18:51:25 +00:00
Junyu Lai
2960af3978 Revert "wifi: Add systemAPi:setSubscriberId in NetworkAgentConfig"
This reverts commit 7521c2277a.

Reason for revert: After discussion, we prefer to add a field in NetworkCapabilities instead. Sorry for inconvenience.

Change-Id: I2e8840a797df9d1594f2b8b576bcd45beb184fca
2021-01-08 19:22:28 +08:00
Treehugger Robot
5b322f10be Merge "Pivot network statistics to use DataInput/Output." 2021-01-08 10:33:16 +00:00
Treehugger Robot
80df223aed Merge "Add team members to biometric OWNERS" 2021-01-08 04:20:25 +00:00
Fei Zheng
62d30f1a08 Bluetooth: Implement API to get device identification information
Submitted on behalf of a third-party: Samsung System LSI

License rights, if any, to the submission are granted solely by the
copyright owner of such submission under its applicable intellectual
property.

Copyright (C) 2015 Samsung System LSI
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Third Party code includes additions/modifications from Qualcomm Innovation Center, Inc.

Call BluetoothDevice.sdpSearch(BluetoothUuid.DIP) to search DIP information,
and receive intent BluetoothDevice.ACTION_SDP_RECORD to get SdpDipRecord from
BluetoothDevice.EXTRA_SDP_RECORD

Bug: 141666056
Test: atest BluetoothInstrumentationTests
Sponsor: alainv@
Tag: #feature

Change-Id: I82d0979b77d28ec36fde6616622d216a28310b4a
2021-01-08 10:59:46 +08:00
Kevin Chyn
8777a4dda3 Add team members to biometric OWNERS
Test: Presubmit
Change-Id: I0b503756a60fc8dcaaf8bcd1f1fa13628b2b9b75
2021-01-07 17:56:19 -08:00
Benedict Wong
9cb5807845 Verify carrier privileges for VCN-providing packages
This change adds and verifies packages in the VcnManagmentService,
ensuring that carrier privilege gain/loss correctly starts/tears down
VCN instances.

Bug: 163431877
Test: atest FrameworksNetTests
Change-Id: I63203188c57fdde1cfc58aaf1108aa3e70eb4a50
2021-01-07 17:13:37 -08:00
Les Lee
6ae2535ec6 Merge "wifi: Add systemAPi:setSubscriberId in NetworkAgentConfig" 2021-01-08 00:54:51 +00:00
Connor O'Brien
0648bad1b6 Revert "Clear BPF data in KernelCpuUidTimeReader.removeUid()"
This reverts commit 2eb8ad6245.

Reason for revert: Bug: 177011744

Change-Id: Ib9f1c0bda7d6df1b75dbe409f96dab39c1659781
2021-01-07 23:48:35 +00:00
Kevin Han
2a5c2ee653 Add OWNERS files for app hibernation
Add OWNERS in services/core/java/com/android/server/apphibernation for
system service code and core/java/android/apphibernation/OWNERS for
client-facing code.

Bug: 175829330
Test: builds
Change-Id: I76d95309b641d9e75e68a50c6563df9f95b9c142
2021-01-07 14:55:00 -08:00
Brian Stack
674c30d330 Add control functions to RangingSession
Adds start, stop and reconfigure functions to UWB's RangingSession
along with associated callbacks in RangingSession.Callback.

This change also modifies the UwbManager.openRangingSession function
to only open a ranging session and not actively start ranging. In
order to start ranging, use RangingSession.start() once
RangingSession.Callback.onRangingOpened has been called.

The Ranging Session API now consists of:
  UwbManager.openRangingSession
  RangingSession.start
  RangingSession.stop
  RangingSession.reconfigure
  RangingSession.close

Bug: 173799002
Bug: 170323306
Test: atest UwbManagerTests
Change-Id: I4cc7fbc1bb1cd3b0e75aa9cc57a1ad59d39d6f50
2021-01-07 13:25:39 -08:00
Treehugger Robot
9e1690609b Merge "Update deprecated link to RecyclerView" 2021-01-07 20:13:51 +00:00
Treehugger Robot
1fb7770381 Merge "Introduce public APIs to check whether a remote bluetooth headset supports voice recognition as well as echo cancellation and/or noise reduction via the AT+BRSF bitmask" 2021-01-07 17:55:04 +00:00
Lorenzo Colitti
5a5613209d Merge changes Iec22ff63,Iaca8a7cc
* changes:
  Stop using VPNs in getDefaultNetworkCapabilitiesForUser.
  Inform ConnectivityService about always-on VPN lockdown.
2021-01-07 16:31:58 +00:00
Ryan Mitchell
b9ba6a8d0f Merge changes from topic "oms-transactional-api"
* changes:
  OMS: add tests for the OMS transactional API
  Push OverlayDeviceTests onto /system
  OMS: add transactional API
  OMS: block until settings are persisted
  OMS: replace OMSImpl.OverlayChangeListener with return values
  OverlayDeviceTests: add missing TEST_MAPPING
2021-01-07 15:48:20 +00:00
Jeff Sharkey
6173852165 Merge "update owners for shortcut and launcher related files" 2021-01-07 14:50:03 +00:00
Andrei-Valentin Onea
29ed176b46 Merge changes from topic "preinstall-overrides"
* changes:
  Add force_non_debuggable_final_build_for_compat
  Allow overriding compat config prior to install time.
2021-01-07 14:04:12 +00:00
Mathew Inwood
6e1f2d209b Merge "Derestrict ContextWrapper.createApplicationContext." 2021-01-07 10:19:23 +00:00
Mathew Inwood
4224dc8b99 Derestrict ContextWrapper.createApplicationContext.
Usage has been discovered by an app so reverting this to its previous
state. This is conceptually a partial revert of change 5d123b6775.

NoNonSdkCheck: b/170729553

Bug: 175981568
Test: m
Change-Id: I3e61d3f56f176d573f68ba85f3b1762686aa62ef
2021-01-07 09:51:37 +00:00
Mathew Inwood
ea01ff86d0 Merge "Derestrict Resources.getDisplayAdjustments()." 2021-01-07 09:47:22 +00:00
Lorenzo Colitti
282ed251ce Inform ConnectivityService about always-on VPN lockdown.
Currently, when an always-on VPN is set in lockdown mode, Vpn
configures prohibit UID rules in netd directly and does not
inform ConnectivityService of the fact.

This means that ConnectivityService cannot send NetworkCallbacks
that tells apps that they are blocked or unblocked. It also means
that ConnectivityService has to take the mVpns lock and call into
Vpn to allow synchronous APIs such as getActiveNetwork to return
BLOCKED if the app is blocked.

Move all this to ConnectivityService:
- Add a setRequireVpnForUids API to ConnectivityManager, and have
  that pass the routing rules to netd.
- Update VpnTest to expect calls to ConnectivityManager instead
  of to netd.
- Whenever setRequireVpnForUids is called, ensure that
  ConnectivityService sends onBlockedStatusChanged to the
  affected callbacks.
- Update existing unit tests to check for callbacks.
- Add a way to find the VPN that applies to a given UID without
  taking the VPN lock, by instead scanning all connected VPNs.
  Use this as a replacement for direct access to mVpns.

For simplicity, and in order to ensure proper ordering between
the NetworkCallbacks sent for VPNs connecting and disconnecting,
process blocked UID ranges on the handler thread. This means that
when setRequireVpnForUids returns, the rule changes might not
have been applied. This shouldn't impact apps using network
connectivity, but it might mean that apps setting an always-on
package, and then immediately checking whether networking is
blocked, will see a behaviour change.

Bug: 173331190
Fix: 175670887
Test: new test coverage in ConnectivityServiceTest
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn \
            MixedDeviceOwnerTest#testAlwaysOnVpnLockDown \
	    MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot \
	    MixedDeviceOwnerTest#testAlwaysOnVpnPackageUninstalled \
	    MixedDeviceOwnerTest#testAlwaysOnVpnUnsupportedPackage \
	    MixedDeviceOwnerTest#testAlwaysOnVpnUnsupportedPackageReplaced \
	    MixedDeviceOwnerTest#testAlwaysOnVpnPackageLogged \
            MixedProfileOwnerTest#testAlwaysOnVpn \
            MixedProfileOwnerTest#testAlwaysOnVpnLockDown \
	    MixedProfileOwnerTest#testAlwaysOnVpnAcrossReboot \
	    MixedProfileOwnerTest#testAlwaysOnVpnPackageUninstalled \
	    MixedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackage \
	    MixedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackageReplaced \
	    MixedProfileOwnerTest#testAlwaysOnVpnPackageLogged \
            MixedManagedProfileOwnerTest#testAlwaysOnVpn \
            MixedManagedProfileOwnerTest#testAlwaysOnVpnLockDown \
	    MixedManagedProfileOwnerTest#testAlwaysOnVpnAcrossReboot \
	    MixedManagedProfileOwnerTest#testAlwaysOnVpnPackageUninstalled \
	    MixedManagedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackage \
	    MixedManagedProfileOwnerTest#testAlwaysOnVpnUnsupportedPackageReplaced \
	    MixedManagedProfileOwnerTest#testAlwaysOnVpnPackageLogged
Test: atest FrameworksNetTests HostsideVpnTests \
            CtsNetTestCases:VpnServiceTest \
	    CtsNetTestCases:Ikev2VpnTest
Change-Id: Iaca8a7cc343aef52706cff62a7735f338cb1b772
2021-01-07 17:44:29 +09:00
Chiachang Wang
518d9d8f27 Merge "Remove mobile provision design out from connectivity service" 2021-01-07 06:47:26 +00:00
Chiachang Wang
454497b7df Remove mobile provision design out from connectivity service
In order to support ConnectivityService mainline, module should
not use hidden APIs. The logic to get mobile provision is moved
to telephony surface since it's only used by telephony.
Hence, remove the design out from Connectivity.

Bug: 175177794
Test: atest FrameworksNetTests
Change-Id: Ic3082fc1c4d7ac998f4e4cff1351e6829d500924
2021-01-07 06:46:40 +00:00
Lucas Lin
c7906266c5 Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity" 2021-01-07 04:32:54 +00:00
Jeff Sharkey
6b773549e3 Pivot network statistics to use DataInput/Output.
Using these generalized interfaces is more flexible, since it enables
us to pivot the implementation being used internally.  In particular,
an upcoming CL will pivot them to use a more efficient alternative.

This is a no-op refactoring.

Bug: 176777285
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Ibd4717174cf1f136e9d5d80172ecb6e493265306
2021-01-06 18:48:12 -07:00
Rahul Sabnis
2b2f76b7bb Introduce public APIs to check whether a remote bluetooth headset
supports voice recognition as well as echo cancellation and/or noise
reduction via the AT+BRSF bitmask

Tag: #feature
Bug: 172960943
Test: Manual
Change-Id: I40579d9b6d493d2b32fb260983eeb7c79cc0d525
2021-01-06 17:20:19 -08:00
Pinyao Ting
a4d472d23b update owners for shortcut and launcher related files
Bug: 151359749
Test: manual
Change-Id: I7e670f2c59a61ffaa341bb267133c2441206a686
2021-01-06 17:08:46 -08:00
Treehugger Robot
40e2fb68e6 Merge "configure owners for shortcut related tests" 2021-01-07 00:50:50 +00:00
Connor O'Brien
d5e143eee7 Merge "Clear BPF data in KernelCpuUidTimeReader.removeUid()" 2021-01-06 23:38:12 +00:00
Pinyao Ting
01c021dbe3 configure owners for shortcut related tests
Bug: 151359749
Test: manual
Change-Id: I9893b86091cf480a2cd2ba6d276a3779d02b6eb5
2021-01-06 13:47:33 -08:00
Treehugger Robot
205894f2af Merge "Add an OWNERS file for location tz detection code" 2021-01-06 19:18:02 +00:00
Mathew Inwood
d9770ab9a9 Derestrict Resources.getDisplayAdjustments().
Usage has been discovered by an app so reverting this to its previous
state. This is conceptually a partial revert of change 5d123b6775.

NoNonSdkCheck: b/170729553

Bug: 176190631
Test: Treehugger
Change-Id: I35a853360231a17aa95c4816de308c85d040ad40
2021-01-06 16:29:42 +00:00
Neil Fuller
26c036bb3a Add an OWNERS file for location tz detection code
Another OWNERS file for location tz detection code.

Test: treehugger only
Change-Id: Ic4f7031330a7bb8da343c8274cf385af49c68d0e
2021-01-06 16:17:11 +00:00
Lorenzo Colitti
91348d9f22 Merge "Migrate away from AsyncChannel in NetworkAgent" 2021-01-06 14:10:21 +00:00
Bill Yi
e4b09fd3dd Merge "Merge RQ1A.210105.003 to aosp-master - DO NOT MERGE" 2021-01-06 13:58:58 +00:00
Treehugger Robot
916dfddfd0 Merge "Change log tag of DynamicSystemClient to match class name" 2021-01-06 11:11:58 +00:00