diff options
author | Erik <roboerik@android.com> | 2010-03-08 15:21:29 -0800 |
---|---|---|
committer | Erik <roboerik@android.com> | 2010-03-08 15:25:43 -0800 |
commit | 5bc5cedc7ae2808ed487d90ff86caedc722021db (patch) | |
tree | 189f2ebe6860d5307ec75e7da68afdc9a91240b4 /src/com/android/settings/widget | |
parent | 29a6e1caa1b9a568e8cd3d38f94049baad960782 (diff) | |
download | packages_apps_Settings-5bc5cedc7ae2808ed487d90ff86caedc722021db.zip packages_apps_Settings-5bc5cedc7ae2808ed487d90ff86caedc722021db.tar.gz packages_apps_Settings-5bc5cedc7ae2808ed487d90ff86caedc722021db.tar.bz2 |
b/2491823 Fixed brightness toggle for phones w/o auto-brightness
Logic didn't allow a transition from max to min brightness when used on
a phone that didn't support auto-brightness.
Diffstat (limited to 'src/com/android/settings/widget')
-rw-r--r-- | src/com/android/settings/widget/SettingsAppWidgetProvider.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/settings/widget/SettingsAppWidgetProvider.java b/src/com/android/settings/widget/SettingsAppWidgetProvider.java index 4ec5b82..005fc13 100644 --- a/src/com/android/settings/widget/SettingsAppWidgetProvider.java +++ b/src/com/android/settings/widget/SettingsAppWidgetProvider.java @@ -435,6 +435,7 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider { brightness = MAXIMUM_BACKLIGHT; } else { brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC; + brightness = MINIMUM_BACKLIGHT; } if (context.getResources().getBoolean( @@ -443,6 +444,9 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider { Settings.System.putInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, brightnessMode); + } else { + // Make sure we set the brightness if automatic mode isn't available + brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL; } if (brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL) { power.setBacklightBrightness(brightness); |