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

Commit 98844a97 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Gerrit Code Review
Browse files

Merge "Fix race condition when collecting op callback."

parents 4ef9d410 40b300fd
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;