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

Commit d065220a authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Synchronize access of mSubscriptions"

parents 233f48e3 23d28cec
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ public class ZenModeConditions implements ConditionProviders.Callback {
            evaluateRule(automaticRule, current, processSubscriptions);
            updateSnoozing(automaticRule);
        }

        synchronized (mSubscriptions) {
            final int N = mSubscriptions.size();
            for (int i = N - 1; i >= 0; i--) {
                final Uri id = mSubscriptions.keyAt(i);
@@ -87,6 +89,7 @@ public class ZenModeConditions implements ConditionProviders.Callback {
                    }
                }
            }
        }
        mFirstEvaluation = false;
    }

@@ -152,7 +155,9 @@ public class ZenModeConditions implements ConditionProviders.Callback {
        }
        if (processSubscriptions) {
            if (mConditionProviders.subscribeIfNecessary(rule.component, rule.conditionId)) {
                synchronized (mSubscriptions) {
                    mSubscriptions.put(rule.conditionId, rule.component);
                }
            } else {
                if (DEBUG) Log.d(TAG, "zmc failed to subscribe");
            }