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

Commit 63ec5410 authored by Danny Baumann's avatar Danny Baumann
Browse files

Fix automatic zen rules.

Merge commit 0ec8cdfe mismerged this
piece of code.

Change-Id: I297cc7d5fcbd2c999c30cc80d87d047294b40496
parent 4b90cd2e
Loading
Loading
Loading
Loading
+15 −17
Original line number Diff line number Diff line
@@ -161,6 +161,8 @@ public class ScheduleConditionProvider extends SystemConditionProviderService {
            mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
        }
        final long now = System.currentTimeMillis();
        synchronized (mSubscriptions) {
            setRegistered(!mSubscriptions.isEmpty());
            mNextAlarmTime = 0;
            long nextUserAlarmTime = getNextAlarm();
            for (Uri conditionId : mSubscriptions.keySet()) {
@@ -176,11 +178,7 @@ public class ScheduleConditionProvider extends SystemConditionProviderService {
                } else {
                    notifyCondition(conditionId, Condition.STATE_FALSE, "!meetsSchedule");
                    removeSnoozed(conditionId);
                if (nextUserAlarmTime == 0) {
                    cal.maybeSetNextAlarm(now, nextUserAlarmTime);
                } else {
                    notifyCondition(conditionId, Condition.STATE_FALSE, "!meetsSchedule");
                    if ((cal != null) && (nextUserAlarmTime == 0)) {
                    if (cal != null && nextUserAlarmTime == 0) {
                        cal.maybeSetNextAlarm(now, nextUserAlarmTime);
                    }
                }