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

Commit 67801185 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Fix race condition when collecting op callback."

am: 98844a97

* commit '98844a97':
  Fix race condition when collecting op callback.
parents bc57510e 98844a97
Loading
Loading
Loading
Loading
+25 −23
Original line number Diff line number Diff line
@@ -513,6 +513,7 @@ public class AppOpsService extends IAppOpsService.Stub {
        String[] uidPackageNames = getPackagesForUid(uid);
        ArrayMap<Callback, ArraySet<String>> callbackSpecs = null;

        synchronized (this) {
            ArrayList<Callback> callbacks = mOpModeWatchers.get(code);
            if (callbacks != null) {
                final int callbackCount = callbacks.size();
@@ -543,6 +544,7 @@ public class AppOpsService extends IAppOpsService.Stub {
                    }
                }
            }
        }

        if (callbackSpecs == null) {
            return;