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

Commit 848dbe4e authored by mark_chen's avatar mark_chen Committed by Steve Kondik
Browse files

[ActivityManager] Use synchronized to protect object

Symptom: ArrayIndexOutOfBoundsException at mResourcePackages
Root Cause: Race condition issue
Solution: Use synchronized to protect object

Change-Id: Ia2d89d50919d95d95f6f8ac2eb75594a93e8f2da
parent 6321b1cb
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -4161,6 +4161,7 @@ public final class ActivityThread {
    final void handleDispatchPackageBroadcast(int cmd, String[] packages) {
        boolean hasPkgInfo = false;
        if (packages != null) {
            synchronized (mResourcesManager) {
                for (int i=packages.length-1; i>=0; i--) {
                    //Slog.i(TAG, "Cleaning old package: " + packages[i]);
                    if (!hasPkgInfo) {
@@ -4179,6 +4180,7 @@ public final class ActivityThread {
                    mResourcePackages.remove(packages[i]);
                }
            }
        }
        ApplicationPackageManager.handlePackageBroadcast(cmd, packages,
                hasPkgInfo);
    }