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

Commit 7ba146d5 authored by Jing Ji's avatar Jing Ji
Browse files

Reduce the scope of holding the mPidsSelfLocked lock

Fix a watchdog bite with it.

Bug: 342548620
Test: Manual
Change-Id: I31faaffd5573d6eb4dda8f005ae50a17df76cbc5
parent b0f4faad
Loading
Loading
Loading
Loading
+32 −31
Original line number Diff line number Diff line
@@ -6023,11 +6023,13 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
        synchronized (mProcLock) {
            synchronized (mPidsSelfLocked) {
            int newestTimeIndex = -1;
            long newestTime = Long.MIN_VALUE;
            for (int i = 0; i < pids.length; i++) {
                    ProcessRecord pr = mPidsSelfLocked.get(pids[i]);
                final ProcessRecord pr;
                synchronized (mPidsSelfLocked) {
                    pr = mPidsSelfLocked.get(pids[i]);
                }
                if (pr != null) {
                    final long pendingTopTime =
                            mPendingStartActivityUids.getPendingTopPidTime(pr.uid, pids[i]);
@@ -6064,7 +6066,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
        }
    }
    }
    // =========================================================
    // PERMISSIONS