From 81854ca397558f1a41a985b9b6aa468cde5e97f0 Mon Sep 17 00:00:00 2001 From: paulhu Date: Mon, 8 Mar 2021 10:58:39 +0800 Subject: [PATCH] Update Utils#getTetheringLabel usage on Settings Utils#getTetheringLabel() is using TetheringManger to get tetherable interface. So update the usage on Settings. Bug: 180693313 Test: atest SettingsRoboTests Change-Id: I4e1a983195a0fe91b98a497b6377f2ff554a3ffd --- .../settings/network/TetherPreferenceController.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/com/android/settings/network/TetherPreferenceController.java b/src/com/android/settings/network/TetherPreferenceController.java index 8df0ac1f7fd..f91f78713dc 100644 --- a/src/com/android/settings/network/TetherPreferenceController.java +++ b/src/com/android/settings/network/TetherPreferenceController.java @@ -27,7 +27,6 @@ import android.content.Context; 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 @@ public class TetherPreferenceController extends AbstractPreferenceController imp private final boolean mAdminDisallowedTetherConfig; private final AtomicReference mBluetoothPan; - private final ConnectivityManager mConnectivityManager; private final BluetoothAdapter mBluetoothAdapter; private final TetheringManager mTetheringManager; @VisibleForTesting @@ -86,7 +84,6 @@ public class TetherPreferenceController extends AbstractPreferenceController imp super(null); mAdminDisallowedTetherConfig = false; mBluetoothPan = new AtomicReference<>(); - mConnectivityManager = null; mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); mTetheringManager = null; } @@ -95,8 +92,6 @@ public class TetherPreferenceController extends AbstractPreferenceController imp 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 @@ public class TetherPreferenceController extends AbstractPreferenceController imp mPreference = screen.findPreference(KEY_TETHER_SETTINGS); if (mPreference != null && !mAdminDisallowedTetherConfig) { mPreference.setTitle( - com.android.settingslib.Utils.getTetheringLabel(mConnectivityManager)); + com.android.settingslib.Utils.getTetheringLabel(mTetheringManager)); } }