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

Commit df451e3e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix unit test dependency of WmTests" into tm-dev

parents 61dd88e8 e1d8c194
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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
@@ -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
+4 −1
Original line number Diff line number Diff line
@@ -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) {