summaryrefslogtreecommitdiff
path: root/core/java/android/service/notification/ScheduleCalendar.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/service/notification/ScheduleCalendar.java')
-rw-r--r--core/java/android/service/notification/ScheduleCalendar.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/service/notification/ScheduleCalendar.java b/core/java/android/service/notification/ScheduleCalendar.java
index 8b7946ce7651..6ed966e0bbbd 100644
--- a/core/java/android/service/notification/ScheduleCalendar.java
+++ b/core/java/android/service/notification/ScheduleCalendar.java
@@ -70,10 +70,10 @@ public class ScheduleCalendar {
}
// only allow alarms in the future
if (nextAlarm > now) {
- // store earliest alarm
- if (mSchedule.nextAlarm == 0) {
+ if (mSchedule.nextAlarm == 0 || mSchedule.nextAlarm < now) {
mSchedule.nextAlarm = nextAlarm;
} else {
+ // store earliest alarm
mSchedule.nextAlarm = Math.min(mSchedule.nextAlarm, nextAlarm);
}
} else if (mSchedule.nextAlarm < now) {