Loading services/core/java/com/android/server/am/ActivityManagerService.java +2 −3 Original line number Diff line number Diff line Loading @@ -17002,6 +17002,7 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void addPendingTopUid(int uid, int pid) { final boolean isNewPending = 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 @@ -17009,11 +17010,9 @@ 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)) { if (isNewPending && mOomAdjuster != null) { // It can be null in unit test. mOomAdjuster.mCachedAppOptimizer.unfreezeProcess(pid); } mPendingStartActivityUids.add(uid, pid); } @Override services/core/java/com/android/server/am/PendingStartActivityUids.java +4 −1 Original line number Diff line number Diff line Loading @@ -46,10 +46,13 @@ final class PendingStartActivityUids { mContext = context; } synchronized void add(int uid, int pid) { /** Returns {@code true} if the uid is put to the pending array. Otherwise it existed. */ synchronized boolean add(int uid, int pid) { if (mPendingUids.get(uid) == null) { mPendingUids.put(uid, new Pair<>(pid, SystemClock.elapsedRealtime())); return true; } return false; } synchronized void delete(int uid) { Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +2 −3 Original line number Diff line number Diff line Loading @@ -17002,6 +17002,7 @@ public class ActivityManagerService extends IActivityManager.Stub @Override public void addPendingTopUid(int uid, int pid) { final boolean isNewPending = 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 @@ -17009,11 +17010,9 @@ 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)) { if (isNewPending && mOomAdjuster != null) { // It can be null in unit test. mOomAdjuster.mCachedAppOptimizer.unfreezeProcess(pid); } mPendingStartActivityUids.add(uid, pid); } @Override
services/core/java/com/android/server/am/PendingStartActivityUids.java +4 −1 Original line number Diff line number Diff line Loading @@ -46,10 +46,13 @@ final class PendingStartActivityUids { mContext = context; } synchronized void add(int uid, int pid) { /** Returns {@code true} if the uid is put to the pending array. Otherwise it existed. */ synchronized boolean add(int uid, int pid) { if (mPendingUids.get(uid) == null) { mPendingUids.put(uid, new Pair<>(pid, SystemClock.elapsedRealtime())); return true; } return false; } synchronized void delete(int uid) { Loading