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

Commit 23051cac authored by Christopher Tate's avatar Christopher Tate Committed by Android Git Automerger
Browse files

am 6098618d: am 044fd573: Merge "Don\'t crash when no alarms are scheduled" into klp-dev

* commit '6098618d':
  Don't crash when no alarms are scheduled
parents a4fbd6dd 6098618d
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1016,12 +1016,11 @@ class AlarmManagerService extends IAlarmManager.Stub {
    private native int setKernelTimezone(int fd, int minuteswest);

    private void triggerAlarmsLocked(ArrayList<Alarm> triggerList, long nowELAPSED, long nowRTC) {
        Batch batch;

        // batches are temporally sorted, so we need only pull from the
        // start of the list until we either empty it or hit a batch
        // that is not yet deliverable
        while ((batch = mAlarmBatches.get(0)) != null) {
        while (mAlarmBatches.size() > 0) {
            Batch batch = mAlarmBatches.get(0);
            if (batch.start > nowELAPSED) {
                // Everything else is scheduled for the future
                break;