diff options
author | Lifu Tang <lifu@google.com> | 2013-09-03 10:09:15 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-03 10:09:15 -0700 |
commit | 79063a456932f91d521a80f9c643ca1397654698 (patch) | |
tree | 4fffde083f83361923b2f016fb7e883fde6ce67d /src/com/android/settings | |
parent | c6380a2622978fefb9b007e3ad09744ab1aff20b (diff) | |
parent | 47aab2eed7263e9593f1e866672f73ec30c7bc17 (diff) | |
download | packages_apps_Settings-79063a456932f91d521a80f9c643ca1397654698.tar.gz packages_apps_Settings-79063a456932f91d521a80f9c643ca1397654698.tar.bz2 packages_apps_Settings-79063a456932f91d521a80f9c643ca1397654698.zip |
am 47aab2ee: Merge "Shows correct state when location sharing disabled" into klp-dev
* commit '47aab2eed7263e9593f1e866672f73ec30c7bc17':
Shows correct state when location sharing disabled
Diffstat (limited to 'src/com/android/settings')
-rw-r--r-- | src/com/android/settings/location/LocationSettings.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java index 815be4158..22bf42be2 100644 --- a/src/com/android/settings/location/LocationSettings.java +++ b/src/com/android/settings/location/LocationSettings.java @@ -233,9 +233,12 @@ public class LocationSettings extends LocationSettingsBase break; } - boolean enabled = (mode != Settings.Secure.LOCATION_MODE_OFF) && !restricted; + // Restricted user can't change the location mode, so disable the master switch. But in some + // corner cases, the location might still be enabled. In such case the master switch should + // be disabled but checked. + boolean enabled = (mode != Settings.Secure.LOCATION_MODE_OFF); mSwitch.setEnabled(!restricted); - mLocationMode.setEnabled(enabled); + mLocationMode.setEnabled(enabled && !restricted); if (enabled != mSwitch.isChecked()) { // set listener to null so that that code below doesn't trigger onCheckedChanged() |