Merge "Refactor tether logic for reuse" into oc-mr1-dev

am: 705a9e7e85

Change-Id: If61a7e53543929257b689c9cc7326c836d6c397c
This commit is contained in:
Salvador Martinez
2017-08-08 19:02:08 +00:00
committed by android-build-merger

View File

@@ -88,8 +88,7 @@ public class TetherPreferenceController extends AbstractPreferenceController imp
public TetherPreferenceController(Context context, Lifecycle lifecycle) {
super(context);
mBluetoothPan = new AtomicReference<>();
mAdminDisallowedTetherConfig = checkIfRestrictionEnforced(
mContext, 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 AbstractPreferenceController imp
}
}
public static boolean isTetherConfigDisallowed(Context context) {
return checkIfRestrictionEnforced(
context, DISALLOW_CONFIG_TETHERING, UserHandle.myUserId()) != null;
}
@VisibleForTesting
void updateSummary() {
if (mPreference == null) {