Commit Graph

108314 Commits

Author SHA1 Message Date
Nicolas Geoffray
0874a6fb49 Remove FastNative annotations on synchronized methods.
FastNative doesn't work on synchronized methods.

Bug: 175016705
Test: 004-JniTest
Change-Id: I1e34c78a8438c67e5a1bedb83eb977389ee9a82d
Merged-In: I1e34c78a8438c67e5a1bedb83eb977389ee9a82d
(cherry picked from commit 7c4c101a7b)
2020-12-11 09:11:44 +00:00
Treehugger Robot
294dd8f1da Merge "Throw BadParcelableException from set/getParcelable" 2020-12-07 07:32:29 +00:00
Treehugger Robot
e98351f355 Merge changes I1f880aa6,Ie8ba8208,Ic45aa87c,I04c1263a
* changes:
  Add tests for UWB AdapterStateListener
  Implement UWB AdapterStateListener
  Implement UwbManager functions
  Expose UwbManager through Context.getSystemService
2020-12-04 16:56:26 +00:00
Treehugger Robot
d14298172c Merge "RESTRICT AUTOMERGE Only update native InputApplicationHandle once" 2020-12-04 06:11:31 +00:00
Treehugger Robot
c20770fee5 Merge "Remove NATT keepalive from IpSecTransform" 2020-12-04 02:07:56 +00:00
Remi NGUYEN VAN
75304108e7 Merge "Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn" 2020-12-04 02:05:01 +00:00
Remi NGUYEN VAN
1ded24221e Merge "Set NetworkIdentity subscriberId on all networks" 2020-12-04 02:03:29 +00:00
Brian Stack
93964f8f80 Implement UWB AdapterStateListener
The AdapterStateListener registers with the underlying UWB Service for
UWB Adapter state changes and notifies registered client callbacks.

Bug: 170323306
Test: atest UwbManagerTests
Change-Id: Ie8ba8208909652b98ee2df15e08433627542f28b
2020-12-03 17:45:51 -08:00
Brian Stack
8cc2de8ccd Implement UwbManager functions
Provides implementations for the basic UwbManager functions that
directly query the UWB Service.

Bug: 170323306
Test: atest UwbManagerTests
Change-Id: Ic45aa87ce90c414642e3186890f6ef08e1fd8486
2020-12-03 16:55:41 -08:00
Treehugger Robot
a9f7570de6 Merge "BluetoothClass: Use mask to get MajorDeviceClass" 2020-12-03 19:00:23 +00:00
Riddle Hsu
5e4b075554 RESTRICT AUTOMERGE Only update native InputApplicationHandle once
This makes sure the write operation (NativeInputApplicationHandle
::updateInfo) is always called from window manager side once when
calling SurfaceControl.Transaction#setInputWindowInfo or
InputManagerService#setFocusedApplication. If the info of input
application handle is changed, a new instance will be created.
That avoids the race condition of reading the fields of the same
InputApplicationInfo instance from input dispatcher.

Bug: 171857140
Bug: 161334769
Test: WindowInputTests

Change-Id: I70de9835c7699fe6f56fc3655b0fee5c317ecc3a
2020-12-03 11:57:42 +00:00
Patrick Rohr
176ba02184 Merge changes from topic "restricted-networking-mode"
* changes:
  Add Restricted Mode Firewall Chain
  Clean Up NetworkManagementService Tests
2020-12-03 10:50:25 +00:00
Myles Watson
89bf39528f BluetoothClass: Use mask to get MajorDeviceClass
Bug: 174650196
Test: compiles
Change-Id: I6042a02fa329c5291aa7b9719907485e748582bf
2020-12-02 20:48:08 -08:00
Remi NGUYEN VAN
179419f810 Merge "Remove hidden API usage in metrics toString" 2020-12-03 03:21:42 +00:00
Remi NGUYEN VAN
692a8748a5 Merge "Do not query CS in NetworkProvider constructor" 2020-12-03 01:48:01 +00:00
Brian Stack
3163bf0d35 Expose UwbManager through Context.getSystemService
Bug: 170323306
Test: atest UwbManagerTests
Change-Id: I04c1263a191fcfeee5824be5d6d1944354819d02
Merged-In: I04c1263a191fcfeee5824be5d6d1944354819d02
2020-12-02 13:58:28 -08:00
Treehugger Robot
777d7d838a Merge "Update comment for new proto directory" 2020-12-02 13:08:47 +00:00
Remi NGUYEN VAN
e8f300c360 Merge "Remove CaptivePortal deps on @hide MetricEvents" 2020-12-02 11:12:56 +00:00
Remi NGUYEN VAN
71cd774f68 Merge "Add ConnectivityManager.TYPE_PROXY to SystemApi" 2020-12-02 09:23:27 +00:00
Remi NGUYEN VAN
79664cbf54 Set NetworkIdentity subscriberId on all networks
Instead of setting NetworkIdentity.subscriberId only on telephony
networks, set it when provided on any network. At the moment only
telephony is expected to have a subscriberId in its NetworkState anyway,
and while there are plans for other network agents (wifi) to have a
subscriberId, it should also be set in that case.

This allows NetworkIdentity to stop depending on hidden network type
APIs to determine if the network is mobile.

Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I4f09987f8737d1801342eb5d6d7c2b9968b466b0
2020-12-02 18:11:16 +09:00
Remi NGUYEN VAN
c755617364 Remove hidden API usage in metrics toString
Remove usage of hidden NetworkType, transport APIs in toString()
implementations of metrics and data usage classes.

The toString implementations can log the transports or network type as
hex or raw indices. While slightly less readable, the metrics classes
and network type APIs are deprecated.

Bug: 174436414
Test: m
Change-Id: I79239a540b66dadd3bbe0a997960530878331358
2020-12-02 18:10:59 +09:00
Jakub Pawlowski
dfe8d9caed Merge "Add Bluetooth LE Audio Profile (3/3)" 2020-12-02 08:14:59 +00:00
Remi NGUYEN VAN
1b06ca6e89 Remove CaptivePortal deps on @hide MetricEvents
The legacy metrics are deprecated, and CaptivePortal is planned to move
to a connectivity-specific jar which cannot reference MetricsEvents.

Bug: 171540887
Test: m
Change-Id: I409375de3844a7fedef707cf9e19a106d82a8e3a
2020-12-02 13:17:09 +09:00
Treehugger Robot
1d59ab8486 Merge "HDMICEC: Override hashCode in HdmiDeviceInfo" 2020-12-02 00:11:21 +00:00
Grzegorz Kołodziejczyk
f08f986a9b Add Bluetooth LE Audio Profile (3/3)
This is boilerplate code for Bluetooth LE Audio profile

Bug: 150670922
Test: compilation
Tag: #feature
Change-Id: Iadc3af12fd8b2808db2f4e933a1906a819824ade
2020-12-01 23:30:49 +01:00
Treehugger Robot
c0b44fca8b Merge "Deprecated UserManager.getUsers(excludeDying) / added getAliveUsers()" 2020-12-01 16:52:45 +00:00
Zimuzo Ezeozue
782ef476df Merge "Fixed a race contidion in StorageManagerService" 2020-12-01 10:52:23 +00:00
Felipe Leme
b0402e7bf3 Deprecated UserManager.getUsers(excludeDying) / added getAliveUsers()
The existing method is confusing (the argument used to be called
includeDying) and it puts the burden on the caller (which need to
understand what the parameter means).

Furthermore:

- The majority of calls are for getUsers(excludeDying=true).
- The calls for getUsers(excludeDying=false) are equivalent to
  calls to getUsers()

Test: m
Test: a VpnTest ConnectivityServiceTest PermissionMonitorTest

Bug: 157921703
Change-Id: Ife767a40b7b7790ba28b5377046de822ddbf275c
Merged-In: Ife767a40b7b7790ba28b5377046de822ddbf275c
(cherry picked from commit 6dc6d2b964)
2020-12-01 15:25:52 +08:00
Treehugger Robot
c565f2bd57 Merge "Revert "Revert "Keystore SPI: Initialize KeymasterDefs contants with AIDL generated enums""" 2020-12-01 01:16:40 +00:00
Lais Andrade
040919bef5 Merge "Fix documentation of delay param in VibrationEffect.Composition" 2020-11-30 22:47:19 +00:00
Jeffrey Huang
ca10c36424 Update comment for new proto directory
Bug: 167962588
Test: m -j
Change-Id: I539212aa9f5fd86d58116e32abbe48190dd3ca16
2020-11-30 12:44:45 -08:00
Tiem Song
eff0b0673c Update link for Permissions samples in Javadoc
Bug: 158042826
Change-Id: I71ab17b21b31ff6584facd023e4c4818b0ab1b55
Test: N/A
2020-11-30 18:17:43 +00:00
Patrick Rohr
9aabc50ec9 Add Restricted Mode Firewall Chain
Adding new allowlist firewall chain to support restricted networking
mode. See go/restricted-networking-mode.

Bug: b/157505406
Bug: b/170323408
Test: atest NetworkManagementServiceTest
Change-Id: I8e39b3d7b129ad74224d0c1311135b7b48f6514f
2020-11-30 18:36:02 +01:00
Lais Andrade
cc8210d370 Fix documentation of delay param in VibrationEffect.Composition
Change-Id: I9aca87e8d804d39ad61b651cc7653c8ef57e13e3
Fix: 150715908
Test: N/A
2020-11-30 16:46:18 +00:00
Janis Danisevskis
96a0716a8a Revert "Revert "Keystore SPI: Initialize KeymasterDefs contants with AIDL generated enums""
This reverts commit efec091bcb.

Reason for revert: aosp/1513473 fixed the underlying issue That make this revert necessary.

Change-Id: Ic99a6d080b4b1140924cb89d44b1f650f283a28d
2020-11-30 16:30:02 +00:00
Olof Axelsson
ed2716dd24 Fixed a race contidion in StorageManagerService
StorageManagerService#onVolumeStateChanged passes on a mutable
object to onVolumeStateChangedLocked and onVolumeStateChangedAsync.
This causes a race since the state of the object being passed can
be updated while onVolumeStateChangedAsync is processing it.

To fix this, a clone of the object is passed instead.

Bug: 174056195
Test: atest AdoptableHostTest
Test: atest com.android.tests.fused.host.FuseDaemonHostTest
Change-Id: I4de32279ae740544bd3abe33d788ebdbef1eab00
2020-11-30 15:45:43 +00:00
Louis Chang
9233cb2be8 Merge "Revert "Keystore SPI: Initialize KeymasterDefs contants with AIDL generated enums"" 2020-11-30 14:14:34 +00:00
Remi NGUYEN VAN
7f159cf640 Add ConnectivityManager.TYPE_PROXY to SystemApi
This follows other TYPE_* constants like TYPE_WIFI_P2P that are
@SystemApi or public.
TYPE_PROXY has a use-case for the system to set network policies based
on proxy network templates. Although network types are deprecated, that
use-case needs to be supported and significant amounts of network
management would need to be rewritten to stop using network types.

The constant needs to be API as ConnectivityManager is planned to move
out of framework.jar, so only its formal API will be available to the
system server.

Bug: 174436414
Test: m
Change-Id: I266ed6bc59f5eb72302afe14472c93933733c8f8
2020-11-30 19:23:45 +09:00
Remi NGUYEN VAN
8fe718ee81 Remove NATT keepalive from IpSecTransform
The code is unused, and based on ConnectivityManager#startNattKeepalive,
which is deprecated.

Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I08c6c1baec668a304d971bb6f2328891a5611e6a
2020-11-30 17:24:10 +09:00
Remi NGUYEN VAN
caeabd308e Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn
Instead of sharing the constant from LinkProperties, use the already
defined constant in the NetworkConstants class.

This allows Ikev2VpnProfile to allow depending on non-public
LinkProperties APIs, as LinkProperties is planned to move to
framework-connectivity.

Bug: 174436414
Test: m
Change-Id: I594bb7e81bc7681799c16eff621a5ffd1b29624c
2020-11-30 17:18:51 +09:00
Louis Chang
efec091bcb Revert "Keystore SPI: Initialize KeymasterDefs contants with AIDL generated enums"
This reverts commit 2a66fc6144.

Reason for revert: b/174445211

Change-Id: I286327d8db19d50d3dd9602a2d0bd368d331c0c4
2020-11-30 07:36:55 +00:00
Chalard Jean
05f12dff8e Migrate VPN to the public NetworkAgent API.
On top of being a cleanup this is useful for the S Network
Selection project that will need to enrich the Network
Agent API, and as such should not have to support legacy
agents.

Test: FrameworksNetTests NetworkStackTests
Bug: 167544279
Change-Id: Id3e5f6e19829c64074cd6a52c5f950cee56b860b
2020-11-30 16:15:18 +09:00
Remi NGUYEN VAN
a1bef5bbc2 Do not query CS in NetworkProvider constructor
ConnectivityService may not be available in a NetworkProvider
constructor, if it is created (but still unused) before
ConnectivityService starts.

As ConnectivityManager is only necessary in
declareNetworkRequestUnfulfillable, which should not be called often,
just query ConnectivityManager at that point.

This is necessary for VcnManagementService, which is started before
ConnectivityService and creates its NetworkProvider in its constructor.
Fortunately VcnManagementService does not call
declareNetworkRequestUnfulfillable at this point.

ConnectivityManager may be migrated to classic service getters that
cache "null" when the service was not available the first time it is
queried, so no system service must query it before it starts.

Bug: 171540887
Test: atest FrameworksNetTests:NetworkProviderTest
Change-Id: I8dadcd0e1360a9464192f330493e13aa69dd9fe2
2020-11-30 12:42:15 +09:00
Lorenzo Colitti
dccf7eda5e Merge changes from topic "networkagent-set-underlying-networks"
* changes:
  Stop accessing VPNs in getAllVpnInfo.
  Clear calling identity in registerNetworkAgent.
  Allow tests to create TRANSPORT_TEST|TRANSPORT_VPN networks.
  Move applying underlying caps from Vpn to ConnectivityService.
2020-11-28 02:49:53 +00:00
Janis Danisevskis
136fcd2a56 Merge "Keystore SPI: Initialize KeymasterDefs contants with AIDL generated enums" 2020-11-27 20:25:47 +00:00
Lorenzo Colitti
45feed9b00 Allow tests to create TRANSPORT_TEST|TRANSPORT_VPN networks.
This CL allows an app that has the MANAGE_TEST_NETWORKS
permission to create test VPN networks.

The code enforces that such networks can never apply to any UIDs
and thus will never carry any traffic.

Bug: 173331190
Test: passes existing tests, moved tests pass
Change-Id: I5befea0e3b4b6dce4ca0c6a04471a055186b644c
2020-11-27 15:35:38 +09:00
Lorenzo Colitti
d182c40d8c Move applying underlying caps from Vpn to ConnectivityService.
Add support to ConnectivityService to track underlying networks
directly instead of through the Vpn class.

1. Communicate all information necessary to propagate underlying
   network capabilities to ConnectivityService via NetworkAgent.
   This includes:
   a. Underlying networks:
      - Add SystemApi for NetworkAgent to declare its underlying
        networks to ConnectivityService, and use it in Vpn.
      - Add a new declaredUnderlyingNetworks member to
        NetworkAgentInfo and store the underlying networks in it.
	Move propagation of underlying network capabilities to
	mixInCapabilities, which is a natural place for it.
   b. "Always metered" bit:
      - Communicate this to ConnectivityService via the existing
        NOT_METERED capability. Store it in a new declaredMetered
	boolean in NetworkAgentInfo to separate it cleanly from
	the NOT_METERED bit in the capabilities, which depends on
	whether the underlying networks are metered or not. In
	order to ensure that this is only ever changed when a NC
	update is received from a NetworkAgent, define a new
	processCapabilitiesFromAgent similar to the existing
        processLinkPropertiesFromAgent.

2. Ensure that propagating underlying network capabilities does
   not read the VPN's NetworkCapabilities. In order to do this,
   ensure that all relevant information on underlying networks
   and metering is sent to ConnectivityService at NetworkAgent
   registration time. CS still calls Vpn#updateCapabilities when
   a user is added/removed, but that is deleted in a future CL.

3. Slightly generalize propagating underlying network
   capabilities because there may be other network types that
   also have underlying networks that aren't VPNs (e.g., VCN).
   - Introduce a new supportsUnderlyingNetworks() boolean method
     in NetworkAgentInfo.
   - Rename updateAllVpnsCapabilities to
     propagateUnderlyingNetworkCapabilities.

This commit does not move the actual logic of calculating the
underlying capabilities out of Vpn.java. That can be done in a
subsequent change once CS stops calling getUnderlyingNetworks().

This commit also does not modify any of the other code in CS that
directly accesses VPNs' underlying networks.

Bug: 173331190
Test: passes existing tests in ConnectivityServiceTest
Test: CTS test in r.android.com/1511114
Test: atest CtsNetTestCases:Ikev2VpnTest HostsideVpnTests
Change-Id: I5f76cb1aa4866efed3d5c4590e931fdb0e994f8d
2020-11-27 15:35:38 +09:00
Treehugger Robot
97c2606bbd Merge "ParcelableHolder shouldn't write anything for empty case" 2020-11-26 02:39:54 +00:00
Neil Fuller
1395dffdb1 Make manual suggestions synchronous/return result
Modify the suggestManual...() methods on TimeDetector and
TimeZoneDetector to be synchronous, and have them return true/false to
indicate if the call "succeeded". This is being done before adding more
calls that will be used by apps like SettingsUI; generally all calls
that are user facing and could conceivably fail should return
success/failure information and therefore need to happen synchronously.

Test: atest services/tests/servicestests/src/com/android/server/timedetector/
Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/
Bug: 140712361
Merged-In: I5b6b7fb5af2ffe88392b2ca8d1e8fff2a187521b
Change-Id: I5b6b7fb5af2ffe88392b2ca8d1e8fff2a187521b
2020-11-25 09:57:07 +00:00
Jeongik Cha
3f5ffa615a ParcelableHolder shouldn't write anything for empty case
If neither Parcel nor Parcelable exists, ParcelableHolder'd better
write nothing like NDK and C++ backend.

In the case of empty ParcelableHolder
As-is(Java):
 4 -> Size
 -1 -> Existence(empty string)

To-be(NDK, C++ now):
 0 -> Size

Test: atest CtsNdkBinderTestCases
Bug: 173682663
Change-Id: I816108fdc59170ea7408f0633295ba978f1ef9d5
2020-11-24 22:44:42 +09:00