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