Commit Graph

538 Commits

Author SHA1 Message Date
Treehugger Robot
80d92cb03c Merge "Move trimV4AddrZeros to libs/net" am: 22cb7841a5 am: bc1c1bc38e am: 7fd39d2852
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1636022

Change-Id: I7908772ff2f3b2c5fc1dd9a3510fce0f7ee78ba5
2021-03-22 12:31:39 +00:00
Remi NGUYEN VAN
39a9de44ef Merge "Add SystemMessages protos to Connectivity" am: 470e9e0e19 am: 5cf377d2a3 am: 898073e357
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626204

Change-Id: Ia8a06a0d6f5dcdbdc672149ff206aada83478f23
2021-03-22 12:31:07 +00:00
Jayachandran Chinnakkannu
687d2a3118 Merge "Swap parameters in QosCallback#registerQosCallback" am: dcc2fb2a19 am: 507df2663e am: 2e744846a0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628901

Change-Id: Ice84bb2e6d855ed88e7e432cf49739e69c9e01de
2021-03-22 12:30:40 +00:00
Roshan Pius
3150cd0249 [automerger skipped] resolve merge conflicts of 454f122745 to stage-aosp-master am: 122fc06389 am: efd2d89db8 -s ours
am skip reason: skip tag Change-Id Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3 with SHA-1 1e97e45498 is already in history

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

Change-Id: I945ee90092cf1f8001a92b72a66373d92fbcd326
2021-03-22 12:28:37 +00:00
Chiachang Wang
9e264c0d3c [automerger skipped] Revert "Revert "Expose uids related APIs in NetworkRequest and N..." am: 628cb1187e -s ours am: c2b19b07ee -s ours am: 881130bd85 -s ours
am skip reason: skip tag Change-Id I107c329d4d7130d488772166eae8b5e7aaa2ff04 with SHA-1 aacf237c27 is already in history

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

Change-Id: I9986ddce8827a85982b0846e18044fc45ec95c24
2021-03-22 12:28:01 +00:00
Lorenzo Colitti
84e5ff14e6 [automerger skipped] Merge changes from topic "backport-connectivityresources" am: 2cff13b0fc am: 2752f7f4b1 am: cec8be5ba4 -s ours
am skip reason: skip tag Change-Id Ic0d24d36af0b87153d527083f8964ddc6cd78482 with SHA-1 a338d5aa58 is already in history

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

Change-Id: Ie24e96154851ddeac6971e4bfa49a0eb43e5915c
2021-03-22 12:27:31 +00:00
Remi NGUYEN VAN
962f78e3fe [automerger skipped] Add connectivity protos to framework-connectivity am: f96b26606a am: 5b8376a888 am: 3efdf7d59d -s ours
am skip reason: skip tag Change-Id I2c4a37ff2ee9e8efde49885feeafa27dcff7ca2c with SHA-1 8c2d521b8d is already in history

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

Change-Id: I593f9d014d29a8041c9acbe1f3034f15613c88b5
2021-03-22 12:27:12 +00:00
Remi NGUYEN VAN
c314efd04e [automerger skipped] Move connectivity AIDLs to android.net am: 43dea2835e am: 5814872f7e am: abfe20b16d -s ours
am skip reason: skip tag Change-Id I611f1941698c574e37aea912ee76dadc8b32e41a with SHA-1 60ad218d72 is already in history

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

Change-Id: Ice5060b366cfb6cbce6e6151f2fb1a1208e9b939
2021-03-22 12:26:41 +00:00
Remi NGUYEN VAN
c8d95044c0 [automerger skipped] Migrate framework-connectivity internal resources am: 5245c4c0f0 am: a5e5949870 am: 842b3e6a57 -s ours
am skip reason: skip tag Change-Id I77a3efca2cd644f9828db1ed5d3cae8070fb8363 with SHA-1 749a39a431 is already in history

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

Change-Id: I17ffd47283c43a6df1e61ca9ef864ca32d99e4e9
2021-03-22 12:26:31 +00:00
Remi NGUYEN VAN
e26b3af678 [automerger skipped] Add multipath preference, background status API am: e62e7ff645 am: 82f56fccb8 am: ff56893947 -s ours
am skip reason: skip tag Change-Id I8a03162b2f6691086bb64e75ffd354cdfca7f86a with SHA-1 1fdeb50d9a is already in history

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

Change-Id: I147c04bb30ed920679d88cd765b7517ca4fbd12e
2021-03-22 12:26:13 +00:00
Lorenzo Colitti
82c0fab0f0 [automerger skipped] Merge "Copy NetworkNotificationManager resources to conectivity module." am: 6d5c278d15 am: 1914eecf5c am: 4b623b3194 -s ours
am skip reason: skip tag Change-Id I99c0d28069dd1a13d452105b0a83a03a833232a2 with SHA-1 cd2bf4959f is already in history

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

Change-Id: I97d82338363702be56963839a241e1d72c1e9c86
2021-03-22 11:00:35 +00:00
Remi NGUYEN VAN
411f6477c6 Merge "Add NetworkFactory to connectivity jarjar rules" into sc-dev 2021-03-22 09:27:06 +00:00
Lucas Lin
fb570e771a Merge "Expose some APIs from ConnectivityManager" into sc-dev 2021-03-22 06:44:49 +00:00
lucaslin
97fb10a3a6 Expose some APIs from ConnectivityManager
- Expose setRequireVpnForUids to Vpn.java
- Expose setLegacyLockdownVpnEnabled to LockdownVpnTracker.java
- Expose requestRouteToHostAddress to
  GnssNetworkConnectivityHandler.java

Bug: 182963397
Test: m
Change-Id: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c
2021-03-22 11:51:27 +08:00
Remi NGUYEN VAN
8c1b75521a Add NetworkFactory to connectivity jarjar rules
NetworkFactory is part of net-utils-device-common, but is outside of
the com.android.net.module.util and needs a separate jarjar rule.

Bug: 171540887
Test: atest FrameworksNetTests
Change-Id: Iec828a789175acdbe4e7f35e4cc942922540495c
2021-03-22 03:50:15 +00:00
Treehugger Robot
bc1c1bc38e Merge "Move trimV4AddrZeros to libs/net" am: 22cb7841a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1636022

Change-Id: Ifbad5630a39f8990479a5f20e018a3a499334fe1
2021-03-22 03:23:48 +00:00
Remi NGUYEN VAN
5cf377d2a3 Merge "Add SystemMessages protos to Connectivity" am: 470e9e0e19
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626204

Change-Id: I8648b09a97485dcecac2e5075d605e79a730ec3f
2021-03-22 03:20:45 +00:00
Jayachandran Chinnakkannu
507df2663e Merge "Swap parameters in QosCallback#registerQosCallback" am: dcc2fb2a19
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1628901

Change-Id: I2c371b6f1dc25f84a389480e46d9d582e9da148b
2021-03-22 03:18:17 +00:00
Lorenzo Colitti
6660a1b53a Merge "Use connectivity resources in service-connectivity" into sc-dev 2021-03-22 02:21:13 +00:00
Treehugger Robot
22cb7841a5 Merge "Move trimV4AddrZeros to libs/net" 2021-03-22 01:37:06 +00:00
Remi NGUYEN VAN
e8753c9a7d Merge "Use jniThrowErrnoException from JNIHelp" into sc-dev 2021-03-22 00:20:36 +00:00
Remi NGUYEN VAN
470e9e0e19 Merge "Add SystemMessages protos to Connectivity" 2021-03-21 23:58:00 +00:00
Jayachandran Chinnakkannu
dcc2fb2a19 Merge "Swap parameters in QosCallback#registerQosCallback" 2021-03-21 21:02:36 +00:00
Roshan Pius
122fc06389 resolve merge conflicts of 454f122745 to stage-aosp-master
Merged-In: Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3
Change-Id: Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3
2021-03-21 19:20:35 +00:00
Roshan Pius
1e97e45498 resolve merge conflicts of 403b7fd0b0a6736bcee1817fb5c774f8c8a040de to stage-aosp-master
Change-Id: Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3
2021-03-21 19:16:33 +00:00
Chiachang Wang
c2b19b07ee [automerger skipped] Revert "Revert "Expose uids related APIs in NetworkRequest and N..." am: 628cb1187e -s ours
am skip reason: skip tag Change-Id I107c329d4d7130d488772166eae8b5e7aaa2ff04 with SHA-1 0c32e09028 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
2752f7f4b1 Merge changes from topic "backport-connectivityresources" am: 2cff13b0fc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645297

Change-Id: Id6e8f89870b70332212e9052168e6f7c2faa3ee3
2021-03-21 16:51:02 +00:00
Remi NGUYEN VAN
5b8376a888 Add connectivity protos to framework-connectivity am: f96b26606a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635040

Change-Id: Idebb84324407d0ce2f0066888b14fc22df736515
2021-03-21 16:45:11 +00:00
Remi NGUYEN VAN
5814872f7e Move connectivity AIDLs to android.net am: 43dea2835e
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
454f122745 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
a5e5949870 Migrate framework-connectivity internal resources am: 5245c4c0f0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641905

Change-Id: I21a5632d566b2ef883c48f60b420fb76d04a3e05
2021-03-21 16:38:40 +00:00
Remi NGUYEN VAN
82f56fccb8 Add multipath preference, background status API am: e62e7ff645
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
2cff13b0fc 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
Lorenzo Colitti
4b79f7bd56 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
Remi NGUYEN VAN
9f4fad49a5 Use connectivity resources in service-connectivity
Migrate resource usage to the connectivity resource package.
For framework resources that have known overlays, keep a fallback until
the overlays can be migrated.

Bug: 182125649
Test: atest FrameworksNetTests
Change-Id: I778d94a5aac0c4e20e78b1ba3a002495c17a38a0
2021-03-21 01:39:51 +09:00
Lorenzo Colitti
1914eecf5c Merge "Copy NetworkNotificationManager resources to conectivity module." am: 6d5c278d15
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
6d5c278d15 Merge "Copy NetworkNotificationManager resources to conectivity module." 2021-03-20 13:52:46 +00:00
Remi NGUYEN VAN
f96b26606a 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
Remi NGUYEN VAN
43dea2835e 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
5245c4c0f0 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
Remi NGUYEN VAN
e62e7ff645 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
3a5b922890 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
Roshan Pius
e2d2838805 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
Treehugger Robot
903fec2c31 Merge "Fix InetAddressCompat exception handling" am: cd37173df6 am: 0355d169e1 am: f8583062fd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645300

Change-Id: I6b1aa628a1c48c4c7ed02a4d379cab2316b13526
2021-03-19 18:44:03 +00:00
Treehugger Robot
0355d169e1 Merge "Fix InetAddressCompat exception handling" am: cd37173df6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645300

Change-Id: I1d65d6b011e5ce585835e1c9df9eea0afb74b0f4
2021-03-19 17:21:29 +00:00
TreeHugger Robot
73cdd8195a Merge "[NS03] Mix in other CS-managed properties" into sc-dev 2021-03-19 17:07:21 +00:00
TreeHugger Robot
bf463c5119 Merge "Use module resources in NetworkNotificationManager." into sc-dev 2021-03-19 16:54:49 +00:00
TreeHugger Robot
a9a0b49bbc Merge "Fix InetAddressCompat exception handling" into sc-dev 2021-03-19 16:14:10 +00:00
Lorenzo Colitti
a338d5aa58 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
2021-03-20 00:21:21 +09:00
Lorenzo Colitti
4132a57683 Merge "Copy NetworkNotificationManager resources to conectivity module." into sc-dev 2021-03-19 15:18:34 +00:00