OSDN Git Service

Disable the snooze if it matches the alarm that has been changed.
authorPatrick Scott <phanna@android.com>
Wed, 17 Feb 2010 13:27:17 +0000 (08:27 -0500)
committerPatrick Scott <phanna@android.com>
Wed, 17 Feb 2010 13:31:08 +0000 (08:31 -0500)
The user most likely wants the alarm to fire at the time they just set so
disable the snooze alert.

Bug: 2421068

src/com/android/deskclock/Alarms.java

index 92457ad..69047a0 100644 (file)
@@ -201,6 +201,15 @@ public class Alarms {
         long timeInMillis = calculateAlarm(alarm);
 
         if (alarm.enabled) {
+            // Disable the snooze if we just changed the snoozed alarm. This
+            // only does work if the snoozed alarm is the same as the given
+            // alarm.
+            // TODO: disableSnoozeAlert should have a better name.
+            disableSnoozeAlert(context, alarm.id);
+
+            // Disable the snooze if this alarm fires before the snoozed alarm.
+            // This works on every alarm since the user most likely intends to
+            // have the modified alarm fire next.
             clearSnoozeIfNeeded(context, timeInMillis);
         }