Commit Graph

565601 Commits

Author SHA1 Message Date
Roshan Pius
adee4b7b7e TransportInfo: Add a generic redaction mechanism
This replaces the existing mechanism for redacting location sensitive
fields with a more extensible mechanism. Currently supported redactions
are for the following permissions:
i. ACCESS_FINE_LOCATION
ii. LOCAL_MAC_ADDRESS
iii. NETWORK_SETTINGS

Also, removed WifiInfo from ConnectivityServiceTest to reduce cross
dependencies on wifi code.

Bug: 156867433
Bug: 162602799
Test: atest android.net
Test: atest com.android.server
Change-Id: I2bb980c624667a55c1383f13ab71b9b97ed6eeab
2021-03-19 20:15:21 +00:00
Chiachang Wang
b0c6107723 Revert "Revert "Expose uids related APIs in NetworkRequest and N..."
Revert^2 "Add shims for NetworkRequest"

b72b3ca768fc25ef72dc78f1396b08447b8ef5c6

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: I4b8e1aa558e3459a932535f9901f4ae86b0ecb67
Merged-In: I107c329d4d7130d488772166eae8b5e7aaa2ff04
2021-03-19 02:12:17 +00:00
Chiachang Wang
f301385937 Revert^2 "Replace the usage of UidRange"
5b7aad6995

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: I0f679fb5fb8f4fe26461ca4912ca1fdfe7f43c9e
Merged-In: I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9
2021-03-19 02:11:07 +00:00
Anthony Stange
5b7aad6995 Revert "Replace the usage of UidRange"
Revert "Add shims for NetworkRequest"

Revert submission 1626206-replaceUidRange

Reason for revert: Breaking build - b/183106405
Reverted Changes:
I0b79c73e8:Add shims for NetworkRequest
I4bc0daf5a:Replace the usage of UidRange
I4e5aec6ef:Replace the usage of UidRange
I107c329d4:Expose uids related APIs in NetworkRequest and Net...

Change-Id: I6290429db1c8e787f8138b55b98fd92a74ac6402
2021-03-18 16:30:59 +00:00
Anthony Stange
24c33f7c4b Revert "Expose uids related APIs in NetworkRequest and NetworkCa..."
Revert "Add shims for NetworkRequest"

Revert submission 1626206-replaceUidRange

Reason for revert: Breaking build - b/183106405
Reverted Changes:
I0b79c73e8:Add shims for NetworkRequest
I4bc0daf5a:Replace the usage of UidRange
I4e5aec6ef:Replace the usage of UidRange
I107c329d4:Expose uids related APIs in NetworkRequest and Net...

Change-Id: I45e08f89533af0d6851add38fecb5c6c114615ae
2021-03-18 16:30:59 +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
86203dde89 Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS" 2021-03-17 14:44:17 +00:00
Remi NGUYEN VAN
6a9a35c438 Merge "Remove extra comment" 2021-03-17 12:16:09 +00:00
Lucas Lin
f87b8a02a7 Merge "Modify the comment of getPrivateDnsMode" 2021-03-17 11:25:18 +00:00
Remi NGUYEN VAN
f6ecb0017c Merge "Remove usage of networkAttributes" 2021-03-17 11:24:28 +00:00
paulhu
62dc76edf0 Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS
TCP_DEFAULT_INIT_RWND setting has never been set before, CS
always read the tcp receive window size from
net.tcp.default_init_rwnd then set to net.tcp_def_init_rwnd.
Thus, remove the unnecessary setting from CS, and the property
doesn't need to set either. Because aosp/1639922 migrate the
properties, the default value has been set to kernel already.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: I13e175ab4dea72446af7df4a25e307e5934fa813
2021-03-17 11:14:35 +00:00
Remi NGUYEN VAN
94b26e8bb4 Remove extra comment
This fixes a merge conflict with downstream branches due to an
incomplete cherry-pick.

Bug: 171540887
Test: m

Change-Id: I27a8f20f1a1d83b472700648f3f5a68413a76ac3
Merged-In: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
2021-03-17 10:58:08 +00:00
Jack He
b67cbe2631 Merge "Bluetooth: Wait for provisioning after init flag change" 2021-03-17 07:18:08 +00:00
lucaslin
a7809e8ed9 Modify the comment of getPrivateDnsMode
Bug: 172183305
Test: m
Change-Id: I2f1b44cf2a362b42f052ea5d34a5cec03d46e661
2021-03-17 14:53:35 +08:00
Zoey Chen
dd68ace7e0 Merge "[Telephony] Exposed PhysicalChannelConfigListener as public API instead of system" 2021-03-17 06:46:27 +00:00
Lucas Lin
0aa487570c Merge "Change the parameter type from ContentResolver to Context" 2021-03-17 06:35:21 +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
Janis Danisevskis
665844b1e2 Merge "Keystore 2.0: Remove hidden Keystore API from locksettings tests." 2021-03-17 03:01:24 +00:00
Howard Chen
811ad79636 Merge changes from topic "cow_pdb"
* changes:
  Support copy-on-write persistent data block when running a DSU
  Support PersistentDataBlockService in DSU
2021-03-17 02:07:03 +00:00
Chalard Jean
db9e849986 Merge "Annotate NSM heavy methods with @WorkerThread" 2021-03-17 02:03:22 +00:00
Remi NGUYEN VAN
0255ab4694 Merge "Remove MessageUtils usage in VpnTransportInfo" 2021-03-17 00:14:10 +00:00
Remi NGUYEN VAN
a89a2ae676 Merge "Move LocationPermissionChecker to libs/net" 2021-03-17 00:13:21 +00:00
Junyu Lai
29908cf3c4 Merge "[VCN14] Expose registerBestMatchingNetworkCallback" 2021-03-16 23:31:29 +00:00
Hall Liu
2ab1cc0fac Merge "Add carrier config keys for RTT-VT compat" 2021-03-16 23:21:34 +00:00
Jack He
4d74f94897 Bluetooth: Wait for provisioning after init flag change
* Wait for device provisioning to be completed before restart stack
  after an init flag change

Bug: 181226310
Test: make, setup wizard
Change-Id: I1128d9ef25b7703da31cfe55a812aaa745ab5f41
2021-03-16 16:16:39 -07:00
Christian Wailes
98432e96b0 Merge "Adds tests for Install Scenarios to DexManagerTests" 2021-03-16 23:02:39 +00:00
Andy Hung
0f8c08544a Merge "SoundPool: Improve single stream SoundPool handling" 2021-03-16 22:24:05 +00:00
Andy Hung
43da3d54c4 SoundPool: Improve single stream SoundPool handling
By design, the StreamManager ramps down volume
on a Stream stop to prevent pops and glitches.
When the SoundPool is configured only with a single stream,
there may be a short period of unavailability of that stream
while stop is called by the worker thread; an immediate
play after a stop may return 0 (failure).

To allow immediate play after stop for a *single* Stream configured
SoundPool, we lock the StreamManager worker thread so that the
stop call is processed and the stream is visible to the client for use.

We prefer not to keep this lock for the multiple Stream case as it
prevents concurrent initiation of sounds from multiple StreamManager
worker threads and such blocking is not appropriate for games.

Test: SoundPoolAacTest SoundPoolHapticTest
Test: SoundPoolMidiTest SoundPoolOggTest
Bug: 175097719
Bug: 177287876
Merged-In: Iec777d6319d5ed76000d4c5b12336b106dacede4
Change-Id: Iec777d6319d5ed76000d4c5b12336b106dacede4
2021-03-16 21:01:05 +00:00
Yan Wang
59437812ad Merge "Rename enum in ArtDexMetadataType with appropriate prefix." 2021-03-16 17:34:51 +00:00
Henry Fang
e42498a501 Merge "Tuner FW: clean up Dvr/Filter message-queue resources upon close" 2021-03-16 17:18:48 +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
Junyu Lai
f98037abb3 Merge "[VCN13] Implement tracking best matching network" 2021-03-16 15:59:52 +00:00
Pierre Couillaud
ee14d5ea42 Tuner FW: clean up Dvr/Filter message-queue resources upon close
Bug: 182546718
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
Change-Id: I89374a334e86dd934a972989c318b5222f4ce769
Merged-In: Iea28f07a0800cbab88a1348fa7ae21ac17e1cfd8
2021-03-16 15:45:45 +00:00
Nader Jawad
0ebddf5fdc Merge "Update owners for EdgeEffect" 2021-03-16 15:28:24 +00:00
Michele Berionne
11773facb7 Merge "Clarification for PREPARE_UNATTENDED_REBOOT_ERROR" 2021-03-16 14:55:58 +00:00
junyulai
1eda2f6689 [VCN14] Expose registerBestMatchingNetworkCallback
Test: m -j doc-comment-check-docs
Bug: 175662146
Change-Id: Ie67dd2f4f8d973de37bc64a03908d7cbb7c2b7ad
2021-03-16 21:30:56 +08:00
junyulai
dbf52a2834 [VCN13] Implement tracking best matching network
This is done by:
  1. In requestNetwork, provide a basic permission check.
  2. rematchNetworksAndRequests: no change, since non listen
     requests will be automatically processed to track
     best satisfying network.
  3. applyNetworkReassignment: no change, since non-request
     will not be sent to factories.

Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_noIssueToFactory
Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_trackBestNetwork
Bug: 175662146
Change-Id: I8cf4ab334df6812d84cdda160e9b72b6f54062af
2021-03-16 21:30:55 +08:00
Paul Hu
96a89d8f43 Merge "Replace interal okhttp APIs" 2021-03-16 12:18:49 +00:00
Chalard Jean
d1343a21e9 Remove per-user preference when the user is removed
Test: new test for this
Change-Id: I335e82e29ec8f4c8da9def8b40153858cfd5bacb
2021-03-16 12:14:12 +00:00
Chalard Jean
0176e89052 Expose the enterprise per-profile networking API.
Also unify the listener for Oem settings, which have
never been released as public API (it is slated to be
released in S).

Test: FrameworksNetTests
Change-Id: I84ba363dd0ec03871c37b1c3a31e5557d9aa12e7
2021-03-16 12:14:00 +00:00
Chalard Jean
67bfec2027 Implement setNetworkPreferenceForUser.
Test: FrameworksNetTests
Change-Id: I8f18083b5857289892fe8adea5f5ea3f5dbe0809
2021-03-16 12:13:46 +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
0bd0dc2c83 Add tests for setNetworkPreferenceForUser
Test: this
Change-Id: I00e2344118408da307439a0a993eb67cb17bf777
2021-03-16 12:11:27 +00:00
Lucas Lin
7044a8f3c7 Merge "Remove NETWORK_STACK_UID check" 2021-03-16 11:26:24 +00:00
lucaslin
7384af3e6b Change the parameter type from ContentResolver to Context
Context is more useful than ContentResolver, it can provide more
information if we want to change the behavior in the future.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: I5702c7d74b862a76558b94f1abe2c6df9eb7f097
Merged-In: I5702c7d74b862a76558b94f1abe2c6df9eb7f097
2021-03-16 09:26:57 +00:00
lucaslin
5c29439697 Remove NETWORK_STACK_UID check
NETWORK_STACK_UID check was introduced by aosp/1134635, and it
assumed that wifi factories/agents will be running on the network
stack process, but it didn't eventually. It runs in the system
server instead. So remove this check.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ie11268738e364e252f18876f7a4a0dc064ca8b9c
2021-03-16 09:16:38 +00:00
Lucas Lin
5b30e438de Merge "Add comments to describe the value of converting hex to decimal" 2021-03-16 08:31:10 +00:00
Lucas Lin
179ecda65f Merge "Have a new API to get private DNS mode" 2021-03-16 07:39:35 +00:00
Remi NGUYEN VAN
62966b715b Remove usage of networkAttributes
networkAttributes is a legacy configuration that is now only used to
configure which legacy type networks are supported, and what the restore
timer is for that network type, for the deprecated
startUsingNetworkFeature API.

Use a dedicated resource for the restore timers, and build supported
legacy network types using hasSystemFeature for wifi, wifi p2p,
bluetooth, proxy types, and TelephonyManager.isDataCapable for the
mobile types.

Bug: 146206136
Test: atest FrameworksNetTests
Change-Id: I3a771d3de6c5e912f18d2834e3a50af797ac4991
2021-03-16 16:01:40 +09:00