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

Commit 16e85886 authored by Christopher Tate's avatar Christopher Tate Committed by Android Git Automerger
Browse files

am e5f477ff: am ad7c57db: Merge "Always re-evaluate kernel alarm setpoints...

am e5f477ff: am ad7c57db: Merge "Always re-evaluate kernel alarm setpoints when a new alarm is added" into klp-dev

* commit 'e5f477ff':
  Always re-evaluate kernel alarm setpoints when a new alarm is added
parents e1b16b09 e5f477ff
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -577,16 +577,14 @@ class AlarmManagerService extends IAlarmManager.Stub {
                operation, workSource);
        removeLocked(operation);

        boolean reschedule;
        int whichBatch = (isStandalone) ? -1 : attemptCoalesceLocked(whenElapsed, maxWhen);
        if (whichBatch < 0) {
            Batch batch = new Batch(a);
            batch.standalone = isStandalone;
            reschedule = addBatchLocked(mAlarmBatches, batch);
            addBatchLocked(mAlarmBatches, batch);
        } else {
            Batch batch = mAlarmBatches.get(whichBatch);
            reschedule = batch.add(a);
            if (reschedule) {
            if (batch.add(a)) {
                // The start time of this batch advanced, so batch ordering may
                // have just been broken.  Move it to where it now belongs.
                mAlarmBatches.remove(whichBatch);
@@ -602,14 +600,11 @@ class AlarmManagerService extends IAlarmManager.Stub {
                        + " interval=" + interval + " op=" + operation
                        + " standalone=" + isStandalone);
                rebatchAllAlarmsLocked(false);
                reschedule = true;
            }
        }

        if (reschedule) {
        rescheduleKernelAlarmsLocked();
    }
    }

    private void logBatchesLocked() {
        ByteArrayOutputStream bs = new ByteArrayOutputStream(2048);