Commit Graph

480 Commits

Author SHA1 Message Date
Lorenzo Colitti
4132a57683 Merge "Copy NetworkNotificationManager resources to conectivity module." into sc-dev 2021-03-19 15:18:34 +00: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
4be4b3eee7 Merge "Reland: CaptivePortalData: use CharSequence in VenueFriendlyName API" into sc-dev 2021-03-19 14:26:06 +00:00
Remi NGUYEN VAN
d5248e068a Merge "Move NetworkUtils JNI out of core/jni" into sc-dev 2021-03-19 13:42:54 +00:00
Chiachang Wang
abe928e7eb Merge "Add startCaptivePortalApp to system API" am: 1756295fc5 am: c5472a3cf7 am: 8020cb4517
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639899

Change-Id: Ia3be29892f62b82d23a165bc8334a083c674aefb
2021-03-19 13:09:03 +00:00
Chiachang Wang
c5472a3cf7 Merge "Add startCaptivePortalApp to system API" am: 1756295fc5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1639899

Change-Id: I2efbc3276ccce8df4d77c06dc2d50bd4d2bed9b5
2021-03-19 11:59:16 +00:00
Chalard Jean
4a22d06d85 Merge "[NS03] Mix in other CS-managed properties" am: 80e17b0086 am: e5421446a7 am: 69c741ec42
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556101

Change-Id: I20c4d8392dba72b142cd9cdf15bed94d52848b81
2021-03-19 11:32:34 +00:00
Lucas Lin
7ead06e186 Merge "Expose getCapabilities" am: ca98471c77 am: f21c73b7ad am: 00a76b180b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641919

Change-Id: I9a6b6f405ee4b7d5d03173d6c5e22e1018dc3417
2021-03-19 11:32:07 +00:00
Chiachang Wang
1756295fc5 Merge "Add startCaptivePortalApp to system API" 2021-03-19 11:30:20 +00:00
Remi NGUYEN VAN
c58c993dda Move NetworkUtils JNI out of core/jni
Keep the utilities included via a library, but move them out of
core/jni, and prepare a library to package them together with
framework-connectivity.

Also remove unnecessary dependencies in framework-connectivity.

Bug: 171540887
Test: device boots and has connectivity

Change-Id: I0b55dfe92f3cb6e848d79ac7953756f39aaa2597
2021-03-19 11:01:17 +00:00
Chalard Jean
e5421446a7 Merge "[NS03] Mix in other CS-managed properties" am: 80e17b0086
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556101

Change-Id: I7b904af6c34190f53378cc1acc518840b527d434
2021-03-19 10:52:23 +00:00
Remi NGUYEN VAN
db597e7819 Merge "Move connectivity AIDLs to android.net" into sc-dev 2021-03-19 10:51:22 +00:00
Lucas Lin
f21c73b7ad Merge "Expose getCapabilities" am: ca98471c77
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1641919

Change-Id: Ie524f7538aa7a7048c55097c0995d8c6194dc682
2021-03-19 10:49:12 +00:00
Chiachang Wang
473b69519b Merge "Expose constants of ConnectivityManager" into sc-dev 2021-03-19 10:40:49 +00:00
Chalard Jean
80e17b0086 Merge "[NS03] Mix in other CS-managed properties" 2021-03-19 10:32:46 +00:00
Chiachang Wang
b98d22d6f5 Merge changes from topic "replaceUidRange" into sc-dev
* changes:
  Expose uids related APIs in NetworkRequest and NetworkCapabilities
  Replace the usage of UidRange
2021-03-19 10:32:30 +00:00
Lucas Lin
ca98471c77 Merge "Expose getCapabilities" 2021-03-19 10:24:25 +00:00
Hai Shalom
60372ff53d Reland: CaptivePortalData: use CharSequence in VenueFriendlyName API
Following up on feedback from API council, change the String type
to CharSequence in the get and set Venue friendly name API.

Bug: 179163405
Test: atest ConnectivityServiceTest CtsNetTestCasesLatestSdk:CaptivePortalDataTest
Test: atest NetworkNotificationManagerTest NetworkMonitorTest
Change-Id: Ifa3ea9aae0cabf5757791c4ae13e6f551759ed97
2021-03-19 09:40:34 +00:00
Remi NGUYEN VAN
66df804393 Merge "Revert "CaptivePortalData: use CharSequence in VenueFriendlyName API"" into sc-dev 2021-03-19 09:38:35 +00:00
Remi NGUYEN VAN
d9b56cea16 Revert "CaptivePortalData: use CharSequence in VenueFriendlyName API"
This reverts commit 6ae29ff41a.

Reason for revert: b/183174863
Bug: 183174863

Change-Id: I4db923e112bba149f4e8eb4cfa8c3f97defd5e63
2021-03-19 08:10:35 +00:00
Remi NGUYEN VAN
60ad218d72 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
2021-03-19 07:44:21 +00: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
816ea0324c [NS03] Mix in other CS-managed properties
These properties are necessary to figure out the maximum
score of a network.

Test: FrameworksNetTests
Change-Id: I48dce20ad4a80597039393dca607e8da829b2a61
2021-03-19 13:50:56 +09: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
lucaslin
cf6d450eb8 Expose constants of ConnectivityManager
The callers cannot call the hidden APIs after ConnectivityManager
became a part of mainline module, so expose them for callers.
Also change the value of ACTION_PROMPT_PARTIAL_CONNECTIVITY,
ACTION_PROMPT_LOST_VALIDATION and ACTION_PROMPT_UNVALIDATED because
of API lint errors.

Bug: 172183305
Test: Check private DNS settings is normal, and test NO_INTERNET
      notification can be shown normally.
Change-Id: I715c766ad8e5eb54f4dc67239c1dbca7239506fc
2021-03-19 10:51:36 +08: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
Chiachang Wang
aacf237c27 Expose uids related APIs in NetworkRequest and NetworkCapabilities
NetworkRequest is moving into the incoming connectivity mainline
module. The hidden setUids becomes inaccessible outside the
module. Shims for support cts in different API levels will need
to use it to verify the behavior of NetworkRequest. Thus, expose
it to the API surface.

Also, VPN uses getUids and setUids to control network
capabilities. Networkcapabilities is a part of incoming
connectivity mainline module but VPN is not. Thus, exposing these
two methods are needed to allow VPN to continue using it.

Test: make update-api
Bug: 172183305
Change-Id: I107c329d4d7130d488772166eae8b5e7aaa2ff04
2021-03-19 08:39:07 +08: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
Chiachang Wang
4956b3225d Replace the usage of UidRange
UidRange is used in a shared way between ConnectivityService
and VPN through the use of NetworkCapabilities. UidRange will
be part of the ConnectivityService mainline but Vpn.java will
stay in the framework. We need a way to replace the APIs using
UidRange, or to make UidRange system API. The only really
relevant surface here is NetworkCapabilities#{setUids, getUids}.
The need for UidRange could be replaced by an integer Range, so
replace the usage of UidRange by a integer Range in
NetworkCapabilities#{setUids, getUids} and update the relevant
callers.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: I4e5aec6ef1ea02e038fcd7ed117a3b67b69c5cb9
2021-03-19 08:33:07 +08: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