Use pref controller to get non-indexable in network setting

Change-Id: I2bcc9047146f4ad014d5929e66ee895ee497b641
Fix: 62555826
Test: robotests
This commit is contained in:
Fan Zhang
2017-07-10 15:59:21 -07:00
parent 549d864bbf
commit af6fce6335
3 changed files with 49 additions and 41 deletions

View File

@@ -15,6 +15,10 @@
*/
package com.android.settings.network;
import static android.os.UserManager.DISALLOW_CONFIG_TETHERING;
import static com.android.settingslib.RestrictedLockUtils.checkIfRestrictionEnforced;
import static com.android.settingslib.RestrictedLockUtils.hasBaseUserRestriction;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothPan;
import android.bluetooth.BluetoothProfile;
@@ -46,11 +50,6 @@ import com.android.settingslib.core.lifecycle.events.OnResume;
import java.util.concurrent.atomic.AtomicReference;
import static android.os.UserManager.DISALLOW_CONFIG_TETHERING;
import static com.android.settingslib.RestrictedLockUtils.checkIfRestrictionEnforced;
import static com.android.settingslib.RestrictedLockUtils.hasBaseUserRestriction;
public class TetherPreferenceController extends AbstractPreferenceController implements
PreferenceControllerMixin, LifecycleObserver, OnCreate, OnResume, OnPause, OnDestroy {
@@ -90,7 +89,7 @@ public class TetherPreferenceController extends AbstractPreferenceController imp
super(context);
mBluetoothPan = new AtomicReference<>();
mAdminDisallowedTetherConfig = checkIfRestrictionEnforced(
context, DISALLOW_CONFIG_TETHERING, UserHandle.myUserId()) != null;
mContext, DISALLOW_CONFIG_TETHERING, UserHandle.myUserId()) != null;
mConnectivityManager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();