Commit Graph

329 Commits

Author SHA1 Message Date
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
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
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
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
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
Remi NGUYEN VAN
257d49c300 Fix InetAddressCompat exception handling
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
2021-03-19 23:56:27 +09: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
Chiachang Wang
1756295fc5 Merge "Add startCaptivePortalApp to system API" 2021-03-19 11:30:20 +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
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
Chalard Jean
80e17b0086 Merge "[NS03] Mix in other CS-managed properties" 2021-03-19 10:32:46 +00:00
Lucas Lin
ca98471c77 Merge "Expose getCapabilities" 2021-03-19 10:24:25 +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
Chalard Jean
b68825591b Merge "[NS02] Mix in validation of the score" 2021-03-19 05:39:40 +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
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
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
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
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
Remi NGUYEN VAN
8238a7665a Add startCaptivePortalApp to system API
The API is already used by settings and should be usable by setup
wizards. It is the only way for a caller outside of the system_server to
trigger the captive portal application.

The API is already CTS tested in android.net.cts.CaptivePortalTest.

Fixes: 182871577
Test: atest CtsNetTestCases:android.net.cts.CaptivePortalTest
Change-Id: Ie8d9a546b54524ba837715baa94a07d1f993d8d3
2021-03-18 22:41:00 +08: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
lucaslin
8e0c1f0850 Expose getCapabilities
Expose getCapabilities() for EthernetNetworkFactory.

Bug: 182963415
Test: m ethernet-service
Change-Id: I430416af8fae3d4ee99f2f2abe529e3051e9e5cb
2021-03-18 20:30:22 +08: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
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
paulhu
c9925e096b Add more connectivity module settings
Add more connectivity module settings and update all references
to ConnectivitySettingsManager.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: Ie96fbd0996ed3acb37099b6270bf3d4c2e558e9a
2021-03-18 11:58:29 +08:00
Remi NGUYEN VAN
5e478bf5bf Merge "Add framework-connectivity.impl" am: 0fcb8d6db4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635039

Change-Id: I9956c78228c2d04e20edf6fee1061861e26978b9
2021-03-18 03:33:42 +00:00
Chiachang Wang
f9294e7cd1 Expose APIs for Settings
ConnectivityManager will be a part of incoming connectivity
mainline. Settings will no longer to access the hidden methods.
For those methods that accept the interaction from users, they
should be exposed as formal interface to allow the
functionality. Expose them to API surface.

Bug: 172183305
Test: make update-api
Change-Id: Id4533b94291766bb060af0091b5ccb81a00630fd
2021-03-18 11:18:56 +08:00
Remi NGUYEN VAN
eb6aa22205 Add framework-connectivity.impl
The library will be included in the connectivity module APEX when
migrating its sources out of framework-minus-apex.

Bug: 171540887
Test: m
Change-Id: I1595521eaced6e6997c076bb56b06ffdd22a4fa0
2021-03-18 00:29:08 +09:00