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

Commit a4618b02 authored by Christopher Tate's avatar Christopher Tate
Browse files

Update internal change-of-date alarm whenever timezone changes

We weren't updating the next-midnight alarm when the device time
zone was changed, meaning that the date-change broadcast did not
happen appropriately.

Bug: 117577062
Test: manual
Test: atest CtsAlarmManagerTestCases
Change-Id: I8d565f5c7da58a99e984b11d7745698e15bf47ef
parent d845abba
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1455,6 +1455,10 @@ class AlarmManagerService extends SystemService {
        TimeZone.setDefault(null);

        if (timeZoneWasChanged) {
            // Don't wait for broadcasts to update our midnight alarm
            mClockReceiver.scheduleDateChangedEvent();

            // And now let everyone else know
            Intent intent = new Intent(Intent.ACTION_TIMEZONE_CHANGED);
            intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING
                    | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND