[coastguard skipped] Merge sparse cherrypicks from sparse-10161073-L49900000960778179 into tm-qpr3-release.

COASTGUARD_SKIP: I52f9a11b1dd78a5e5dbb1bbde3cda7381c87ae39
COASTGUARD_SKIP: I293fca48382fcd71a6f055e9c140a183c2c33fdf

Change-Id: Iebb890e09e34560a889f2f62b4358d511ff6e06c
diff --git a/src/com/android/settings/location/BluetoothScanningMainSwitchPreferenceController.java b/src/com/android/settings/location/BluetoothScanningMainSwitchPreferenceController.java
index 78e3184..b491ec9 100644
--- a/src/com/android/settings/location/BluetoothScanningMainSwitchPreferenceController.java
+++ b/src/com/android/settings/location/BluetoothScanningMainSwitchPreferenceController.java
@@ -18,7 +18,6 @@
 import android.content.Context;
 import android.provider.Settings;
 import android.widget.Switch;
-import android.os.UserManager;
 
 import androidx.preference.PreferenceScreen;
 
@@ -34,11 +33,9 @@
         implements OnMainSwitchChangeListener {
 
     private static final String KEY_BLUETOOTH_SCANNING_SWITCH = "bluetooth_always_scanning_switch";
-    private final UserManager mUserManager;
 
     public BluetoothScanningMainSwitchPreferenceController(Context context) {
         super(context, KEY_BLUETOOTH_SCANNING_SWITCH);
-        mUserManager = UserManager.get(context);
     }
 
     @Override
@@ -52,9 +49,7 @@
     @Override
     public int getAvailabilityStatus() {
         return mContext.getResources().getBoolean(R.bool.config_show_location_scanning)
-                ? (mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_LOCATION)
-                        ? DISABLED_DEPENDENT_SETTING
-                        : AVAILABLE)
+                ? AVAILABLE
                 : UNSUPPORTED_ON_DEVICE;
     }
 
diff --git a/src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java b/src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java
index e22b0a0..546f1e1 100644
--- a/src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java
+++ b/src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java
@@ -18,7 +18,6 @@
 import android.content.Context;
 import android.net.wifi.WifiManager;
 import android.widget.Switch;
-import android.os.UserManager;
 
 import androidx.preference.PreferenceScreen;
 
@@ -35,12 +34,10 @@
 
     private static final String KEY_WIFI_SCANNING_SWITCH = "wifi_always_scanning_switch";
     private final WifiManager mWifiManager;
-    private final UserManager mUserManager;
 
     public WifiScanningMainSwitchPreferenceController(Context context) {
         super(context, KEY_WIFI_SCANNING_SWITCH);
         mWifiManager = context.getSystemService(WifiManager.class);
-        mUserManager = UserManager.get(context);
     }
 
     @Override
@@ -55,9 +52,7 @@
     @Override
     public int getAvailabilityStatus() {
         return mContext.getResources().getBoolean(R.bool.config_show_location_scanning)
-                ? (mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_LOCATION)
-                       ? DISABLED_DEPENDENT_SETTING
-                       : AVAILABLE)
+                ? AVAILABLE
                 : UNSUPPORTED_ON_DEVICE;
     }