565859 Commits

Author SHA1 Message Date
Lorenzo Colitti
744e27a39e Merge changes from topic "backport-connectivityresources"
* changes:
  Use module resources in NetworkNotificationManager.
  Cherry-pick some test changes from ag/13210542.
  Add connectivity protos to framework-connectivity
  Remove unused NetworkPolicyManagerInternal in CS
  Move connectivity AIDLs to android.net
  Migrate framework-connectivity internal resources
  Expose isUidNetworkingBlocked and isUidRestrictedOnMeteredNetworks
  Add multipath preference, background status API
2021-03-21 15:47:28 +00:00
Janis Danisevskis
8875f872de Keystore: Fix Device ID attestation test.
Test: atest android.keystore.cts.KeyAttestationTest#testDeviceIdAttestation
Bug: 182606921
Change-Id: Ie8dbc4a2829fb7f70188c5d903e748060c5869ce
2021-03-20 21:29:21 -07:00
Hui Wang
98763306a2 Merge "Add VoPS support info for NR" 2021-03-21 04:12:52 +00:00
Martin Brabham
045fe260e1 Add new @SystemApi for specifying AddressType and IRK
Bug: 178234318
Test: compiles and runs
Tag: #feature
Change-Id: Ib67e681af01260df98602003b2aca47963494c6f
2021-03-20 15:13:24 -07:00
Lorenzo Colitti
8b77bf790c Use module resources in NetworkNotificationManager.
Also make getTransportName non-static so it can access the module
resources.

Also fix a duplicate comment in a resource file.

Bug: 183097033
Test: atest FrameworksNetTests
Test: connected to Wi-Fi with no Internet, observed notification
Change-Id: Ic0d24d36af0b87153d527083f8964ddc6cd78482
Merged-In: Ic0d24d36af0b87153d527083f8964ddc6cd78482
2021-03-21 01:54:51 +09:00
Lorenzo Colitti
250710c687 Cherry-pick some test changes from ag/13210542.
ag/13210542 switched from using reset() on mResources to using
clearInvocations(). This ensures that only the previous calls are
reset, and that the mock continues to behave according to what
was specified in setUp.

Test: 183097033
Test: test-only change
Merged-In: I35d28c8df341dbbac2774026c6ca749e296c0482
Change-Id: Ieef982d2df50db3014f35f58a77674939ebe0d43
2021-03-21 01:54:51 +09:00
Lorenzo Colitti
4cc71277cd Merge "Copy NetworkNotificationManager resources to conectivity module." 2021-03-20 13:52:46 +00:00
Remi NGUYEN VAN
3b0736735b Add connectivity protos to framework-connectivity
The protos are built separately by framework-connectivity from framework
protos, keeping only android.net protos for the connectivity jar.

Bug: 171860710
Test: m framework-connectivity.impl
Change-Id: I2c4a37ff2ee9e8efde49885feeafa27dcff7ca2c
Merged-In: I2c4a37ff2ee9e8efde49885feeafa27dcff7ca2c
2021-03-20 22:51:35 +09:00
paulhu
279b33817f Remove unused NetworkPolicyManagerInternal in CS
ConnectivityService doesn't call any NPMI methods, so remove all
usage from CS.

Bug: 170598012
Test: atest FrameworksNetTests
Test: atest FrameworksNetIntegrationTests
Change-Id: I8719ef2e96e7db9da2894b467b9e7a1bc09de386
Merged-In: I8719ef2e96e7db9da2894b467b9e7a1bc09de386
2021-03-20 22:51:35 +09:00
Remi NGUYEN VAN
3a680dc897 Move connectivity AIDLs to android.net
java_sdk_libraries and apexes need to contain bootclasspath classes
under predefined packages. Tethering currently uses android.net, so make
sure all the connectivity bootclasspath classes are under android.net.

This avoids maintaining two packages for the tethering APEX, where
com.android.connectivity.aidl is only used by internal AIDL files.

Bug: 182984842
Test: m
Change-Id: I611f1941698c574e37aea912ee76dadc8b32e41a
Merged-In: I611f1941698c574e37aea912ee76dadc8b32e41a
2021-03-20 22:51:35 +09:00
Remi NGUYEN VAN
4f8084867e Migrate framework-connectivity internal resources
Use ServiceConnectivityResources instead.
Start by creating resources in the ServiceConnectivityResources package
to match the internal configuration, and common overlays.

Bug: 182125649
Test: device boots, has connectivity
Change-Id: I77a3efca2cd644f9828db1ed5d3cae8070fb8363
Merged-In: I77a3efca2cd644f9828db1ed5d3cae8070fb8363
2021-03-20 22:35:16 +09:00
Lorenzo Colitti
f969377a96 Expose isUidNetworkingBlocked and isUidRestrictedOnMeteredNetworks
These methods are used by ConnectivityService for synchronous
calls such as getActiveNetworkInfo, isActiveNetworkMetered, etc.

These calls must call into NPMS and acquire the NPMS lock because
they are synchronous. They cannot use the stale copy of the
policy rules maintained by ConnectivityService, because if they
did, races like the following could occur:

1. App gets broadcast/callback/....
2. App calls isActiveNetworkMetered or other synchronous method.
3. ConnectivityService's copy of the rules is out of date, so the
   call returns stale information that the UID is still blocked.
4. The app thinks it has no networking, and does not call the
   synchronous method again until some other event occurs,
   potentially much later.

Bug: 176289731
Test: passes existing tests in ConnectivityServiceTest
Change-Id: I4ad0ca60431fe3702be85332530b6e93728d55e7
Merged-In: I4ad0ca60431fe3702be85332530b6e93728d55e7
2021-03-20 22:23:23 +09:00
Remi NGUYEN VAN
00b8d2cf37 Add multipath preference, background status API
Add APIs for getMultipathPreference and getRestrictBackgroundStatus.
Both are used by Connectivity to back the external
ConnectivityManager.getRestrictBackgroundStatus, and
ConnectivityManager.getMultipathPreference APIs.

Test: atest CtsNetTestCases
      atest ConnectivityServiceTests
      atest NetworkPolicyManagerServiceTest
Bug: 176289731
Change-Id: I8a03162b2f6691086bb64e75ffd354cdfca7f86a
Merged-In: I8a03162b2f6691086bb64e75ffd354cdfca7f86a
2021-03-20 22:23:16 +09:00
Lorenzo Colitti
576e9036d6 Copy NetworkNotificationManager resources to conectivity module.
The localized resources were automatically generated with:

===========
export OLDRES=core/res/res
export NEWRES=packages/Connectivity/service/ServiceConnectivityResources/res
export FILE=services/core/java/com/android/server/connectivity/NetworkNotificationManager.java

for i in $OLDRES/values-*/strings.xml; do
    outfile=$NEWRES/${i#core/res/res/}
    outdir=$(dirname $outfile)

    if egrep -q "$regex" $i || egrep -q "$strarrayregex" $i; then
        mkdir -p $outdir

        cat << EOF > $outfile
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ 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.
  -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
EOF

        egrep $regex $i >> $outfile

        egrep -A $strarraylines "$strarrayregex" $i >> $outfile

        echo "</resources>" >> $outfile
    fi
done
===========

The text to the the base resources file was added manually from
the output of:

===========
egrep -B 2 $regex core/res/res/values/strings.xml  | grep -v -- ^--
egrep -B 2 -A 6 $strarrayregex core/res/res/values/strings.xml  | grep -v -- ^--
===========

The drawables were copied from the Wifi resources and from the
framework resources.

Test: m
Bug: 183097033
Change-Id: I99c0d28069dd1a13d452105b0a83a03a833232a2
Merged-In: I99c0d28069dd1a13d452105b0a83a03a833232a2
2021-03-20 21:37:58 +09:00
Roman Kiryanov
62ecd75d5a Emulator cleanup in ClipboardService.java (openPipe)
Bug: 182436079
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: If19859b04d6c5ed27249c31ea55e273f303b3ec4
2021-03-19 19:41:08 -07:00
Kevin Han
4dfa5f8db4 Merge changes from topic "app_hibernation_permission"
* changes:
  Add API to get hibernating packages
  Add MANAGE_APP_HIBERNATION permission
2021-03-20 01:37:29 +00:00
Andy Hung
64e333a250 Merge "AudioTrack: get/setStartThresholdInFrames" 2021-03-20 01:04:28 +00:00
Treehugger Robot
258ecb55a5 Merge "Return 0 instead of throwing RuntimeException from getSmsCapacityOnIcc" 2021-03-20 00:28:35 +00:00
Chienyuan Huang
4a47532570 Merge "Le Scan: Add ambient discovery mode (1/2)" 2021-03-20 00:26:04 +00:00
Peter Collingbourne
efad4dcd74 Merge "Support MTE and GWP-ASan features in proto tombstones." 2021-03-19 23:42:23 +00:00
Josh Gao
680aaa9195 Merge "Switch to bionic's pidfd_open." 2021-03-19 22:42:22 +00:00
Tianjie
4c42515be1 Report more metrics in RecoverySystem
Use shared preferences in recovery system service. So it be used for
metrics storage and report RoR metrics.

Bug: 179105110
Test: atest FrameworksServicesTests:RecoverySystemServiceTest; check the value of prefs
Change-Id: Id09545824713ab124882f2f2add67e7f93cb43ca
2021-03-19 15:27:35 -07:00
Tej Singh
d5127dceb0 Merge changes from topic "tej_isolate_protologging"
* changes:
  Remove network transport from core/proto
  Move service/enums.proto to proto_logging
  Add usb and networkcapabilities back to core/proto
2021-03-19 22:20:47 +00:00
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
Christian Wailes
d6c3dfb3ff Merge "Update OWNERS file" 2021-03-19 20:59:11 +00:00
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
Jeff Sharkey
d702544c9f Merge "OWNERS for a few Voice Interaction files." 2021-03-19 19:21:48 +00:00
Shuzhen Wang
171249e857 Merge "Camera: Fix a removal-while-iterate bug" 2021-03-19 18:34:00 +00:00
Kevin Han
487e16c4af Move disk reads to background
Move disk reading to background to improve performance on user
unlocking.

Bug: 182098676
Test: atest AppHibernationServiceTest
Change-Id: I087bd9d29f4f90c818a03648ee75e3cbfb2ded41
2021-03-19 10:38:17 -07:00
Kevin Han
f0df72a9c7 Add API to get hibernating packages
Add API to AppHibernationService to get hibernating packages so
Settings can access this information.

Bug: 175829330
Test: atest AppHibernationServiceTest
Change-Id: Icd186807c19ece55a21fc4d240d2f0132951af82
2021-03-19 10:38:16 -07:00
Kevin Han
152e389bae Add MANAGE_APP_HIBERNATION permission
Add permission for app hibernation state manipulation.

Bug: 183058954
Test: run hibernation job and confirm the API works for
PermissionController

(cherrypick of ag/13909632)

Merged-In: Id57ee57f49710d0b8a49a4ec561800db43089f87
Change-Id: Id57ee57f49710d0b8a49a4ec561800db43089f87
2021-03-19 10:37:05 -07:00
Yan Wang
08d5380762 Merge "Remove the reading of APK file." 2021-03-19 16:55:54 +00:00
Treehugger Robot
cd37173df6 Merge "Fix InetAddressCompat exception handling" 2021-03-19 16:38:54 +00:00
Treehugger Robot
a5e337b0b3 Merge "Keystore 2.0: Enable by default." 2021-03-19 16:06:00 +00:00
Remi NGUYEN VAN
bdf107dab7 Add TEST_MAPPING for Connectivity
The TEST_MAPPING triggers connectivity tests in other paths.

Bug: 183198868
Change-Id: I8d9b0450ea4b3ef3e5115d1f858b1aa7badef742
Test: Needs treehugger for testing
2021-03-19 16:03:14 +00:00
Remi NGUYEN VAN
9767b681e3 Fix InetAddressCompat exception handling
Fix InetAddressCompat exception handling to throw the original exception
in case of InvocationTargetException, rather than wrapping in a generic
IllegalStateException.

Bug: 183198868
Test: Test device with and without connectivity
Change-Id: Idc4d678afe9f20f920d7061790af4203ab75be26
2021-03-19 23:56:27 +09:00
SongFerngWang
84bced4979 The phone didn't reload the allowed Network Type
Reload the allowed Network after device insert SIM card.
Change the behavior of notifyAllowedNetworkTypesChanged.
Log print String representation of the allowed network types.
Bug: 180903931
Bug: 179814490
Test: atest cts/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java#testSetAllowedNetworkTypesForReason_moreReason
atest cts/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java#testSetAllowedNetworkTypesForReason
atest android.telephony.cts.TelephonyCallbackTest

Change-Id: Icfffea3c74ecf6938455d841da9d6175f6aa07de
Merged-In: Icfffea3c74ecf6938455d841da9d6175f6aa07de
2021-03-19 21:56:17 +08:00
SongFerng Wang
3ccc2738e2 Merge "Implementation of "Enable 2G" for Settings." 2021-03-19 13:09:55 +00:00
Treehugger Robot
0afaa9d9f6 Merge "Reset min_sdk_version of libmedia_jni" 2021-03-19 11:41:03 +00:00
Chiachang Wang
b53aeb4682 Merge "Add startCaptivePortalApp to system API" 2021-03-19 11:30:20 +00:00
Treehugger Robot
79d2054b14 Merge changes I18d2ccea,I4e80a75d,Ib8ea2a17,Iaba678ed
* changes:
  Remove hidden API usage of RouteInfo
  Remove reference of NetworkAgent#unwanted()
  Remove references of NetworkAgentConfig constructor
  Remove reference of @ValidationStatus annotation
2021-03-19 11:23:18 +00:00
Chalard Jean
e07e3856da Merge "[NS03] Mix in other CS-managed properties" 2021-03-19 10:32:46 +00:00
Lucas Lin
46e3f1822d Merge "Expose getCapabilities" 2021-03-19 10:24:25 +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
Zoey Chen
a805d39229 Merge "[Telephony] Return if context is null when register TelephonyCallback" 2021-03-19 09:28:41 +00:00
Yo Chiang
544f3d5211 Merge "Keystore 2.0: Fix infinit recursion." 2021-03-19 08:10:39 +00:00
Janis Danisevskis
8758b2ceaf Keystore 2.0: Fix infinit recursion.
Fix endless recursion when Cipher is initialized with
AndroidKeyStorePrivateKey.

Fixes: 183167349
Test: atest android.keystore.cts.AndroidKeyStoreTest#testKeyStore_Encrypting_RSA_NONE_NOPADDING
Change-Id: I5b4166fb1a4e298072f7156ba61a64966e86dc53
2021-03-19 08:09:34 +00:00
Chiachang Wang
8ce1fa2313 Merge "Send a Network instead of network id for wifi no internet dialog" 2021-03-19 07:54:24 +00:00
Aaron Huang
3f4d2a6f67 Merge "Remove hidden API usage from ProxyTracker" 2021-03-19 07:50:27 +00:00
junyulai
bcb58a9757 Remove hidden API usage of RouteInfo
For callers who use hidden constructor of RouteInfo, replace
them with public constructor.

Test: TH
Bug: 182963397
Merged-In: I18d2cceafad633a95bd909b7f693d45e8a861bc9
Change-Id: I18d2cceafad633a95bd909b7f693d45e8a861bc9
  (cherry-picked from ag/13925164)
2021-03-19 15:49:38 +08:00