Commit Graph

921 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
17ad9338bc Merge changes from topic "ethernet_specifier" am: de3d545cf1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626207

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9ef1a287439b5f5705ff3b3b4de4ded54f61c1c1
2021-03-12 00:12:52 +00:00
Remi NGUYEN VAN
40fe7c287b Add Ethernet, TestNetworkSpecifier API am: ea33ac97f6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574300

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1a1b38fb6b8b6831bac016a8352ae9073758f9af
2021-03-12 00:10:08 +00:00
Remi NGUYEN VAN
de3d545cf1 Merge changes from topic "ethernet_specifier"
* changes:
  Fix common tests on Q and R
  Add Ethernet, TestNetworkSpecifier API
2021-03-11 23:51:49 +00:00
Treehugger Robot
de1cef76d7 Merge changes Iac9487e8,Ifa411c7b am: 999506022f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622675

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2cf126259f903d407830b1e8bc2d3fcdc02b97c2
2021-03-11 23:15:17 +00:00
Daniel Bright
686d5d2c3d Swap parameters in QosCallback#registerQosCallback
Bug: 181551395
Test: unit tests
Change-Id: I9f3f7e7a1bbb19629a2607b82ce316768c4143df
2021-03-11 12:07:33 -08:00
lucaslin
5cdbcfb7fa Add a new API to get the network ID range of IPSec tunnel interface
- Add a new API to get the network ID range of IPSec tunnel
interface.
- Use the new API in IpSecServiceTest to make sure the result is
the same. Follow-up commit will change the logic in
IpSecService#reserveNetId(), the modified test can ensure the
correctness of the new change.

Bug: 172183305
Test: atest FrameworksNetTests:IpSecServiceTest
Change-Id: Ic605e48941fc9d6482cdcd01a8adcdc9b6d586a6
2021-03-12 00:46:33 +08:00
junyulai
e1b65bdbfe [VCN12] Expose setSubIds/getSubIds APIs
Test: atest NetworkCapabilitiesTest
Bug: 175662146
Change-Id: Ia4b98bc6c5fcefee44233f3b7fbb6517a0e8870e
2021-03-11 23:03:19 +08:00
junyulai
697b459ad9 [VCN04] Add Subscription Id set into NetworkCapabilities
This is a generic way to request networks that has different
subId but belongs to the same carrier. For example, cellular
networks with different SIM card, or carrier Wifi that
provided by the operator.

Test: atest NetworkCapabilitiesTest#testSubIds
Test: m doc-comment-check-docs -j
Test: atest CtsNetTestCases
Bug: 175662146

Change-Id: Ifca766f5acc73c285948d6251ec31506d9bb0bcb
2021-03-11 23:03:05 +08:00
Remi NGUYEN VAN
ea33ac97f6 Add Ethernet, TestNetworkSpecifier API
Rename StringNetworkSpecifier to EthernetNetworkSpecifier (its only
production user), and make it module-lib API.
The original StringNetworkSpecifier file is actually kept to satisfy
some invalid dependencies; it will be removed separately.

This allows specifying an Ethernet interface with a non-deprecated API:
until this change the only way to do so would be to use
NetworkRequest#setSpecifier(String), which is deprecated.

Similarly, add the TestNetworkSpecifier API for TestNetworkManager, to
replace previous usage of StringNetworkSpecifier. TestNetworkManager is
module API, so TestNetworkSpecifier should be module API too. This
allows tests to request the test interface specifically, without using
the deprecated NetworkRequest#setSpecifier(String).

Bug: 179329291
Test: m
Merged-In: Iee569f5c8bbdc4bc979610e1191308281f3d4620

Change-Id: Iee569f5c8bbdc4bc979610e1191308281f3d4620
2021-03-11 23:02:02 +08:00
junyulai
dbb7046923 [VCN11] Make requestBackgroundNetwork requires handler
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest
Bug: 175662146
Change-Id: Iac9487e8de8bfdd87fc7a0153b228ae2a7ba4e19
2021-03-11 21:05:27 +08:00
junyulai
5a5c99b84e [VCN10] Add new API to listen for highest score network
Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback
Bug: 175662146
Change-Id: Ifa411c7b53da789c74fff7e1a95f9c9ebf5bd05c
2021-03-11 21:04:06 +08:00
Remi NGUYEN VAN
c7bf00636e Remove Slog usage in NetworkState
Slog should not be used in unbundled jars as it is a hidden API; use the
standard Log utility instead.

Bug: 172050541
Test: m
Change-Id: I54b2b99b2aedbb5194e9ec24068d2f2ce46d67fc
2021-03-11 21:01:30 +09:00
Remi NGUYEN VAN
fa5eacc89f 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
Test: m
Change-Id: If14a75439ff332c927dc4114ae0eecb89f53c6c7
2021-03-11 20:49:13 +09:00
Remi NGUYEN VAN
2d4413f8e3 Remove hidden @NetworkType in NetworkInfo
The NetworkType annotation is a hidden telephony symbol, and should be
kept hidden as annotations are disallowed by API guidelines.

Remove its usage in NetworkInfo as users of annotated constants that
build against API stubs are expected not to use the annotation.

Bug: 182451544
Test: m
Change-Id: I6658c1faa147c527c989b87d67f1af166c488dde
2021-03-11 20:29:10 +09:00
Remi NGUYEN VAN
a29be5c0f7 Remove hidden INVALID_RESOURCE_ID in unused param
INVALID_RESOURCE_ID is a hidden API so its usage should be avoided.
The current usage is for an unused parameter, so just use a literal instead.

Bug: 182451544
Change-Id: I066d9c34f735434adee4ee72e8a7fe1ceb900c3c
Test: m
2021-03-11 10:57:01 +00:00
Remi NGUYEN VAN
5a4c7353b2 Move ParseException to Connectivity
ParseException is a public API class used to support Connectivity APIs,
so it should be in the same API surface as connectivity.

Bug: 181512874
Test: m
Change-Id: Ie1213de0d0facc8f409f7b4c2553abb382e4afbf
2021-03-11 17:19:18 +09:00
Remi NGUYEN VAN
07051bcd83 Remove usage of hidden InetSocketAddress constructor
The constructor is a hidden API, and used in a code path that can
never happen.
Replace it with a thrown exception (which should never be thrown either).

Bug: 170598012
Change-Id: Ie2c671c1a75accb8e94b08de9901d14b72caaf7e
Test: m
2021-03-11 07:43:43 +00:00
lifr
764e506248 [CS15]Do not use hidden API of PlatformProperties
ConnectivityService is going to become a mainline module, and
it will not able to use hidden method anymore. Using PlatformProperties
as a static library instead of hidden API.

Bug: 170917042
Test: atest FrameworksNetTests
Merged-In: I3a3deca5d2e0f690db8c0061de2db2217376d268
Change-Id: I3a3deca5d2e0f690db8c0061de2db2217376d268
2021-03-11 03:41:35 +08:00
Aaron Huang
63338848da Create a service-connectivity-pre-jarjar library
This is needed for FrameworksNetTests because it inculdes
service-connectivity. Without this library, the service-connectivity
is already jarjar-ed which will cause the util classes couldn't be
found when running the tests. So let the tests inculde the pre-jarjar
version and service-connectivity applies the jarjar to this library.

Bug: 177046265
Test: FrameworksNetTests
Change-Id: I1acd95ff9bec99b918646e8ec3a57f3ef156e2ca
Merged-In: I1acd95ff9bec99b918646e8ec3a57f3ef156e2ca
2021-03-10 22:25:45 +08:00
Aaron Huang
3978b58cf6 Merge "Create a service-connectivity-pre-jarjar library" into sc-dev 2021-03-10 04:40:56 +00:00
Remi NGUYEN VAN
61c0b1a6f5 Use ParcelDescriptor.fromSocket instead of getFileDescriptor
Socket.getFileDescriptor$ is a hidden API. Instead, replace it with
ParcelDescriptor.fromSocket, which was created to handle such use-cases.

Bug: 170598012
Change-Id: I9e218e4ec29d2b7fe5d2faeb1c2e1cafc63dc923
Test: m
2021-03-09 23:54:03 +00:00
Remi NGUYEN VAN
620a57ad4f Merge "Add Ethernet, TestNetworkSpecifier API" into sc-dev 2021-03-09 22:43:46 +00:00
Zoey Chen
273583401f [automerger skipped] Merge changes from topic "PSL_TelephonyCallback" am: e2e358f666 am: 4f453b8ad6 am: 4a8217abd9 -s ours
am skip reason: Change-Id Ia3b777b12142b104b5798804f50b34748f9bf28c with SHA-1 68d60cdb1a is in history

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifaaf86e06bbd93df2b0d5265df41e055f6be9bad
2021-03-09 12:32:52 +00:00
Zoey Chen
4f453b8ad6 Merge changes from topic "PSL_TelephonyCallback" am: e2e358f666
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614981

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idd41c34f9e4dff1ca7930a9fc2a6f06ec8c316ba
2021-03-09 11:24:06 +00:00
Zoey Chen
e2e358f666 Merge changes from topic "PSL_TelephonyCallback"
* changes:
  [Telephony] Use TelephonyCallback instead of PhoneStateListener part1
  [PhoneStateListener] Redesign PhoneStateListener: Use TelephonyCallback
2021-03-09 10:36:03 +00:00
Chalard Jean
aca49c8844 Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity" am: 0f08d2fcb7 am: d5cdace044 am: 614d5de20d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615182

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2ae6ed673a8c82a7e6326c35c17508d26f2e5236
2021-03-09 08:52:01 +00:00
Remi NGUYEN VAN
56520566ce Create ServiceConnectivityResources
Create the ServiceConnectivityResources package, which contains
resources Connectivity unbundled from platform resources.

Migrate the first few resources from ConnectivityService that have no
RRO in AOSP. To avoid boot time impact, avoid loading the resources in
the ConnectivityService constructor.

Bug: 182125649
Test: atest FrameworksNetTests
Change-Id: I77ac6f4303c54acc96f16e18ef02add30298ff3d
2021-03-09 17:41:51 +09:00
Chalard Jean
d5cdace044 Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity" am: 0f08d2fcb7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615182

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I376927831333a78dc2c60b5be23324b8f0395c58
2021-03-09 08:07:32 +00:00
Remi NGUYEN VAN
32288186bb Add Ethernet, TestNetworkSpecifier API
Rename StringNetworkSpecifier to EthernetNetworkSpecifier (its only
production user), and make it module-lib API.
The original StringNetworkSpecifier file is actually kept to satisfy
some invalid dependencies; it will be removed separately.

This allows specifying an Ethernet interface with a non-deprecated API:
until this change the only way to do so would be to use
NetworkRequest#setSpecifier(String), which is deprecated.

Similarly, add the TestNetworkSpecifier API for TestNetworkManager, to
replace previous usage of StringNetworkSpecifier. TestNetworkManager is
module API, so TestNetworkSpecifier should be module API too. This
allows tests to request the test interface specifically, without using
the deprecated NetworkRequest#setSpecifier(String).

Bug: 179329291
Test: m
Change-Id: Iee569f5c8bbdc4bc979610e1191308281f3d4620
2021-03-09 07:46:48 +00:00
Chalard Jean
0f08d2fcb7 Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity" 2021-03-09 07:41:13 +00:00
Lucas Lin
3bf62d68f8 Merge "Use ArraySet#add() instead of ArraySet#append()" am: a536692e6a am: 970658bac8 am: 9691a4a867
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615181

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic1cbcbb6f9dc83e664593b8e095a0f9b80697b83
2021-03-09 06:34:56 +00:00
Lucas Lin
970658bac8 Merge "Use ArraySet#add() instead of ArraySet#append()" am: a536692e6a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615181

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1991567f130f3afee6c6bcb78a9254b45e14f6e4
2021-03-09 05:31:26 +00:00
Lucas Lin
a536692e6a Merge "Use ArraySet#add() instead of ArraySet#append()" 2021-03-09 04:52:42 +00:00
Zoey Chen
a3b96dc581 [Telephony] Use TelephonyCallback instead of PhoneStateListener part1
Since the redesign of PhoneStateListener, use TelephonyCallback to get the callback of EVENT_*

Bug: 167684594
Test: make
Change-Id: Ia3b777b12142b104b5798804f50b34748f9bf28c
Merged-In: Ia3b777b12142b104b5798804f50b34748f9bf28c
2021-03-08 20:25:00 +08:00
Remi NGUYEN VAN
130d6c6a17 Merge "Move OemNetworkPreferences to Connectivity" am: 318e4c2aa7 am: 83af07fb12 am: 8ad13e49a0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620981

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I60a24c0fc878737e120414fe85786faacb425b09
2021-03-08 10:42:05 +00:00
Paul Hu
5b321106cc Merge "Replace Inet[4|6]Address#ANY" am: 970b0019c7 am: 91f4cc9d87 am: b248125d2a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615184

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I33cb758506a4b2626de368c6537688245ac554e2
2021-03-08 09:16:20 +00:00
Remi NGUYEN VAN
83af07fb12 Merge "Move OemNetworkPreferences to Connectivity" am: 318e4c2aa7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620981

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9adc394b0c203cdb1045f50e83487ea0c2000632
2021-03-08 09:12:05 +00:00
Remi NGUYEN VAN
318e4c2aa7 Merge "Move OemNetworkPreferences to Connectivity" 2021-03-08 08:41:04 +00:00
Paul Hu
91f4cc9d87 Merge "Replace Inet[4|6]Address#ANY" am: 970b0019c7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615184

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I45cf2b37c775da158cdec2d3b7f50ac491d2fca8
2021-03-08 08:05:59 +00:00
Paul Hu
970b0019c7 Merge "Replace Inet[4|6]Address#ANY" 2021-03-08 07:20:21 +00:00
paulhu
a20cf48c1b Replace Inet[4|6]Address#ANY
Connectivity is becoming a mainline module in S but mainline
modules are not allowed to use non-formal APIs. Thus, replace
non-formal API Inet[4|6]Address#ANY to
NetworkStackConstants#IPV[4|6]_ADDR_ANY.

Bug: 181756157
Test: FrameworksNetTests
Change-Id: Id4d2fc551c1384f549a586e87ab68356ba05b995
2021-03-08 07:18:31 +00:00
Frank Li
2cffee1ed4 Merge "[CS10]Remove the hidden API usage of BitUtils" am: 02d57fc2ae am: 5975c82ffe am: 8067a74a3e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615192

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iad812431b5855e78596f861bd3b2c3ef091e3189
2021-03-08 03:34:25 +00:00
Frank Li
5975c82ffe Merge "[CS10]Remove the hidden API usage of BitUtils" am: 02d57fc2ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1615192

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia0dcd92a896a759e65ada070f16394db216b07b8
2021-03-08 02:14:44 +00:00
Remi NGUYEN VAN
c5e54d4c37 Move OemNetworkPreferences to Connectivity
The data class supports a ConnectivityManager API, so it should be
together with the ConnectivityManager API surface.

Bug: 181512874
Test: m
Change-Id: I5642486ea0febcb08cadcbd4cd3f0c6056deae0e
2021-03-08 09:26:41 +09:00
lifr
991f65f164 [CS10]Remove the hidden API usage of BitUtils
The connection service will become the main line module.
It is difficult to include BitUtils in the module. and so
Move the hidden API needed in BitUtils to NetworkCapabilitiesUtils.

Bug: 170598012
Test: atest ConnectivityServiceTest
      atest NetworkCapabilitiesTest
      atest DnsUtilsTest
Change-Id: Ibc81827e25a54fc3ff94f78d810fe4f5073e3a98
2021-03-06 16:21:16 +00:00
Zoey Chen
5804d9ef62 Merge "[Telephony] Use TelephonyCallback instead of PhoneStateListener part1" into sc-dev 2021-03-05 14:50:27 +00:00
Remi NGUYEN VAN
6ef184190a Merge "Move NetworkState to Connectivity" am: 1ef0e93f16 am: d92bb185eb am: 161b1278f7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620379

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icea1247fd498e8661cb8cba68d34a443004a246d
2021-03-05 12:32:57 +00:00
Remi NGUYEN VAN
d92bb185eb Merge "Move NetworkState to Connectivity" am: 1ef0e93f16
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620379

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie8eda98704327d894b59c335753739600b87f670
2021-03-05 11:33:30 +00:00
Remi NGUYEN VAN
1ef0e93f16 Merge "Move NetworkState to Connectivity" 2021-03-05 10:27:57 +00:00
Aaron Huang
bc736ce82f Create a service-connectivity-pre-jarjar library
This is needed for FrameworksNetTests because it inculdes
service-connectivity. Without this library, the service-connectivity
is already jarjar-ed which will cause the util classes couldn't be
found when running the tests. So let the tests inculde the pre-jarjar
version and service-connectivity applies the jarjar to this library.

Bug: 177046265
Test: FrameworksNetTests
Change-Id: I1acd95ff9bec99b918646e8ec3a57f3ef156e2ca
2021-03-05 17:00:12 +08:00