Commit Graph

158 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
3f0e7dd4e7 Revert "Remove connectivity dependency on Preconditions"
This reverts commit fa5eacc89f.

Reason for revert: Build broken: b/182721112

Change-Id: Ibc84ec6d7900fdcf0bc14cd7036f9c08287711db
2021-03-15 07:27:44 +00: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
Chalard Jean
0f08d2fcb7 Merge "Replace withCleanCallingIdentity with [clear|restore]CallingIdentity" 2021-03-09 07:41:13 +00:00
Lucas Lin
a536692e6a Merge "Use ArraySet#add() instead of ArraySet#append()" 2021-03-09 04:52:42 +00:00
Remi NGUYEN VAN
318e4c2aa7 Merge "Move OemNetworkPreferences to Connectivity" 2021-03-08 08:41:04 +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
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
Remi NGUYEN VAN
1ef0e93f16 Merge "Move NetworkState to Connectivity" 2021-03-05 10:27:57 +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
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
Xin Li
48172e9b5d Merge "Merge RQ2A.210305.007" 2021-03-03 21:41:39 +00: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
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
1063e9ff33 Merge "Move OemNetworkPreferences aidl to connectivity" am: 4daa02ee79
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612038

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11b9be22935b9fd7cf53b268103a1ce4635a6afd
2021-03-02 20:27:29 +00:00
Remi NGUYEN VAN
c46edc6c24 Merge "Move UidRange to connectivity" am: f251c52efb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612295

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I672615b0804b9a9de4befa1ba5aea2efb9c962df
2021-03-02 20:24:20 +00:00
Treehugger Robot
a941d46227 Merge "Add modules-utils-os to service-connectivity" am: 6da87e0692
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1612195

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I22df4afec8f8b5024d099966c0ca0f78b55ff08a
2021-03-02 20:19:24 +00:00
Remi NGUYEN VAN
694f952a30 Merge "Move Proxy, PacProxySelector out of Connectivity" am: a103c450bc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1598157

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id81273b33752ff353dfebdd2cd3faf43429f1a29
2021-03-02 19:52:58 +00:00
Remi NGUYEN VAN
3c2c63e525 Merge "Move SocketUtils out of the connectivity module" am: e467f13ace
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1592273

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib2d4b5574ba710eb50c438144e2b87f6c8954336
2021-03-02 19:48:26 +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
Treehugger Robot
6da87e0692 Merge "Add modules-utils-os to service-connectivity" 2021-03-02 08:59:35 +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
96a931b5b2 Add modules-utils-os to service-connectivity
service-connectivity needs the library so that module utilities are statically
linked, not picked up from the framework jar as hidden symbols.

Bug: 170598012
Change-Id: I1045b3784a4bdb902f44d848ccddb304986631c3
Test: m
2021-03-02 03:28:58 +00:00
Remi NGUYEN VAN
c535ef183f Merge "Move QoS API classes to Connectivity" am: 32a606fe54
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1611876

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idad1f51e7f269c2cef9e836efa668a5a0afd4c5a
2021-03-02 01:28:59 +00: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
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
4a448c175f Merge "Split out the connectivity API surface" am: 306da2a1b5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552658

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6e51465cfeab43ff5f154771e2e22a7cd981d066
2021-03-01 02:10:04 +00:00
Remi NGUYEN VAN
306da2a1b5 Merge "Split out the connectivity API surface" 2021-03-01 01:07:19 +00:00
Remi NGUYEN VAN
f15fc7f9a8 Split out the connectivity API surface
Split out connectivity APIs to connectivity module directories. This
prepares future move of the connectivity code into a mainline module,
but still keeps it implemented by framework-minus-apex for now: the API
stubs are moved to framework-connectivity.stubs, but the implementation
on device remains in the same place.

This allows moving the connectivity code in/out of APEX with minimal
changes.

BYPASS_INCLUSIVE_LANGUAGE_REASON=Moving files, can't modify released API

Bug: 171540887
Test: device boots, connectivity working

Merged-In: I21c42f032efa6c10e36c749df3183ce9679303a7
(cherry-pick from internal branch with API files conflicts)

Change-Id: I21c42f032efa6c10e36c749df3183ce9679303a7
2021-02-26 19:23:25 +09:00
Junyu Lai
f83741d25d Merge "Fix copyright license of VpnTransportInfo" am: 9b9f823f11
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607313

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifed529b4a91bb3c52acb3d1ce708a5999a2bb595
2021-02-26 03:56:16 +00:00
Junyu Lai
9b9f823f11 Merge "Fix copyright license of VpnTransportInfo" 2021-02-26 03:38:59 +00:00
Remi NGUYEN VAN
14b6af4431 Merge "Add public alternative for protectFromVpn" am: 0c04e41e7b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1605094

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I759af534bdf50f647351056275857c056998bf14
2021-02-26 03:22:03 +00:00
Remi NGUYEN VAN
0c04e41e7b Merge "Add public alternative for protectFromVpn" 2021-02-26 01:50:32 +00:00
Paul Hu
181827f862 Merge "Use alternative PhoneStateListener formal API" am: 73e1c90697
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554994

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I221f70b66e229c7209111227c40a0f4c0e616d85
2021-02-25 13:04:23 +00:00
Paul Hu
73e1c90697 Merge "Use alternative PhoneStateListener formal API" 2021-02-25 12:14:53 +00:00
Junyu Lai
1dda31390d Merge "[VCN07] Bypass VCN for non-internet app accessible cellular services" am: 8be73b451f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1597954

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ied1e0628645c1320cf306fe508820cb80d03373a
2021-02-25 11:03:33 +00:00
Junyu Lai
8be73b451f Merge "[VCN07] Bypass VCN for non-internet app accessible cellular services" 2021-02-25 10:16:03 +00:00
junyulai
5f658cbb9b Fix copyright license of VpnTransportInfo
Test: TH
Bug: None
Change-Id: Id1fe2c62a0fd60b9833d8b00d2fa2ddc2f031004
2021-02-25 10:31:56 +08:00
Remi NGUYEN VAN
5b1411c636 Add public alternative for protectFromVpn
The method is called directly by VpnService#protect.

Bug: 171540887
Test: m
Change-Id: I7cbb1ef1301dcf8d27b2cc39c0431a0156fe3442
2021-02-24 14:49:35 +09:00
Chiachang Wang
5ca975bf07 Merge "Move shared methods to net shared lib" am: 6a67b78d2b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1571901

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3baac3770814ea1aba213e54430c44308b0c07bc
2021-02-24 00:16:42 +00:00