RESTRICT AUTOMERGE Fix: policy enforcement for location wifi scanning
Make DISALLOW_CONFIG_LOCATION effectively disallow wifi scanning and
bluetooth scanning settings for location services.
screenshots: http://shortn/_EUOdqrOcnS, http://shortn/_j320QDm1Zo
Bug: 228315522
Bug: 228315529
Test: atest SettingsRoboTests, on device
Change-Id: I78291579a79e915a27ebdd051b3caf3fc04efc41
(cherry picked from commit fcae147f58
)
This commit is contained in:
@@ -16,10 +16,14 @@
|
||||
package com.android.settings.location;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.RestrictedPreference;
|
||||
|
||||
/**
|
||||
* Preference controller for Bluetooth scanning in Location Services.
|
||||
@@ -31,6 +35,13 @@ public class LocationServicesBluetoothScanningPreferenceController extends
|
||||
super(context, key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
((RestrictedPreference) preference).checkRestrictionAndSetDisabled(
|
||||
UserManager.DISALLOW_CONFIG_LOCATION);
|
||||
refreshSummary(preference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
final boolean bleScanOn = Settings.Global.getInt(mContext.getContentResolver(),
|
||||
|
Reference in New Issue
Block a user