Commit Graph

151 Commits

Author SHA1 Message Date
Paul Hu
3cfe5b265c Merge "Replace Inet[4|6]Address#ANY" am: 3483a8be68 am: cdb81da32c am: 7c62151de3
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
paulhu
ee4cd637e3 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
c2e90a9f15 Merge "[CS10]Remove the hidden API usage of BitUtils" am: 02d57fc2ae am: defaaf05a4 am: 446fcf2ac9
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
lifr
c33ea4de7d [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
c99db5dfd6 Merge "[Telephony] Use TelephonyCallback instead of PhoneStateListener part1" into sc-dev 2021-03-05 14:50:27 +00:00
Remi NGUYEN VAN
1285b9ca40 Merge "Move NetworkState to Connectivity" am: 4d2ad2a68a am: 65982d493b am: d7e667b28f
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
4d2ad2a68a Merge "Move NetworkState to Connectivity" 2021-03-05 10:27:57 +00:00
Treehugger Robot
52ccd5b9dd Merge "[FUI22] Support getAllNetworkStateSnapshot" am: bcbc04f329 am: f216522f0f am: 54c1b0624f
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
072b33fc6c 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
5784080f24 [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
84ebd956f9 Merge "[CS05]Remove the hidden API usage of MetricsLogger" am: 6ef08c36a7 am: c5ed4d8124 am: e4bb3866d8
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
Frank Li
6ef08c36a7 Merge "[CS05]Remove the hidden API usage of MetricsLogger" 2021-03-04 01:34:53 +00:00
lifr
f1b0ca6ef8 [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
78ca2ba3a7 [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
ce85c4c118 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
3f250d1da0 Merge "Implement Settings#checkAndNoteChangeNetworkStateOperation on CS" 2021-03-03 01:07:20 +00:00
Remi NGUYEN VAN
c84a254fad Merge "Move OemNetworkPreferences aidl to connectivity" am: d795b61a56 am: 695e5f6f62 am: 405b9a0f54
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
c56f454f3c Merge "Move UidRange to connectivity" am: ea3a01abf9 am: beb3822e20 am: f9e689aa17
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
27955ae85b Merge "Move Proxy, PacProxySelector out of Connectivity" am: 14bcef6a65 am: b7f911ad07 am: f685f49896
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
789c256e69 Merge "Move SocketUtils out of the connectivity module" am: 24e5bceac5 am: f0b2caa08b am: d0a8f0ab6e
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
459bb01e4c Merge "Move QoS API classes to Connectivity" am: 32a606fe54 am: c02f9028be am: fc31f05aba
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
6a1e76ab95 Merge "Implement Settings#checkAndNoteChangeNetworkStateOperation on CS" into sc-dev 2021-03-02 13:03:13 +00:00
Remi NGUYEN VAN
d795b61a56 Merge "Move OemNetworkPreferences aidl to connectivity" 2021-03-02 09:29:07 +00:00
Remi NGUYEN VAN
ea3a01abf9 Merge "Move UidRange to connectivity" 2021-03-02 09:27:50 +00:00
Remi NGUYEN VAN
14bcef6a65 Merge "Move Proxy, PacProxySelector out of Connectivity" 2021-03-02 07:49:00 +00:00
Remi NGUYEN VAN
24e5bceac5 Merge "Move SocketUtils out of the connectivity module" 2021-03-02 06:44:01 +00:00
Remi NGUYEN VAN
4e85d98a6f 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
49c389926a 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
3a142b99f1 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
de9477571f 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
e9abf0ed07 Merge "Fix copyright license of VpnTransportInfo" am: 993c655bf3 am: 03a3a561b1 am: a39f3727f9
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
bb12b0df41 Merge "Add public alternative for protectFromVpn" am: a68e748601 am: c9ba0260a3 am: e1cdb63453
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
accf696b71 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
bdf98b8928 Merge "Split out the connectivity API surface" 2021-03-01 01:07:19 +00:00
Paul Hu
ced4d94c93 Merge "Use alternative PhoneStateListener formal API" am: 4de7d07302 am: 6f12370cfc am: 340a4b0dc5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554994

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib176dcbf9d2d60f3f7393e50d765f296a83b77ce
2021-02-26 17:25:40 +00:00
Junyu Lai
d4ec0e4160 Merge "[VCN07] Bypass VCN for non-internet app accessible cellular services" am: ef906819f9 am: b25df9f6c7 am: d71c292044
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1597954

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iade334bfade0457afc6ab2806e481a5e0c85616c
2021-02-26 17:25:16 +00:00
Remi NGUYEN VAN
2079e355ac 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
993c655bf3 Merge "Fix copyright license of VpnTransportInfo" 2021-02-26 03:38:59 +00:00
Remi NGUYEN VAN
a68e748601 Merge "Add public alternative for protectFromVpn" 2021-02-26 01:50:32 +00:00
Paul Hu
4de7d07302 Merge "Use alternative PhoneStateListener formal API" 2021-02-25 12:14:53 +00:00
Junyu Lai
ef906819f9 Merge "[VCN07] Bypass VCN for non-internet app accessible cellular services" 2021-02-25 10:16:03 +00:00
junyulai
50f96a50bc Fix copyright license of VpnTransportInfo
Test: TH
Bug: None
Change-Id: Id1fe2c62a0fd60b9833d8b00d2fa2ddc2f031004
2021-02-25 10:31:56 +08:00
Remi NGUYEN VAN
c1326dfd62 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

Change-Id: I21c42f032efa6c10e36c749df3183ce9679303a7
2021-02-25 11:01:24 +09:00
Sarah Chin
414f1fd265 Merge "APIs for 5G slicing" into sc-dev 2021-02-24 17:36:45 +00:00
Remi NGUYEN VAN
caaa4df54c 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
31175a3bed Merge "Move shared methods to net shared lib" am: 36c58380fe am: 0367f91058 am: f3dec042fa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1571901

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0b7028aa8bb303edf27f4ff93f54a753d0b4ee78
2021-02-24 01:08:24 +00:00
Treehugger Robot
7678869a9a Merge "Clean up T&C implementation" am: 27f44dc792 am: 23cce86e06 am: d9dc2f3a51
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1583505

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I35f732fbfa73d8b207c0e1b22595d2fd0135152c
2021-02-24 00:19:18 +00:00
Treehugger Robot
f53acaa691 Merge "Revert "Revert "Delete VPN methods in ConnectivityManager.""" am: 25e1524c60 am: e14979682a am: d06fbbb6f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1597635

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iff8ce4686f52a73c4a5a2d66218c9a6e3e883a3b
2021-02-23 22:56:21 +00:00
paulhu
4418c8e2ed Implement Settings#checkAndNoteChangeNetworkStateOperation on CS
Connectivity is becoming a mainline module in S and
ConnectivityManager#enforceChangePermission is using
Settings#checkAndNoteChangeNetworkStateOperation for performing a
strict and comprehensive check of whether a calling package is
allowed to change the state of network. However, Mainline modules
are not allowed to use non-formal APIs, fortunately CS is the
only caller of this ConnectivityManager#enforceChangePermission.
Thus, implement the Settings API on ConnectivityService and remove
the ConnectivityManager#enforceChangePermission and
Settings#checkAndNoteChangeNetworkStateOperation.

Bug: 178565313
Test: atest FrameworksNetTests
Change-Id: I6f03398c1735b89470ad5bdbe3a036929daeb53c
Merged-In: I6f03398c1735b89470ad5bdbe3a036929daeb53c
2021-02-23 08:35:38 +00:00
paulhu
acae8dde4b Implement Settings#checkAndNoteChangeNetworkStateOperation on CS
Connectivity is becoming a mainline module in S and
ConnectivityManager#enforceChangePermission is using
Settings#checkAndNoteChangeNetworkStateOperation for performing a
strict and comprehensive check of whether a calling package is
allowed to change the state of network. However, Mainline modules
are not allowed to use non-formal APIs, fortunately CS is the
only caller of this ConnectivityManager#enforceChangePermission.
Thus, implement the Settings API on ConnectivityService and remove
the ConnectivityManager#enforceChangePermission and
Settings#checkAndNoteChangeNetworkStateOperation.

Bug: 178565313
Test: atest FrameworksNetTests
Change-Id: I6f03398c1735b89470ad5bdbe3a036929daeb53c
2021-02-23 08:33:01 +00:00