Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9699c4ab authored by James Lemieux's avatar James Lemieux
Browse files

Account for DST when scheduling alarms

Note: this bug only applies to alarms occurring during the missing
hour when time jumps ahead in the spring.

Bug: 19651361
Change-Id: I163f0d139fba6920dc5ff78d53791c983f416cb1
parent 706cf570
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -391,6 +391,12 @@ public final class Alarm implements Parcelable, ClockContract.AlarmsColumns {
        if (addDays > 0) {
            nextInstanceTime.add(Calendar.DAY_OF_WEEK, addDays);
        }

        // Daylight Savings Time can alter the hours and minutes when adjusting the day above.
        // Reset the desired hour and minute now that the correct day has been chosen.
        nextInstanceTime.set(Calendar.HOUR_OF_DAY, hour);
        nextInstanceTime.set(Calendar.MINUTE, minutes);

        return nextInstanceTime;
    }