diff options
author | Lifu Tang <lifu@google.com> | 2013-09-06 18:26:21 -0700 |
---|---|---|
committer | Lifu Tang <lifu@google.com> | 2013-09-06 18:26:21 -0700 |
commit | d3a77665ef13755cf463dff27f50d78c16e595d8 (patch) | |
tree | 5d4a2dda2cdeeb47b3845447829a35a18bd3bea7 /src/com/android/settings/location | |
parent | 0d56bb295003ed2667bf6a30cc6977d0b43a0483 (diff) | |
download | packages_apps_Settings-d3a77665ef13755cf463dff27f50d78c16e595d8.tar.gz packages_apps_Settings-d3a77665ef13755cf463dff27f50d78c16e595d8.tar.bz2 packages_apps_Settings-d3a77665ef13755cf463dff27f50d78c16e595d8.zip |
Gray recent apps section when location disabled
- Fix b/10638903
Change-Id: I1c09661b0e5ac8d089a515b64301ddfe9bcedaa9
Diffstat (limited to 'src/com/android/settings/location')
-rw-r--r-- | src/com/android/settings/location/LocationSettings.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java index 06b5decce..add82c674 100644 --- a/src/com/android/settings/location/LocationSettings.java +++ b/src/com/android/settings/location/LocationSettings.java @@ -61,6 +61,7 @@ public class LocationSettings extends LocationSettingsBase private Switch mSwitch; private boolean mValidListener; private Preference mLocationMode; + private PreferenceCategory mCategoryRecentLocationRequests; private BatteryStatsHelper mStatsHelper; /** Receives UPDATE_INTENT */ private BroadcastReceiver mReceiver; @@ -150,19 +151,19 @@ public class LocationSettings extends LocationSettingsBase } }); - PreferenceCategory categoryRecentLocationRequests = + mCategoryRecentLocationRequests = (PreferenceCategory) root.findPreference(KEY_RECENT_LOCATION_REQUESTS); RecentLocationApps recentApps = new RecentLocationApps(activity, mStatsHelper); List<Preference> recentLocationRequests = recentApps.getAppList(); if (recentLocationRequests.size() > 0) { - addPreferencesSorted(recentLocationRequests, categoryRecentLocationRequests); + addPreferencesSorted(recentLocationRequests, mCategoryRecentLocationRequests); } else { // If there's no item to display, add a "No recent apps" item. Preference banner = new Preference(activity); banner.setLayoutResource(R.layout.location_list_no_item); banner.setTitle(R.string.location_no_recent_apps); banner.setSelectable(false); - categoryRecentLocationRequests.addPreference(banner); + mCategoryRecentLocationRequests.addPreference(banner); } addAppSettings(activity, root); @@ -256,6 +257,7 @@ public class LocationSettings extends LocationSettingsBase boolean enabled = (mode != Settings.Secure.LOCATION_MODE_OFF); mSwitch.setEnabled(!restricted); mLocationMode.setEnabled(enabled && !restricted); + mCategoryRecentLocationRequests.setEnabled(enabled); if (enabled != mSwitch.isChecked()) { // set listener to null so that that code below doesn't trigger onCheckedChanged() |