Refactor tether logic for reuse
am: 135619d483
Change-Id: I216dcb55a0f2423766abb4c30fc996f13afda2e4
This commit is contained in:
@@ -88,8 +88,7 @@ public class TetherPreferenceController extends PreferenceController
|
||||
public TetherPreferenceController(Context context, Lifecycle lifecycle) {
|
||||
super(context);
|
||||
mBluetoothPan = new AtomicReference<>();
|
||||
mAdminDisallowedTetherConfig = checkIfRestrictionEnforced(
|
||||
context, DISALLOW_CONFIG_TETHERING, UserHandle.myUserId()) != null;
|
||||
mAdminDisallowedTetherConfig = isTetherConfigDisallowed(context);
|
||||
mConnectivityManager =
|
||||
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
@@ -170,6 +169,11 @@ public class TetherPreferenceController extends PreferenceController
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isTetherConfigDisallowed(Context context) {
|
||||
return checkIfRestrictionEnforced(
|
||||
context, DISALLOW_CONFIG_TETHERING, UserHandle.myUserId()) != null;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void updateSummary() {
|
||||
if (mPreference == null) {
|
||||
|
Reference in New Issue
Block a user