Commit Graph

566064 Commits

Author SHA1 Message Date
Roshan Pius
fdc5eb6e56 resolve merge conflicts of 403b7fd0b0 to stage-aosp-master
Merged-In: Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3
Change-Id: Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3
2021-03-21 19:20:35 +00:00
Chiachang Wang
964605dc23 [automerger skipped] Revert "Revert "Expose uids related APIs in NetworkRequest and N..." am: b0c6107723 -s ours
am skip reason: skip tag Change-Id I107c329d4d7130d488772166eae8b5e7aaa2ff04 with SHA-1 11403c6b1b is already in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646848

Change-Id: I1773af223afb67d522cc05d3658608505340023e
2021-03-21 16:55:29 +00:00
Lorenzo Colitti
b8acfc2327 Merge changes from topic "backport-connectivityresources" am: 744e27a39e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645297

Change-Id: Id6e8f89870b70332212e9052168e6f7c2faa3ee3
2021-03-21 16:51:02 +00:00
Lorenzo Colitti
127c8b8336 Cherry-pick some test changes from ag/13210542. am: 250710c687
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645000

Change-Id: Iebfee24a963aac516bf44ef70128ffdaeec25a45
2021-03-21 16:48:06 +00:00
Remi NGUYEN VAN
86fd14bae2 Add connectivity protos to framework-connectivity am: 3b0736735b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635040

Change-Id: Idebb84324407d0ce2f0066888b14fc22df736515
2021-03-21 16:45:11 +00:00
paulhu
f994ab199c Remove unused NetworkPolicyManagerInternal in CS am: 279b33817f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646969

Change-Id: I5a838b1017d1648e67576bfd7940ea9161b2c764
2021-03-21 16:43:40 +00:00
Remi NGUYEN VAN
7848a89499 Move connectivity AIDLs to android.net am: 3a680dc897
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1596272

Change-Id: If61c15ea55ec2081eab7fd2368e77f16ef51c769
2021-03-21 16:41:38 +00:00
Treehugger Robot
403b7fd0b0 Merge changes from topics "revert-1645768-revert-1626206-replaceUidRange-MSYTKFNGUE-HIUTVTIGIR", "ti_redaction"
* changes:
  TransportInfo: Add a generic redaction mechanism
  Revert "Revert "Expose uids related APIs in NetworkRequest and N..."
  Revert^2 "Replace the usage of UidRange"
2021-03-21 16:41:13 +00:00
Remi NGUYEN VAN
2c1e6d836c Migrate framework-connectivity internal resources am: 4f8084867e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641905

Change-Id: I21a5632d566b2ef883c48f60b420fb76d04a3e05
2021-03-21 16:38:40 +00:00
Lorenzo Colitti
6a4ff66e39 Expose isUidNetworkingBlocked and isUidRestrictedOnMeteredNetworks am: f969377a96
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644390

Change-Id: If8a984d3bc2dbfb2d326079d5015c4bdc4edb8f7
2021-03-21 16:38:04 +00:00
Remi NGUYEN VAN
19efae9ff9 Add multipath preference, background status API am: 00b8d2cf37
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644388

Change-Id: I4c1a53223c4cce7759b2cc3efb74a6568abcde57
2021-03-21 16:37:02 +00:00
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
Hui Wang
e6cbb031cd Merge "Add VoPS support info for NR" am: 98763306a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1585530

Change-Id: If4f0593db67b8a98a78b73fba67e0383d1bc7a31
2021-03-21 04:42:56 +00:00
Hui Wang
98763306a2 Merge "Add VoPS support info for NR" 2021-03-21 04:12:52 +00: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
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
d4aaa768f5 Merge "Copy NetworkNotificationManager resources to conectivity module." am: 4cc71277cd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644996

Change-Id: I97d371fc7c299828c34d1d60965e9f4959e685a3
2021-03-20 14:30:22 +00: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
Kevin Han
c4d1d01adf Merge changes from topic "app_hibernation_permission" am: 4dfa5f8db4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624868

Change-Id: I55b8dc7dfa171b5d11098320445932ef2f91bcbf
2021-03-20 01:54:16 +00:00
Kevin Han
0a4f736c02 Add MANAGE_APP_HIBERNATION permission am: 152e389bae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646329

Change-Id: I37eff0481323e733dc71ee770387ad6106e6753c
2021-03-20 01:51:25 +00: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
b84823ab48 Merge "AudioTrack: get/setStartThresholdInFrames" am: 64e333a250
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644446

Change-Id: I17cc6c57b7079b8a8b674e5fe3e13f1abac00e04
2021-03-20 01:31:42 +00:00
Andy Hung
64e333a250 Merge "AudioTrack: get/setStartThresholdInFrames" 2021-03-20 01:04:28 +00:00
Treehugger Robot
e8ed5b17cf Merge "Return 0 instead of throwing RuntimeException from getSmsCapacityOnIcc" am: 258ecb55a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1643623

Change-Id: I8ba7927d29d920e5e6526f9fed9ba6d1813f0ce0
2021-03-20 00:32:15 +00:00
Chienyuan Huang
c1b4ca0ef5 Merge "Le Scan: Add ambient discovery mode (1/2)" am: 4a47532570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1629277

Change-Id: I22fb8518bd1ab6f30b3de88905c60c538685e41b
2021-03-20 00:29:17 +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
1f58a4bf12 Merge "Support MTE and GWP-ASan features in proto tombstones." am: efad4dcd74
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625208

Change-Id: I6a7c0eb2243ec2a5896d2967c865486d0f96508b
2021-03-20 00:25:55 +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
95445c287c Merge "Switch to bionic's pidfd_open." am: 680aaa9195
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1646356

Change-Id: Ib5c723f6903cfa22c8b640e1d45184bee5b90afe
2021-03-19 22:46:54 +00:00
Josh Gao
680aaa9195 Merge "Switch to bionic's pidfd_open." 2021-03-19 22:42:22 +00:00
Tej Singh
975acea8a5 Merge changes from topic "tej_isolate_protologging" am: d5127dceb0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639879

Change-Id: Ibb3c5666ff965737ced284d548345b45ef50a2ce
2021-03-19 22:41:51 +00:00
Tej Singh
4235756ab9 Move service/enums.proto to proto_logging am: 91bceaae7a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639218

Change-Id: Ib6a8983905e64775b8ef83a7c7fd40d0f4274029
2021-03-19 22:38:20 +00:00
Tej Singh
6d2b61df0d Add usb and networkcapabilities back to core/proto am: 185bb90134
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639216

Change-Id: Ie2ca82db9647a820d9a39d35e0c65b1f8b879a36
2021-03-19 22:35:13 +00: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
9f8fd40407 Merge changes from topic "bluetooth_oob_api" am: 55fe87b2f6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640633

Change-Id: I1881ca6a693ec27e78e3f781d87858f27858efbc
2021-03-19 21:44:45 +00:00
Martin Brabham
b4f9ff1810 Bluetooth: Modify and append to the Out-of-Band API am: 96e6e4a0b3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556758

Change-Id: I25e393b48f0598834196c970be4d29f20216af97
2021-03-19 21:37:27 +00:00
Christian Wailes
4f5e3b92f7 Merge "Update OWNERS file" am: d6c3dfb3ff
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640627

Change-Id: Ibfb0fa8b55f2a5bdb7d732287d246729bdd3b576
2021-03-19 21:32:14 +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
32e4b44b47 Merge "OWNERS for a few Voice Interaction files." am: d702544c9f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1643650

Change-Id: Ic7929a7dea98f94a3e3d4082eeace63d6c6fe714
2021-03-19 19:56:11 +00:00
Jeff Sharkey
d702544c9f Merge "OWNERS for a few Voice Interaction files." 2021-03-19 19:21:48 +00:00