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

Commit 8ecc05c2 authored by Aka (Chih-Yu) Huang's avatar Aka (Chih-Yu) Huang Committed by Android (Google) Code Review
Browse files

Merge "am: Remove CacheOomRanker" into main

parents 61b37a44 fb9522c9
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -10463,7 +10463,6 @@ public class ActivityManagerService extends IActivityManager.Stub
        synchronized(this) {
        synchronized(this) {
            mConstants.dump(pw);
            mConstants.dump(pw);
            mOomAdjuster.dumpCachedAppOptimizerSettings(pw);
            mOomAdjuster.dumpCachedAppOptimizerSettings(pw);
            mOomAdjuster.dumpCacheOomRankerSettings(pw);
            pw.println();
            pw.println();
            if (dumpAll) {
            if (dumpAll) {
                pw.println(
                pw.println(
@@ -10978,9 +10977,6 @@ public class ActivityManagerService extends IActivityManager.Stub
                synchronized (this) {
                synchronized (this) {
                    mConstants.dump(pw);
                    mConstants.dump(pw);
                }
                }
                synchronized (mProcLock) {
                    mOomAdjuster.dumpCacheOomRankerSettings(pw);
                }
            } else if ("cao".equals(cmd)) {
            } else if ("cao".equals(cmd)) {
                mOomAdjuster.dumpCachedAppOptimizerSettings(pw);
                mOomAdjuster.dumpCachedAppOptimizerSettings(pw);
            } else if ("timers".equals(cmd)) {
            } else if ("timers".equals(cmd)) {
+0 −501

File deleted.

Preview size limit exceeded, changes collapsed.

+0 −14
Original line number Original line Diff line number Diff line
@@ -120,7 +120,6 @@ import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal.OomAdjReason;
import android.app.ActivityManagerInternal.OomAdjReason;
import android.app.ActivityThread;
import android.app.ApplicationExitInfo;
import android.app.ApplicationExitInfo;
import android.app.usage.UsageEvents;
import android.app.usage.UsageEvents;
import android.content.BroadcastReceiver;
import android.content.BroadcastReceiver;
@@ -297,12 +296,6 @@ public abstract class OomAdjuster {
     */
     */
    CachedAppOptimizer mCachedAppOptimizer;
    CachedAppOptimizer mCachedAppOptimizer;


    /**
     * Re-rank apps getting a cache oom adjustment from lru to weighted order
     * based on weighted scores for LRU, PSS and cache use count.
     */
    CacheOomRanker mCacheOomRanker;

    ActivityManagerConstants mConstants;
    ActivityManagerConstants mConstants;


    /**
    /**
@@ -501,7 +494,6 @@ public abstract class OomAdjuster {


        mConstants = mService.mConstants;
        mConstants = mService.mConstants;
        mCachedAppOptimizer = cachedAppOptimizer;
        mCachedAppOptimizer = cachedAppOptimizer;
        mCacheOomRanker = new CacheOomRanker(service);


        mLogger = new OomAdjusterDebugLogger(this, mService.mConstants);
        mLogger = new OomAdjusterDebugLogger(this, mService.mConstants);


@@ -548,7 +540,6 @@ public abstract class OomAdjuster {


    void initSettings() {
    void initSettings() {
        mCachedAppOptimizer.init();
        mCachedAppOptimizer.init();
        mCacheOomRanker.init(ActivityThread.currentApplication().getMainExecutor());
        if (mService.mConstants.KEEP_WARMING_SERVICES.size() > 0) {
        if (mService.mConstants.KEEP_WARMING_SERVICES.size() > 0) {
            final IntentFilter filter = new IntentFilter(Intent.ACTION_USER_SWITCHED);
            final IntentFilter filter = new IntentFilter(Intent.ACTION_USER_SWITCHED);
            mService.mContext.registerReceiverForAllUsers(new BroadcastReceiver() {
            mService.mContext.registerReceiverForAllUsers(new BroadcastReceiver() {
@@ -2621,11 +2612,6 @@ public abstract class OomAdjuster {
        mCachedAppOptimizer.dump(pw);
        mCachedAppOptimizer.dump(pw);
    }
    }


    @GuardedBy("mService")
    void dumpCacheOomRankerSettings(PrintWriter pw) {
        mCacheOomRanker.dump(pw);
    }

    /**
    /**
     * Return whether or not a process should be frozen.
     * Return whether or not a process should be frozen.
     */
     */
+0 −14
Original line number Original line Diff line number Diff line
@@ -4318,20 +4318,6 @@ public final class ProcessList implements ProcessStateController.ProcessLruUpdat
        return mLruProcesses;
        return mLruProcesses;
    }
    }


    /**
     * For test only
     */
    @VisibleForTesting
    @GuardedBy({"mService", "mProcLock"})
    void setLruProcessServiceStartLSP(int pos) {
        mLruProcessServiceStart = pos;
    }

    @GuardedBy(anyOf = {"mService", "mProcLock"})
    int getLruProcessServiceStartLOSP() {
        return mLruProcessServiceStart;
    }

    /**
    /**
     * Iterate the whole LRU list, invoke the given {@code callback} with each of the ProcessRecord
     * Iterate the whole LRU list, invoke the given {@code callback} with each of the ProcessRecord
     * in that list.
     * in that list.
+0 −809

File deleted.

Preview size limit exceeded, changes collapsed.