Merge "Replace ConnectivityManager hidden symbols on Settings" am: cbcea32087 am: 995581e856

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1597453

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2cd486a47be45f68ad7b0db82dcb030a62edb0da
This commit is contained in:
Paul Hu
2021-02-25 09:37:00 +00:00
committed by Automerger Merge Worker
27 changed files with 139 additions and 135 deletions

View File

@@ -17,7 +17,7 @@
package com.android.settings.wifi.tether;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.TetheringManager;
import android.net.wifi.WifiManager;
import androidx.preference.Preference;
@@ -36,7 +36,7 @@ public abstract class WifiTetherBasePreferenceController extends AbstractPrefere
protected final WifiManager mWifiManager;
protected final String[] mWifiRegexs;
protected final ConnectivityManager mCm;
protected final TetheringManager mTm;
protected final OnTetherConfigUpdateListener mListener;
protected Preference mPreference;
@@ -46,8 +46,8 @@ public abstract class WifiTetherBasePreferenceController extends AbstractPrefere
super(context);
mListener = listener;
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
mCm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
mWifiRegexs = mCm.getTetherableWifiRegexs();
mTm = (TetheringManager) context.getSystemService(Context.TETHERING_SERVICE);
mWifiRegexs = mTm.getTetherableWifiRegexs();
}
@Override

View File

@@ -18,7 +18,7 @@ package com.android.settings.wifi.tether;
import android.annotation.NonNull;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.TetheringManager;
import android.net.wifi.SoftApConfiguration;
import android.net.wifi.WifiClient;
import android.net.wifi.WifiManager;
@@ -44,7 +44,7 @@ public class WifiTetherPreferenceController extends AbstractPreferenceController
private static final String WIFI_TETHER_SETTINGS = "wifi_tether";
private final ConnectivityManager mConnectivityManager;
private final TetheringManager mTetheringManager;
private final String[] mWifiRegexs;
private final WifiManager mWifiManager;
private final Lifecycle mLifecycle;
@@ -62,10 +62,9 @@ public class WifiTetherPreferenceController extends AbstractPreferenceController
WifiTetherPreferenceController(Context context, Lifecycle lifecycle,
boolean initSoftApManager) {
super(context);
mConnectivityManager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
mTetheringManager = context.getSystemService(TetheringManager.class);
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
mWifiRegexs = mConnectivityManager.getTetherableWifiRegexs();
mWifiRegexs = mTetheringManager.getTetherableWifiRegexs();
mLifecycle = lifecycle;
if (lifecycle != null) {
lifecycle.addObserver(this);

View File

@@ -16,7 +16,7 @@
package com.android.settings.wifi.tether;
import static android.net.ConnectivityManager.ACTION_TETHER_STATE_CHANGED;
import static android.net.TetheringManager.ACTION_TETHER_STATE_CHANGED;
import static android.net.wifi.WifiManager.WIFI_AP_STATE_CHANGED_ACTION;
import android.app.settings.SettingsEnums;