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

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

Merge "Synchronize access of mSubscriptions" am: d065220a am: 8434b4cf am: 6e22f2da

am: 9ed59cfd

* commit '9ed59cfd':
  Synchronize access of mSubscriptions

Change-Id: I172338ca1f47a89515bf8456138773b11ae0dbae
parents 49e76d94 9ed59cfd
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");
            }