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

Commit f41dc7c3 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge changes I797c81a5,I127c1204

* changes:
  Remove WM lock from WPC#computeOomAdjFromActivities
  Remove rankTaskLayersIfNeeded from oom-adjustment calculation
parents e1f4f8e0 39380dcf
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -733,10 +733,6 @@ public final class OomAdjuster {
            uidRec.reset();
        }

        if (mService.mAtmInternal != null) {
            mService.mAtmInternal.rankTaskLayersIfNeeded();
        }

        mAdjSeq++;
        if (fullUpdate) {
            mNewNumServiceProcs = 0;
+2 −2
Original line number Diff line number Diff line
@@ -1909,8 +1909,8 @@ class ProcessRecord implements WindowProcessListener {
        }
        callback.initialize(this, adj, foregroundActivities, procState, schedGroup, appUid, logUid,
                processCurTop);
        final int minLayer = getWindowProcessController().computeOomAdjFromActivities(
                ProcessList.VISIBLE_APP_LAYER_MAX, callback);
        final int minLayer = Math.min(ProcessList.VISIBLE_APP_LAYER_MAX,
                getWindowProcessController().computeOomAdjFromActivities(callback));

        mCachedAdj = callback.adj;
        mCachedForegroundActivities = callback.foregroundActivities;
+3 −0
Original line number Diff line number Diff line
@@ -4465,6 +4465,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            }
            detachChildren();
        }
        if (app != null) {
            app.invalidateOomScoreReferenceState(false /* computeNow */);
        }

        switch (state) {
            case RESUMED:
+0 −3
Original line number Diff line number Diff line
@@ -499,9 +499,6 @@ public abstract class ActivityTaskManagerInternal {
    /** @return the process for the top-most resumed activity in the system. */
    public abstract WindowProcessController getTopApp();

    /** Generate oom-score-adjustment rank for all tasks in the system based on z-order. */
    public abstract void rankTaskLayersIfNeeded();

    /** Destroy all activities. */
    public abstract void scheduleDestroyAllActivities(String reason);

+0 −10
Original line number Diff line number Diff line
@@ -7187,16 +7187,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
            }
        }

        @HotPath(caller = HotPath.OOM_ADJUSTMENT)
        @Override
        public void rankTaskLayersIfNeeded() {
            synchronized (mGlobalLockWithoutBoost) {
                if (mRootWindowContainer != null) {
                    mRootWindowContainer.rankTaskLayersIfNeeded();
                }
            }
        }

        @Override
        public void scheduleDestroyAllActivities(String reason) {
            synchronized (mGlobalLock) {
Loading