Loading services/core/java/com/android/server/am/ActivityManagerService.java +5 −3 Original line number Diff line number Diff line Loading @@ -16998,8 +16998,6 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void addPendingTopUid(int uid, int pid) { mPendingStartActivityUids.add(uid, pid); // If the next top activity is in cached and frozen mode, WM should raise its priority // to unfreeze it. This is done by calling AMS.updateOomAdj that will lower its oom adj. // However, WM cannot hold the AMS clock here so the updateOomAdj operation is performed Loading @@ -17007,9 +17005,13 @@ public class ActivityManagerService extends IActivityManager.Stub // next top activity on time. This race will fail the following binder transactions WM // sends to the activity. After this race issue between WM/ATMS and AMS is solved, this // workaround can be removed. (b/213288355) if (!isPendingTopUid(uid)) { mOomAdjuster.mCachedAppOptimizer.unfreezeProcess(pid); } mPendingStartActivityUids.add(uid, pid); } @Override public void deletePendingTopUid(int uid) { mPendingStartActivityUids.delete(uid); services/core/java/com/android/server/am/CachedAppOptimizer.java +2 −2 Original line number Diff line number Diff line Loading @@ -1048,16 +1048,16 @@ public final class CachedAppOptimizer { * This quick function works around the race condition between WM/ATMS and AMS, allowing * the former to directly unfreeze a frozen process before the latter runs updateOomAdj. * After the race issue is solved, this workaround can be removed. (b/213288355) * The caller of this function should still trigger updateOomAdj for AMS to unfreeze the app. * @param pid pid of the process to be unfrozen */ @GuardedBy({"mFreezerLock"}) void unfreezeProcess(int pid) { synchronized (mFreezerLock) { ProcessRecord app = mFrozenProcesses.get(pid); if (app == null) { return; } Slog.i(TAG_AM, "quick sync unfreeze " + pid); Slog.d(TAG_AM, "quick sync unfreeze " + pid); try { freezeBinder(pid, false); } catch (RuntimeException e) { Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +5 −3 Original line number Diff line number Diff line Loading @@ -16998,8 +16998,6 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void addPendingTopUid(int uid, int pid) { mPendingStartActivityUids.add(uid, pid); // If the next top activity is in cached and frozen mode, WM should raise its priority // to unfreeze it. This is done by calling AMS.updateOomAdj that will lower its oom adj. // However, WM cannot hold the AMS clock here so the updateOomAdj operation is performed Loading @@ -17007,9 +17005,13 @@ public class ActivityManagerService extends IActivityManager.Stub // next top activity on time. This race will fail the following binder transactions WM // sends to the activity. After this race issue between WM/ATMS and AMS is solved, this // workaround can be removed. (b/213288355) if (!isPendingTopUid(uid)) { mOomAdjuster.mCachedAppOptimizer.unfreezeProcess(pid); } mPendingStartActivityUids.add(uid, pid); } @Override public void deletePendingTopUid(int uid) { mPendingStartActivityUids.delete(uid);
services/core/java/com/android/server/am/CachedAppOptimizer.java +2 −2 Original line number Diff line number Diff line Loading @@ -1048,16 +1048,16 @@ public final class CachedAppOptimizer { * This quick function works around the race condition between WM/ATMS and AMS, allowing * the former to directly unfreeze a frozen process before the latter runs updateOomAdj. * After the race issue is solved, this workaround can be removed. (b/213288355) * The caller of this function should still trigger updateOomAdj for AMS to unfreeze the app. * @param pid pid of the process to be unfrozen */ @GuardedBy({"mFreezerLock"}) void unfreezeProcess(int pid) { synchronized (mFreezerLock) { ProcessRecord app = mFrozenProcesses.get(pid); if (app == null) { return; } Slog.i(TAG_AM, "quick sync unfreeze " + pid); Slog.d(TAG_AM, "quick sync unfreeze " + pid); try { freezeBinder(pid, false); } catch (RuntimeException e) { Loading