summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@google.com>2009-11-10 11:05:42 -0800
committerDaniel Sandler <dsandler@google.com>2009-11-10 11:05:42 -0800
commit2f7c9edfb3f65e5defc7c24bd9348dc76d9e65a5 (patch)
tree7f3458f816d3d91f56bd3c3d75184c292081b81b
parent4e8ad3a40141d05ced3279c6a0296b71ffc5117d (diff)
downloadandroid_packages_apps_DeskClock-2f7c9edfb3f65e5defc7c24bd9348dc76d9e65a5.tar.gz
android_packages_apps_DeskClock-2f7c9edfb3f65e5defc7c24bd9348dc76d9e65a5.tar.bz2
android_packages_apps_DeskClock-2f7c9edfb3f65e5defc7c24bd9348dc76d9e65a5.zip
Preserve dim status when pausing.
Fixes http://b/2251135 (snoozing an alarm leaves the clock in painfully-bright mode).
-rw-r--r--src/com/android/deskclock/DeskClock.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/com/android/deskclock/DeskClock.java b/src/com/android/deskclock/DeskClock.java
index 56eadd0ef..2f4cde985 100644
--- a/src/com/android/deskclock/DeskClock.java
+++ b/src/com/android/deskclock/DeskClock.java
@@ -548,14 +548,9 @@ public class DeskClock extends Activity {
public void onPause() {
if (DEBUG) Log.d(LOG_TAG, "onPause");
- // Turn off the screen saver.
+ // Turn off the screen saver. (But don't un-dim.)
restoreScreen();
- // Avoid situations where the user launches Alarm Clock and is
- // surprised to find it in dim mode (because it was last used in dim
- // mode, but that last use is long in the past).
- mDimmed = false;
-
// Other things we don't want to be doing in the background.
unregisterReceiver(mIntentReceiver);
unscheduleWeatherFetch();
@@ -563,6 +558,17 @@ public class DeskClock extends Activity {
super.onPause();
}
+ @Override
+ public void onStop() {
+ if (DEBUG) Log.d(LOG_TAG, "onStop");
+
+ // Avoid situations where the user launches Alarm Clock and is
+ // surprised to find it in dim mode (because it was last used in dim
+ // mode, but that last use is long in the past).
+ mDimmed = false;
+
+ super.onStop();
+ }
private void initViews() {
// give up any internal focus before we switch layouts