Commit Graph

165 Commits

Author SHA1 Message Date
Treehugger Robot
77f80a6743 Merge changes Iac9487e8,Ifa411c7b am: 999506022f am: de1cef76d7 am: bec7ce5cf4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622675

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If1b3f0447705f910467a52d2504ba1aaef850a80
2021-03-12 00:49:24 +00: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
620a57ad4f Merge "Add Ethernet, TestNetworkSpecifier API" into sc-dev 2021-03-09 22:43:46 +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
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
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
318e4c2aa7 Merge "Move OemNetworkPreferences to Connectivity" 2021-03-08 08:41:04 +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
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
1ef0e93f16 Merge "Move NetworkState to Connectivity" 2021-03-05 10:27:57 +00:00
Treehugger Robot
d175285e54 Merge "[FUI22] Support getAllNetworkStateSnapshot" am: 4c73e05c1d am: 773a813dc2 am: ee3fc01443
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1614779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I52f8339bd1cda35a3f26f28fd3c0165f6f6ff91e
2021-03-05 07:10:46 +00:00
Remi NGUYEN VAN
919a491443 Move NetworkState to Connectivity
NetworkState is becoming an internal implementation class, with
NetworkStateSnapshot replacing it as a proper API. Considering this it
belongs inside Connectivity.

Bug: 174123988
Test: m
Change-Id: I201f1a07c50d9da31e33f5c207875da8863ef57c
2021-03-05 08:56:55 +09:00
junyulai
b12113700c [FUI22] Support getAllNetworkStateSnapshot
Currently, ConnectivityService has getAllNetworkState but it is
not ideal to expose as system API since the plan is to get rid
of NetworkState. Thus, create a new one that returns
NetworkStateSnapshot to fulfill the needs.

Note the original getAllNetworkState cannot be deleted now since
it has @UnsupportedAppUsage annotation.

Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: Icddd434552b0e9ecbc8299e7242ec88cf3145aca
2021-03-04 18:41:09 +08:00
Frank Li
5d4495deb8 Merge "[CS05]Remove the hidden API usage of MetricsLogger" am: 4297526f8b am: 7f3280692c am: 8faf9990e6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612039

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2d784ac885ffcbc7a4539cf6e5b4774af5c11c43
2021-03-04 05:08:28 +00:00
lucaslin
eaff72d544 Replace withCleanCallingIdentity with [clear|restore]CallingIdentity
To prevent using @hide method - withCleanCallingIdentity() from
mainline module, use clearCallingIdentity() &
restoreCallingIdentity() instead.

Bug: 172183305
Test: FrameworksNetTests, CtsNetTestCasesLatestSdk
Change-Id: I8221bb8717ba6809c5087ea2808cd4ccef948cfd
2021-03-04 09:38:21 +08:00
Frank Li
4297526f8b Merge "[CS05]Remove the hidden API usage of MetricsLogger" 2021-03-04 01:34:53 +00:00
lucaslin
d9264b1fa3 Use ArraySet#add() instead of ArraySet#append()
ArraySet#append() is a hidden API which is not accessible for
mainline module, use public one - ArraySet#add() instead.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I0742e2ec7aff008141b1de6d10eeca2910df71b1
2021-03-04 09:29:30 +08:00
lifr
1c7789742b [CS05]Remove the hidden API usage of MetricsLogger
Legacy metrics are unused and deprecated, so they are being removed.
Therefore, delete the usage of the hidden MetricsLogger API.

Bug: 157966864
Test: atest CtsNetTestCases
      atest CaptivePortalTest
      atest ConnectivityServiceTest
Change-Id: I51241f5d50ec580015882c84dd917b015c700c7c
2021-03-03 10:17:52 +00:00
Zoey Chen
68d60cdb1a [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
2021-03-03 13:25:54 +08:00
Sarah Chin
ae9a64d7da APIs for 5G slicing
Create TrafficDescriptor class
Create new APN ENTERPRISE
Update setupDataCall and DataCallResponse to take TrafficDescriptor and
matchAllRuleAllowed
Move ApnTypes from Annotation to ApnSetting

Bug: 179312227
Test: atest FrameworksTelephonyTests
Change-Id: I7433976bfe25bcb2af85ffb9338959cbcc9f42f3
Merged-In: I7433976bfe25bcb2af85ffb9338959cbcc9f42f3
2021-03-03 14:16:21 +09:00
Paul Hu
1ea28296e6 Merge "Implement Settings#checkAndNoteChangeNetworkStateOperation on CS" 2021-03-03 01:07:20 +00:00
Remi NGUYEN VAN
ed29c2cf8d Merge "Move OemNetworkPreferences aidl to connectivity" am: 4daa02ee79 am: 1063e9ff33 am: e268e877c6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612038

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib37a92a20b907faed245cca914b46be9b8c1e7fb
2021-03-02 21:09:58 +00:00
Remi NGUYEN VAN
6fd9e1b31d Merge "Move UidRange to connectivity" am: f251c52efb am: c46edc6c24 am: 6dd910c726
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612295

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie9d41595a21c494931e9bf45bfc4e8b2aa9803f3
2021-03-02 21:09:32 +00:00
Remi NGUYEN VAN
eb0cc323ce Merge "Move Proxy, PacProxySelector out of Connectivity" am: a103c450bc am: 694f952a30 am: a7005ec455
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1598157

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib253a7ccf3beb8e9e5d0988db3d0662074dedda7
2021-03-02 20:37:24 +00:00
Remi NGUYEN VAN
32e2c767fe Merge "Move SocketUtils out of the connectivity module" am: e467f13ace am: 3c2c63e525 am: 1efb1bf4a8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1592273

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9de14464ebb9d43e7c4fdc683c23ddbbcc7ef269
2021-03-02 19:56:48 +00:00
Remi NGUYEN VAN
3d6cee3c7d Merge "Move QoS API classes to Connectivity" am: 32a606fe54 am: c535ef183f am: 045c615bb2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1611876

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8b7416a1d5c8103415246016f43dddc932d0be2b
2021-03-02 19:53:40 +00:00
Paul Hu
324ccfa064 Merge "Implement Settings#checkAndNoteChangeNetworkStateOperation on CS" into sc-dev 2021-03-02 13:03:13 +00:00
Remi NGUYEN VAN
4daa02ee79 Merge "Move OemNetworkPreferences aidl to connectivity" 2021-03-02 09:29:07 +00:00
Remi NGUYEN VAN
f251c52efb Merge "Move UidRange to connectivity" 2021-03-02 09:27:50 +00:00
Remi NGUYEN VAN
a103c450bc Merge "Move Proxy, PacProxySelector out of Connectivity" 2021-03-02 07:49:00 +00:00
Remi NGUYEN VAN
e467f13ace Merge "Move SocketUtils out of the connectivity module" 2021-03-02 06:44:01 +00:00
Remi NGUYEN VAN
5115480e8f Move UidRange to connectivity
UidRange is a data class that is an implementation detail of
Connectivity. Move it to the connectivity boundary.

Remaining usages of UidRange outside of Connectivity (in VPN) should be
migrated to other classes, like Range<Integer> or UidRangeParcel.

Bug: 181512874
Test: m
Change-Id: I6f2e3685ad1c07171dd90480d1e546329de8732d
2021-03-02 15:35:36 +09:00
Remi NGUYEN VAN
24d950ce5a Move OemNetworkPreferences aidl to connectivity
Move the IOnSetOemNetworkPreferenceListener aidl definition to
framework-connectivity.
The interface is an internal implementation detail of
framework-connectivity, so it should be built inside the jar.

Bug: 181512874
Test: m
Change-Id: I898049b50fc620ee629587a9303f058e0a6d0272
2021-03-02 13:56:38 +09:00
Remi NGUYEN VAN
a1433566fe Move Proxy, PacProxySelector out of Connectivity
PacProxySelector is tied to IProxyService, which does not have a formal
API.
Proxy is the interface with ConnectivityService, and all its methods are
public or module API.

Bug: 171540887
Test: m
Change-Id: I8ceba961a81661c3e11d8179955b594d3cab6ff7
2021-03-01 18:35:26 +09:00
Remi NGUYEN VAN
070ff8bb9c Move QoS API classes to Connectivity
The classes were added in S and are used to back ConnectivityManager
APIs. Add them to the connectivity boundary as they belong together with
ConnectivityManager.

Bug: 181512874
Test: m
Change-Id: I03b5978949b200a72813d1ebc4812d851fe3df37
2021-03-01 18:09:30 +09:00
Junyu Lai
b083e81f73 Merge "Fix copyright license of VpnTransportInfo" am: 9b9f823f11 am: f83741d25d am: bc88904010
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607313

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibf6ba342dfbc92fc4852b96d1c3f3b3f34cc3322
2021-03-01 08:07:27 +00:00
Remi NGUYEN VAN
fb559351e4 Merge "Add public alternative for protectFromVpn" am: 0c04e41e7b am: 14b6af4431 am: e456ac2061
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1605094

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If0c46c990def1b6884a6008841f3d5bd912b8650
2021-03-01 08:01:51 +00:00
Remi NGUYEN VAN
1e29080037 Move SocketUtils out of the connectivity module
SocketUtils contains system APIs for modules to interact for sockets,
wrapping internal APIs. It should be part of the platform to keep access
to the internal APIs.

This involves splitting NetworkUtils.protectVpn to NetworkUtilsInternal,
since SocketUtils and VpnService are the only users of that method.

The @UnsupportedAppUsage NetworkUtils.protectVpn has low usage
count, and is already available through VpnService.protect.

Bug: 181512874
Test: boots, VPN working
Change-Id: I7028d334975f7536c06afac7a22200c33db707ac
2021-03-01 16:50:08 +09:00
Remi NGUYEN VAN
306da2a1b5 Merge "Split out the connectivity API surface" 2021-03-01 01:07:19 +00:00