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

Commit 8434b4cf authored by Shibin George's avatar Shibin George Committed by android-build-merger
Browse files

Merge "Synchronize access of mSubscriptions"

am: d065220a

* commit 'd065220a':
  Synchronize access of mSubscriptions

Change-Id: I5b28986dd770abbeeb9aaff872577230c3b56abd
parents e82ac1b5 d065220a
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");
            }