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

Commit ab0c14cd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow setting alarm to the same time as an earlier one"

parents f91f5dc8 2fa9545e
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -2584,7 +2584,7 @@ class AlarmManagerService extends SystemService {
        if (mAlarmBatches.size() > 0) {
        if (mAlarmBatches.size() > 0) {
            final Batch firstWakeup = findFirstWakeupBatchLocked();
            final Batch firstWakeup = findFirstWakeupBatchLocked();
            final Batch firstBatch = mAlarmBatches.get(0);
            final Batch firstBatch = mAlarmBatches.get(0);
            if (firstWakeup != null && mNextWakeup != firstWakeup.start) {
            if (firstWakeup != null) {
                mNextWakeup = firstWakeup.start;
                mNextWakeup = firstWakeup.start;
                mLastWakeupSet = SystemClock.elapsedRealtime();
                mLastWakeupSet = SystemClock.elapsedRealtime();
                setLocked(ELAPSED_REALTIME_WAKEUP, firstWakeup.start);
                setLocked(ELAPSED_REALTIME_WAKEUP, firstWakeup.start);
@@ -2598,7 +2598,7 @@ class AlarmManagerService extends SystemService {
                nextNonWakeup = mNextNonWakeupDeliveryTime;
                nextNonWakeup = mNextNonWakeupDeliveryTime;
            }
            }
        }
        }
        if (nextNonWakeup != 0 && mNextNonWakeup != nextNonWakeup) {
        if (nextNonWakeup != 0) {
            mNextNonWakeup = nextNonWakeup;
            mNextNonWakeup = nextNonWakeup;
            setLocked(ELAPSED_REALTIME, nextNonWakeup);
            setLocked(ELAPSED_REALTIME, nextNonWakeup);
        }
        }
@@ -3229,6 +3229,8 @@ class AlarmManagerService extends SystemService {
                    expectedMaxWhenElapsed, nowELAPSED, pw);
                    expectedMaxWhenElapsed, nowELAPSED, pw);
                    pw.print(" whenElapsed="); TimeUtils.formatDuration(whenElapsed,
                    pw.print(" whenElapsed="); TimeUtils.formatDuration(whenElapsed,
                            nowELAPSED, pw);
                            nowELAPSED, pw);
                    pw.print(" maxWhenElapsed="); TimeUtils.formatDuration(maxWhenElapsed,
                            nowELAPSED, pw);
                    pw.print(" when=");
                    pw.print(" when=");
                    if (isRtc) {
                    if (isRtc) {
                        pw.print(sdf.format(new Date(when)));
                        pw.print(sdf.format(new Date(when)));