Disallows setting when user restriction applies

- Fix b/10116533

Change-Id: Ib171f9545c1651fb36c408decefa47b3d82ba3ab
This commit is contained in:
Lifu Tang
2013-08-27 17:09:55 -07:00
parent 8df4caf168
commit 4fb17c1c98
3 changed files with 19 additions and 9 deletions

View File

@@ -110,7 +110,7 @@ public class LocationMode extends LocationSettingsBase
}
@Override
public void onModeChanged(int mode) {
public void onModeChanged(int mode, boolean restricted) {
switch (mode) {
case Settings.Secure.LOCATION_MODE_OFF:
Intent intent = new Intent();
@@ -129,7 +129,8 @@ public class LocationMode extends LocationSettingsBase
default:
break;
}
boolean enabled = (mode != Settings.Secure.LOCATION_MODE_OFF);
boolean enabled = (mode != Settings.Secure.LOCATION_MODE_OFF) && !restricted;
mHighAccuracy.setEnabled(enabled);
mBatterySaving.setEnabled(enabled);
mSensorsOnly.setEnabled(enabled);