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

Commit 6e22f2da authored by Shibin George's avatar Shibin George Committed by android-build-merger
Browse files

Merge "Synchronize access of mSubscriptions" am: d065220a

am: 8434b4cf

* commit '8434b4cf':
  Synchronize access of mSubscriptions

Change-Id: I95c81631a171257594adc0af47e0a436d560d20e
parents d4234072 8434b4cf
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -72,6 +72,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);
@@ -83,6 +85,7 @@ public class ZenModeConditions implements ConditionProviders.Callback {
                    }
                }
            }
        }
        mFirstEvaluation = false;
    }

@@ -145,7 +148,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");
            }