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

Commit dec3714f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "AlarmManager: Reschedule the date changed event if time changed."

parents ae01042e 0ae19860
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2015,6 +2015,7 @@ class AlarmManagerService extends SystemService {
        public ClockReceiver() {
            IntentFilter filter = new IntentFilter();
            filter.addAction(Intent.ACTION_TIME_TICK);
            filter.addAction(Intent.ACTION_TIME_CHANGED);
            filter.addAction(Intent.ACTION_DATE_CHANGED);
            getContext().registerReceiver(this, filter);
        }
@@ -2026,6 +2027,11 @@ class AlarmManagerService extends SystemService {
                    Slog.v(TAG, "Received TIME_TICK alarm; rescheduling");
                }
                scheduleTimeTickEvent();
            } else if (intent.getAction().equals(Intent.ACTION_TIME_CHANGED)) {
                if (DEBUG_BATCH) {
                    Slog.v(TAG, "Received TIME_CHANGED alarm; reschedule date changed event.");
                }
                scheduleDateChangedEvent();
            } else if (intent.getAction().equals(Intent.ACTION_DATE_CHANGED)) {
                // Since the kernel does not keep track of DST, we need to
                // reset the TZ information at the beginning of each day
@@ -2054,7 +2060,7 @@ class AlarmManagerService extends SystemService {
        public void scheduleDateChangedEvent() {
            Calendar calendar = Calendar.getInstance();
            calendar.setTimeInMillis(System.currentTimeMillis());
            calendar.set(Calendar.HOUR, 0);
            calendar.set(Calendar.HOUR_OF_DAY, 0);
            calendar.set(Calendar.MINUTE, 0);
            calendar.set(Calendar.SECOND, 0);
            calendar.set(Calendar.MILLISECOND, 0);