Replace ConnectivityManager hidden symbols on Settings

Connectivity is becoming a mainline module in S, so
ConnectivityManager hidden symbols can not be used for outside
components. Besides, most Tethering relevant methods or variables
on CM are migrated to TetheringManager. So replace all these
methods or variables from ConnectivityManager to TetheringManager
on Settings.

Bug: 180693313
Test: make RunSettingsRoboTests ROBOTEST_FILTER=<Modified Test>
Change-Id: Iba4b121a4ddf3f04252aa0355e0e6494a593682a
Merged-In: Iba4b121a4ddf3f04252aa0355e0e6494a593682a
This commit is contained in:
paulhu
2021-02-20 11:21:53 +08:00
parent 78b260f5fe
commit c11ac84929
27 changed files with 139 additions and 135 deletions

View File

@@ -147,7 +147,7 @@ public class TetherEnabler implements SwitchWidgetController.OnSwitchChangeListe
mSwitchWidgetController.setListener(this);
mSwitchWidgetController.startListening();
final IntentFilter filter = new IntentFilter(
ConnectivityManager.ACTION_TETHER_STATE_CHANGED);
TetheringManager.ACTION_TETHER_STATE_CHANGED);
filter.addAction(WifiManager.WIFI_AP_STATE_CHANGED_ACTION);
filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
mContext.registerReceiver(mTetherChangeReceiver, filter);
@@ -222,7 +222,7 @@ public class TetherEnabler implements SwitchWidgetController.OnSwitchChangeListe
int getTetheringState(@Nullable String[] tethered) {
int tetherState = TETHERING_OFF;
if (tethered == null) {
tethered = mConnectivityManager.getTetheredIfaces();
tethered = mTetheringManager.getTetheredIfaces();
}
if (mWifiManager.isWifiApEnabled()) {
@@ -239,7 +239,7 @@ public class TetherEnabler implements SwitchWidgetController.OnSwitchChangeListe
}
}
String[] usbRegexs = mConnectivityManager.getTetherableUsbRegexs();
String[] usbRegexs = mTetheringManager.getTetherableUsbRegexs();
for (String s : tethered) {
for (String regex : usbRegexs) {
if (s.matches(regex)) {