Commit graph android_packages_modules_Co.../framework
Message SHA1
Merge "Replace InetAddress#parseNumericAddress"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-15 07:03:46 +00:00
2622bfd00a
Merge "Remove connectivity dependency on Preconditions"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-15 06:36:15 +00:00
00e1d9ee70
Merge "Remove VpnType usage in VpnTransportInfo"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-15 01:52:30 +00:00
8828fc0b65
Replace InetAddress#parseNumericAddress
-Connectivity is becoming a mainline module in S but mainline
modules are not allowed to use non-formal APIs. Thus, replace
non-formal API InetAddress#parseNumericAddress to
InetAddresses#parseNumericAddress.
- Add deprecated method legacyParseIpAndMask() for IpPrefix and
LinkAddress. Because InetAddresses#parseNumericAddress has
a little different behavior in some case, but these two classes
should keep working as before. So these two classes will use
the new deprecated method.

Bug: 181756157
Test: FrameworksNetTests
Change-Id: I1c96b75f0b8d5e93304a39b4a8c8849964e5e810

paulhu   commited 2021-03-12 19:57:40 +08:00
0494b85ffb
Remove VpnType usage in VpnTransportInfo
The VpnType annotation is a hidden symbol, and should be
kept hidden as annotations are disallowed by API guidelines.

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

Bug: 173331190
Test: m
Change-Id: I171fa57f6279defad081c3cd16265d58ec55e57d

Remi NGUYEN VAN   commited 2021-03-12 18:30:30 +09:00
9b47fcca83
Merge "Remove usage of hidden InetSocketAddress constructor"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-12 09:02:15 +00:00
7e9e7dce89
Merge "Remove hidden @NetworkType in NetworkInfo"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-12 08:59:35 +00:00
e01042965a
Merge "Remove hidden INVALID_RESOURCE_ID in unused param"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-12 08:57:55 +00:00
de66768a6c
Merge "Use ParcelDescriptor.fromSocket instead of getFileDescriptor"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-12 08:57:47 +00:00
c899c4fee6
Merge changes from topics "vcn04", "vcn12"
* changes:
  [VCN12] Expose setSubIds/getSubIds APIs
  [VCN04] Add Subscription Id set into NetworkCapabilities

Junyu Lai   authored and   Gerrit Code Review   commited 2021-03-12 07:12:59 +00:00
992f747392
Merge "ConnectivityManager: Provide API's to include location sensitive info"
Roshan Pius   authored and   Gerrit Code Review   commited 2021-03-12 05:56:29 +00:00
a03f3bbf0e
Merge "Remove Slog usage in NetworkState"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-12 05:12:26 +00:00
18cc3dc34f
Merge "Move ParseException to Connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-12 04:27:55 +00:00
24162a26ff
Merge changes Ib80f814f,Ic605e489
* changes:
  Use new API - getIpSecNetIdRange() in IpSecService
  Add a new API to get the network ID range of IPSec tunnel interface

Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-12 03:30:32 +00:00
3ef74f3cab
ConnectivityManager: Provide API's to include location sensitive info
Existing NetworkCallback users will get NetworkCapabilities with
location sensitive data removed (except for ownerUid which will be
added for existing apps for backwards compatibility). Apps
have to opt-in to receive location sensitive data.

Note: This was chosen because WifiInfo is the only TransportInfo tha
has location sensitive info & that was added only in Android 12. If we
choose to default to true, all existings apps retrieving
NetworkCapabilities for wifi networks will be blamed for location access
unnecessarily.

Changes:
i) Add a flag in NetworkCallback creation to retrieve
NetworkCapabilities with location sensitive info in their callback.
(More flags are being planned for NetworkCallback for throttling
callback frequency, etc)
ii) For NetworkCapabilities.getOwnerUid(), we will continue to send the
data for apps targeting older SDK (since this is an existing field and
the new flag defaults location sensitive data to off).

Bug: 156867433
Test: atest android.net
Test: atest com.android.server
Change-Id: If70b5ea6f5c8885f0c353c8df08a826d55fe7f7a

Roshan Pius   commited 2021-03-11 18:27:18 -08:00
e08bc1803c
Merge changes from topic "ethernet_specifier"
* changes:
  Fix common tests on Q and R
  Add Ethernet, TestNetworkSpecifier API

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-11 23:51:49 +00:00
de3d545cf1
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

lucaslin   commited 2021-03-12 00:46:33 +08:00
5cdbcfb7fa
[VCN12] Expose setSubIds/getSubIds APIs
Test: atest NetworkCapabilitiesTest
Bug: 175662146
Change-Id: Ia4b98bc6c5fcefee44233f3b7fbb6517a0e8870e

junyulai   commited 2021-03-11 23:03:19 +08:00
e1b65bdbfe
[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

junyulai   commited 2021-03-11 23:03:05 +08:00
697b459ad9
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

Remi NGUYEN VAN   authored and   junyulai   commited 2021-03-11 23:02:02 +08:00
ea33ac97f6
[VCN11] Make requestBackgroundNetwork requires handler
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest
Bug: 175662146
Change-Id: Iac9487e8de8bfdd87fc7a0153b228ae2a7ba4e19

junyulai   commited 2021-03-11 21:05:27 +08:00
dbb7046923
[VCN10] Add new API to listen for highest score network
Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback
Bug: 175662146
Change-Id: Ifa411c7b53da789c74fff7e1a95f9c9ebf5bd05c

junyulai   commited 2021-03-11 21:04:06 +08:00
5a5c99b84e
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

Remi NGUYEN VAN   commited 2021-03-11 21:01:30 +09:00
c7bf00636e
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

Remi NGUYEN VAN   commited 2021-03-11 20:49:13 +09:00
fa5eacc89f
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

Remi NGUYEN VAN   commited 2021-03-11 20:29:10 +09:00
2d4413f8e3
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

Remi NGUYEN VAN   commited 2021-03-11 10:57:01 +00:00
a29be5c0f7
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

Remi NGUYEN VAN   commited 2021-03-11 17:19:18 +09:00
5a4c7353b2
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

Remi NGUYEN VAN   commited 2021-03-11 07:43:43 +00:00
07051bcd83
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

Remi NGUYEN VAN   commited 2021-03-09 23:54:03 +00:00
61c0b1a6f5
Merge changes from topic "PSL_TelephonyCallback"
* changes:
  [Telephony] Use TelephonyCallback instead of PhoneStateListener part1
  [PhoneStateListener] Redesign PhoneStateListener: Use TelephonyCallback

Zoey Chen   authored and   Gerrit Code Review   commited 2021-03-09 10:36:03 +00:00
e2e358f666
Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-09 07:41:13 +00:00
0f08d2fcb7
Merge "Use ArraySet#add() instead of ArraySet#append()"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-03-09 04:52:42 +00:00
a536692e6a
[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

Zoey Chen   commited 2021-03-08 20:25:00 +08:00
a3b96dc581
Merge "Move OemNetworkPreferences to Connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-08 08:41:04 +00:00
318e4c2aa7
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

paulhu   authored and   Paul Hu   commited 2021-03-08 07:18:31 +00:00
a20cf48c1b
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

Remi NGUYEN VAN   commited 2021-03-08 09:26:41 +09:00
c5e54d4c37
[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

lifr   authored and   Frank Li   commited 2021-03-06 16:21:16 +00:00
991f65f164
Merge "Move NetworkState to Connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-05 10:27:57 +00:00
1ef0e93f16
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

Remi NGUYEN VAN   commited 2021-03-05 08:56:55 +09:00
919a491443
[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

junyulai   commited 2021-03-04 18:41:09 +08:00
b12113700c
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

lucaslin   commited 2021-03-04 09:38:21 +08:00
eaff72d544
Merge "[CS05]Remove the hidden API usage of MetricsLogger"
Frank Li   authored and   Gerrit Code Review   commited 2021-03-04 01:34:53 +00:00
4297526f8b
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

lucaslin   commited 2021-03-04 09:29:30 +08:00
d9264b1fa3
[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

lifr   authored and   Frank Li   commited 2021-03-03 10:17:52 +00:00
1c7789742b
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

Sarah Chin   authored and   Chalard Jean   commited 2021-03-03 14:16:21 +09:00
ae9a64d7da
Merge "Implement Settings#checkAndNoteChangeNetworkStateOperation on CS"
Paul Hu   authored and   Gerrit Code Review   commited 2021-03-03 01:07:20 +00:00
1ea28296e6
Merge "Move OemNetworkPreferences aidl to connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-02 09:29:07 +00:00
4daa02ee79
Merge "Move UidRange to connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-02 09:27:50 +00:00
f251c52efb
Merge "Move Proxy, PacProxySelector out of Connectivity"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-02 07:49:00 +00:00
a103c450bc
Merge "Move SocketUtils out of the connectivity module"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-02 06:44:01 +00:00
e467f13ace