Block location accuracy when DISALLOW_CONFIG_LOCATION is set.
Bug: 72633181 Test: make ROBOTEST_FILTER=InjectedSettingTest -j40 RunSettingsRoboTests Test: make ROBOTEST_FILTER=LocationServicePreferenceControllerTest -j40 RunSettingsRoboTests Change-Id: I91e4dbff8bcce637424646f5435e72f9bb707631
This commit is contained in:
@@ -25,6 +25,7 @@ import android.support.v7.preference.PreferenceCategory;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.settings.widget.RestrictedAppPreference;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import com.android.settingslib.core.lifecycle.LifecycleObserver;
|
||||
import com.android.settingslib.core.lifecycle.events.OnPause;
|
||||
@@ -88,7 +89,13 @@ public class LocationServicePreferenceController extends LocationBasePreferenceC
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
mCategoryLocationServices.removeAll();
|
||||
LocationSettings.addPreferencesSorted(getLocationServices(), mCategoryLocationServices);
|
||||
final List<Preference> prefs = getLocationServices();
|
||||
for (Preference pref : prefs) {
|
||||
if (pref instanceof RestrictedAppPreference) {
|
||||
((RestrictedAppPreference) pref).checkRestrictionAndSetDisabled();
|
||||
}
|
||||
}
|
||||
LocationSettings.addPreferencesSorted(prefs, mCategoryLocationServices);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user