* 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
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
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
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
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
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
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
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
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
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
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
Move disk reading to background to improve performance on user
unlocking.
Bug: 182098676
Test: atest AppHibernationServiceTest
Change-Id: I087bd9d29f4f90c818a03648ee75e3cbfb2ded41
Add API to AppHibernationService to get hibernating packages so
Settings can access this information.
Bug: 175829330
Test: atest AppHibernationServiceTest
Change-Id: Icd186807c19ece55a21fc4d240d2f0132951af82
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
The TEST_MAPPING triggers connectivity tests in other paths.
Bug: 183198868
Change-Id: I8d9b0450ea4b3ef3e5115d1f858b1aa7badef742
Test: Needs treehugger for testing
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
* changes:
Remove hidden API usage of RouteInfo
Remove reference of NetworkAgent#unwanted()
Remove references of NetworkAgentConfig constructor
Remove reference of @ValidationStatus annotation
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)