Merge "Update Utils#getTetheringLabel usage on Settings" am: 2b1e3a971f am: ddf3efb070
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1601653
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Iccd3b694b9e9f4ac1658093923c923a98d83ccfb
diff --git a/src/com/android/settings/network/TetherPreferenceController.java b/src/com/android/settings/network/TetherPreferenceController.java
index 8df0ac1..f91f787 100644
--- a/src/com/android/settings/network/TetherPreferenceController.java
+++ b/src/com/android/settings/network/TetherPreferenceController.java
@@ -27,7 +27,6 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.database.ContentObserver;
-import android.net.ConnectivityManager;
import android.net.TetheringManager;
import android.net.Uri;
import android.os.Bundle;
@@ -61,7 +60,6 @@
private final boolean mAdminDisallowedTetherConfig;
private final AtomicReference<BluetoothPan> mBluetoothPan;
- private final ConnectivityManager mConnectivityManager;
private final BluetoothAdapter mBluetoothAdapter;
private final TetheringManager mTetheringManager;
@VisibleForTesting
@@ -86,7 +84,6 @@
super(null);
mAdminDisallowedTetherConfig = false;
mBluetoothPan = new AtomicReference<>();
- mConnectivityManager = null;
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mTetheringManager = null;
}
@@ -95,8 +92,6 @@
super(context);
mBluetoothPan = new AtomicReference<>();
mAdminDisallowedTetherConfig = isTetherConfigDisallowed(context);
- mConnectivityManager =
- (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mTetheringManager = context.getSystemService(TetheringManager.class);
if (lifecycle != null) {
@@ -110,7 +105,7 @@
mPreference = screen.findPreference(KEY_TETHER_SETTINGS);
if (mPreference != null && !mAdminDisallowedTetherConfig) {
mPreference.setTitle(
- com.android.settingslib.Utils.getTetheringLabel(mConnectivityManager));
+ com.android.settingslib.Utils.getTetheringLabel(mTetheringManager));
}
}