summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/ButtonSettings.java
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2015-02-19 14:05:03 -0800
committerAdnan Begovic <adnan@cyngn.com>2015-10-29 17:36:31 -0700
commit9372ee651f28d0a207fa0bb9fce713f0f59b8925 (patch)
treecbe0c3d54b038c90a55fc0a4d7c6d0e82e7125db /src/com/android/settings/ButtonSettings.java
parent7152dd4b22b7234b5cb63e6038e472dcc0997503 (diff)
downloadpackages_apps_Settings-9372ee651f28d0a207fa0bb9fce713f0f59b8925.zip
packages_apps_Settings-9372ee651f28d0a207fa0bb9fce713f0f59b8925.tar.gz
packages_apps_Settings-9372ee651f28d0a207fa0bb9fce713f0f59b8925.tar.bz2
Settings: use correct default value for backlight brightness
When the user has enabled the nav bar through the setupwizard and returns back to the buttons settings and toggles the nav bar off, the backlight brightness would not be restored because there was no previous value to read from, so use the default framework value if none exists. Change-Id: If4ce90bcde3c9a59f26e49be2c585df844ead6bd Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'src/com/android/settings/ButtonSettings.java')
-rw-r--r--src/com/android/settings/ButtonSettings.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/com/android/settings/ButtonSettings.java b/src/com/android/settings/ButtonSettings.java
index d200679..255c883 100644
--- a/src/com/android/settings/ButtonSettings.java
+++ b/src/com/android/settings/ButtonSettings.java
@@ -598,12 +598,10 @@ public class ButtonSettings extends SettingsPreferenceFragment implements
Settings.Secure.putInt(context.getContentResolver(),
Settings.Secure.BUTTON_BRIGHTNESS, 0);
} else {
- int oldBright = prefs.getInt("pre_navbar_button_backlight", -1);
- if (oldBright != -1) {
- Settings.Secure.putInt(context.getContentResolver(),
- Settings.Secure.BUTTON_BRIGHTNESS, oldBright);
- editor.remove("pre_navbar_button_backlight");
- }
+ int oldBright = prefs.getInt("pre_navbar_button_backlight", defaultBrightness);
+ Settings.Secure.putInt(context.getContentResolver(),
+ Settings.Secure.BUTTON_BRIGHTNESS, oldBright);
+ editor.remove("pre_navbar_button_backlight");
}
editor.commit();
}