From 2f7c9edfb3f65e5defc7c24bd9348dc76d9e65a5 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Tue, 10 Nov 2009 11:05:42 -0800 Subject: Preserve dim status when pausing. Fixes http://b/2251135 (snoozing an alarm leaves the clock in painfully-bright mode). --- src/com/android/deskclock/DeskClock.java | 18 ++++++++++++------ 1 file 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 -- cgit v1.2.3