Commit Graph

455 Commits

Author SHA1 Message Date
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
cd2bf4959f 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
2021-03-20 00:16:17 +09:00
Chalard Jean
21a92566fd Merge "[NS02] Mix in validation of the score" am: b68825591b am: f6ad9e71b2 am: 37e8ecdb9a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556100

Change-Id: I4a622efe89f7d116751d0243ba29441ef76e997a
2021-03-19 07:27:43 +00:00
Chalard Jean
f6ad9e71b2 Merge "[NS02] Mix in validation of the score" am: b68825591b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556100

Change-Id: I229c3033a16d6b7f11f1b3f02351cc0d2153d199
2021-03-19 06:05:28 +00:00
Remi NGUYEN VAN
3b52af9c6e Build framework-connectivity using module_current
framework-connectivity needs to build only against stable APIs.

Bug: 171540887
Test: m framework-connectivity.impl
Change-Id: I2d51d37d067bf6fe86e4dedf05855a2dd67ed57c
2021-03-19 06:02:43 +00:00
Chalard Jean
b68825591b Merge "[NS02] Mix in validation of the score" 2021-03-19 05:39:40 +00:00
Treehugger Robot
6ae29ff41a Merge "CaptivePortalData: use CharSequence in VenueFriendlyName API" am: 33457035e7 am: 32f85c2cf3 am: 281f77c93c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640985

Change-Id: I933407d55e33a2cfac44ded44bc58fc0deb9da80
2021-03-19 05:32:21 +00:00
Chalard Jean
1dddf2671e [NS02] Mix in validation of the score
Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Change-Id: I9cac3a05ad0c4008599973b12d2c5e4c02233a5c
2021-03-19 13:50:56 +09:00
Remi NGUYEN VAN
eed43af3a4 Merge "Remove Preconditions usage in TestNetworkSpecifier" into sc-dev 2021-03-19 04:49:52 +00:00
Remi NGUYEN VAN
6b40be797e Merge "Revert "Revert "Remove connectivity dependency on Preconditions""" into sc-dev 2021-03-19 04:49:06 +00:00
Treehugger Robot
32f85c2cf3 Merge "CaptivePortalData: use CharSequence in VenueFriendlyName API" am: 33457035e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640985

Change-Id: I26db95ad9d91dec40a62b7e4c4c0b77133ddb5d3
2021-03-19 04:42:53 +00:00
Treehugger Robot
33457035e7 Merge "CaptivePortalData: use CharSequence in VenueFriendlyName API" 2021-03-19 04:13:36 +00:00
Remi NGUYEN VAN
7e0ffd0ec4 Merge "Add InetAddressCompat" am: 871321f41b am: 2c311c8b74 am: 0afced9423
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645289

Change-Id: I90dba64e96080cbd29f538de6dcb514dea4b6cbd
2021-03-19 02:52:58 +00:00
Remi NGUYEN VAN
61e1e15104 Merge "Move network selection utils to Connectivity" am: d3410e053e am: da9eba3873 am: 73d3166547
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645291

Change-Id: I0b984a01e1688b8484f3500945d0e429e1b3ca00
2021-03-19 02:52:41 +00:00
Remi NGUYEN VAN
2c311c8b74 Merge "Add InetAddressCompat" am: 871321f41b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645289

Change-Id: I6946ca309ae923a637f5e5f0ad73c91b26b3c376
2021-03-19 00:39:34 +00:00
Remi NGUYEN VAN
bcd9def075 Remove Preconditions usage in TestNetworkSpecifier
Preconditions is a hidden API utility. It can be easily replace by
inline checks.

Bug: 177046265
Test: m
Change-Id: I3f722075fb9c74e12e40348ba4faad2f0fa67178
2021-03-19 00:35:27 +00:00
Remi NGUYEN VAN
1818dbb99a Revert "Revert "Remove connectivity dependency on Preconditions""
Preconditions.checkNotNull is deprecated to be replaced by
Objects.requireNonNull, and other methods can easily be replaced by
inline checks.

Preconditions is an internal API class that should not be used by
unbundled jars.

Bug: 177046265
Change-Id: I3a67d266b32142c034520acbcdc30f7213db5e13
Test: m
2021-03-19 00:35:27 +00:00
Remi NGUYEN VAN
da9eba3873 Merge "Move network selection utils to Connectivity" am: d3410e053e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645291

Change-Id: I452591707a97b501f189fa9f61e90da842fa3734
2021-03-19 00:35:03 +00:00
Remi NGUYEN VAN
871321f41b Merge "Add InetAddressCompat" 2021-03-18 23:58:16 +00:00
Remi NGUYEN VAN
d3410e053e Merge "Move network selection utils to Connectivity" 2021-03-18 23:57:34 +00:00
Anthony Stange
f968c741b8 Merge changes from topic "revert-1626206-replaceUidRange-MSYTKFNGUE" am: 35b926cc47 am: e0eeb8261e am: ed172af621
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645768

Change-Id: Ia5cedb12112b04885c3f9270b9171c6494b8d2af
2021-03-18 18:29:41 +00:00
Lucas Lin
7d528eeee3 Merge "Expose systemReady for SystemServer" am: 56564e061c am: d77b8f6384 am: a71f7d4697
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640142

Change-Id: I95488b39a32ed9086839eab6c457ed6f75472df1
2021-03-18 18:27:08 +00:00
Chiachang Wang
866e634681 Merge changes from topic "replaceUidRange" am: 268a9f56f2 am: a0f1955623 am: 4195f030e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626206

Change-Id: Ibc5e47f175a0e5433492f81068da9f42496e660b
2021-03-18 18:26:42 +00:00
Chiachang Wang
c93ae1c2a9 Merge "Expose APIs for Settings" am: e584943ca1 am: 65ec6feca0 am: 9ecd16980c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644202

Change-Id: I13a56aa7dcc19efef3dc268fabfa52069360eb18
2021-03-18 18:26:16 +00:00
Chalard Jean
3303b63519 Merge "Move constants to MODULE_LIB" am: 8c288603d1 am: 9759496ca0 am: 42e932bc2e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640141

Change-Id: I514f5a3d1a4b1498f58170ac652ede394ddf6aeb
2021-03-18 18:24:57 +00:00
Anthony Stange
e0eeb8261e Merge changes from topic "revert-1626206-replaceUidRange-MSYTKFNGUE" am: 35b926cc47
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645768

Change-Id: I311d4e3e5718afbe7d9817a4c85040d8afe5d66d
2021-03-18 17:02:59 +00:00
Anthony Stange
35b926cc47 Merge changes from topic "revert-1626206-replaceUidRange-MSYTKFNGUE"
* changes:
  Revert "Replace the usage of UidRange"
  Revert "Expose uids related APIs in NetworkRequest and NetworkCa..."
2021-03-18 16:40:53 +00:00
Anthony Stange
b6c51b2c97 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
fa6349a6c7 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
Remi NGUYEN VAN
5bfc990e4a Move network selection utils to Connectivity
NetworkScore, IOnCompleteListener should be in the Connectivity scope,
as they are supporting classes for the ConnectivityManager APIs.

Bug: 181512874
Test: m
Change-Id: I6dc40a80e0bf5f86f5625b657b01eba969d41fcf
2021-03-18 23:57:26 +09:00
Remi NGUYEN VAN
342ddddd9d Add InetAddressCompat
Although the InetAddress symbols used by Connectivity are stable core
platform API, and should be usable, the core_current stubs are not yet
part of the module_current API.
Until that is fixed, add an InetAddressCompat utility that calls the
three static methods by reflection.

Test: atest FrameworksNetTests CtsNetTestCases
Bug: 183097033
Change-Id: I797009aeff1d39ae2dc06ef69d2e235689b43c89
2021-03-18 23:54:04 +09:00
Paul Hu
4e8bb42a55 resolve merge conflicts of c85aeee86ec35f9e942e02e7d13450dce47b1325 to sc-dev
Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: Idd5d75e0e9a7ad4f840b88da55d28fbaa2275dd0
2021-03-18 14:50:05 +00:00
Remi NGUYEN VAN
a796abb03f Merge changes I4ad0ca60,I8a03162b into sc-dev
* changes:
  Expose isUidNetworkingBlocked and isUidRestrictedOnMeteredNetworks
  Add multipath preference, background status API
2021-03-18 14:07:12 +00:00
Lucas Lin
d77b8f6384 Merge "Expose systemReady for SystemServer" am: 56564e061c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640142

Change-Id: I4680cd76d6e5c074e291bddcf1bd4bd3871365a1
2021-03-18 14:05:03 +00:00
Chiachang Wang
a0f1955623 Merge changes from topic "replaceUidRange" am: 268a9f56f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626206

Change-Id: I3d62d9c03ab6a418e23dd6c5e6f8317b7b375f9c
2021-03-18 14:01:33 +00:00
Chiachang Wang
65ec6feca0 Merge "Expose APIs for Settings" am: e584943ca1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1644202

Change-Id: Ia47e8efc3cc3f40b396c0aa0bd49afea2385e9c3
2021-03-18 13:53:36 +00:00
Lucas Lin
56564e061c Merge "Expose systemReady for SystemServer" 2021-03-18 13:40:54 +00:00
Chiachang Wang
268a9f56f2 Merge changes from topic "replaceUidRange"
* changes:
  Expose uids related APIs in NetworkRequest and NetworkCapabilities
  Replace the usage of UidRange
2021-03-18 13:36:39 +00:00
Chiachang Wang
e584943ca1 Merge "Expose APIs for Settings" 2021-03-18 13:27:47 +00:00
Chalard Jean
9759496ca0 Merge "Move constants to MODULE_LIB" am: 8c288603d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1640141

Change-Id: Ib22b9f3223af2cfe51438e2e19584ec089a4e9d2
2021-03-18 12:55:57 +00:00
Paul Hu
fd85356b4d Merge "Add more connectivity module settings" am: b998511728
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641784

Change-Id: If6fab011720145f2ba18df478e6660be442bcad5
2021-03-18 12:53:52 +00:00
Chalard Jean
8c288603d1 Merge "Move constants to MODULE_LIB" 2021-03-18 12:29:38 +00:00
Paul Hu
b998511728 Merge "Add more connectivity module settings" 2021-03-18 12:22:55 +00:00
Remi NGUYEN VAN
b81eff2192 Merge changes I77a3efca,I2c4a37ff into sc-dev
* changes:
  Migrate framework-connectivity internal resources
  Add connectivity protos to framework-connectivity
2021-03-18 11:16:25 +00:00
Remi NGUYEN VAN
e5a4a9a078 [automerger skipped] Remove extra comment am: efd24e0f3a am: 79672e35a3 -s ours
am skip reason: skip tag Change-Id I0c0daa91ef272a19c548cf55eb2f764c95f8f844 with SHA-1 bcea4c8e06 is already in history

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

Change-Id: Ia8523fc8557bea3d9635d23472e4301e9b43fde5
2021-03-18 10:42:10 +00:00
Remi NGUYEN VAN
749a39a431 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
2021-03-18 09:02:13 +00:00
Remi NGUYEN VAN
8c2d521b8d 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
2021-03-18 08:07:20 +00:00
Remi NGUYEN VAN
efd24e0f3a Remove extra comment
This fixes a merge conflict with downstream branches due to an
incomplete cherry-pick.

Bug: 171540887
Test: m

Merged-In: I0c0daa91ef272a19c548cf55eb2f764c95f8f844
Change-Id: I0ec602f573698578e4d72d38772c39a1b88b87d2
2021-03-18 07:11:48 +00:00
Remi NGUYEN VAN
1fdeb50d9a 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
2021-03-18 06:08:00 +00:00
Remi NGUYEN VAN
2c196b6487 Merge "Add framework-connectivity.impl" am: 0fcb8d6db4 am: 5e478bf5bf am: 954160f749
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635039

Change-Id: Ief30f77f949669d9b52ae3a6fe84f8db91179841
2021-03-18 04:36:38 +00:00