Loading services/core/java/com/android/server/am/ActivityManagerConstants.java +0 −17 Original line number Diff line number Diff line Loading @@ -129,7 +129,6 @@ final class ActivityManagerConstants extends ContentObserver { static final String KEY_KILL_BG_RESTRICTED_CACHED_IDLE = "kill_bg_restricted_cached_idle"; static final String KEY_KILL_BG_RESTRICTED_CACHED_IDLE_SETTLE_TIME = "kill_bg_restricted_cached_idle_settle_time"; static final String KEY_MAX_PREVIOUS_TIME = "max_previous_time"; /** * Note this key is on {@link DeviceConfig#NAMESPACE_ACTIVITY_MANAGER_COMPONENT_ALIAS}. * @see #mEnableComponentAlias Loading Loading @@ -193,7 +192,6 @@ final class ActivityManagerConstants extends ContentObserver { private static final float DEFAULT_FGS_START_DENIED_LOG_SAMPLE_RATE = 1; // 100% private static final long DEFAULT_PROCESS_KILL_TIMEOUT_MS = 10 * 1000; private static final long DEFAULT_NETWORK_ACCESS_TIMEOUT_MS = 200; // 0.2 sec private static final long DEFAULT_MAX_PREVIOUS_TIME = 60 * 1000; // 60s static final long DEFAULT_BACKGROUND_SETTLE_TIME = 60 * 1000; static final long DEFAULT_KILL_BG_RESTRICTED_CACHED_IDLE_SETTLE_TIME_MS = 60 * 1000; Loading Loading @@ -524,9 +522,6 @@ final class ActivityManagerConstants extends ContentObserver { public long TOP_TO_ALMOST_PERCEPTIBLE_GRACE_DURATION = DEFAULT_TOP_TO_ALMOST_PERCEPTIBLE_GRACE_DURATION; // How long a process can remain at previous oom_adj before dropping to cached public static long MAX_PREVIOUS_TIME = DEFAULT_MAX_PREVIOUS_TIME; /** * The minimum time we allow between crashes, for us to consider this * application to be bad and stop its services and reject broadcasts. Loading Loading @@ -1149,10 +1144,6 @@ final class ActivityManagerConstants extends ContentObserver { break; case KEY_TOP_TO_FGS_GRACE_DURATION: updateTopToFgsGraceDuration(); break; case KEY_MAX_PREVIOUS_TIME: updateMaxPreviousTime(); break; default: break; } Loading Loading @@ -1799,7 +1790,6 @@ final class ActivityManagerConstants extends ContentObserver { DEFAULT_LOW_SWAP_THRESHOLD_PERCENT); } private void updateTopToFgsGraceDuration() { TOP_TO_FGS_GRACE_DURATION = DeviceConfig.getLong( DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, Loading @@ -1807,13 +1797,6 @@ final class ActivityManagerConstants extends ContentObserver { DEFAULT_TOP_TO_FGS_GRACE_DURATION); } private void updateMaxPreviousTime() { MAX_PREVIOUS_TIME = DeviceConfig.getLong( DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_MAX_PREVIOUS_TIME, DEFAULT_MAX_PREVIOUS_TIME); } private void updateMinAssocLogDuration() { MIN_ASSOC_LOG_DURATION = DeviceConfig.getLong( DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_MIN_ASSOC_LOG_DURATION, Loading services/core/java/com/android/server/am/OomAdjuster.java +15 −27 Original line number Diff line number Diff line Loading @@ -1966,23 +1966,12 @@ public class OomAdjuster { } } } if (state.getCachedIsPreviousProcess() && state.getCachedHasActivities()) { // This was the previous process that showed UI to the user. We want to // try to keep it around more aggressively, to give a good experience // around switching between two apps. However, we don't want to keep the // process in this privileged state indefinitely. Eventually, allow the // app to be demoted to cached. if ((state.getSetProcState() == PROCESS_STATE_LAST_ACTIVITY && (state.getLastStateTime() + mConstants.MAX_PREVIOUS_TIME) < now)) { procState = PROCESS_STATE_LAST_ACTIVITY; schedGroup = SCHED_GROUP_BACKGROUND; state.setAdjType("previous-expired"); adj = CACHED_APP_MIN_ADJ; if (DEBUG_OOM_ADJ_REASON || logUid == appUid) { reportOomAdjMessageLocked(TAG_OOM_ADJ, "Expire prev adj: " + app); } } else { if (adj > PREVIOUS_APP_ADJ) { // This was the previous process that showed UI to the user. // We want to try to keep it around more aggressively, to give // a good experience around switching between two apps. adj = PREVIOUS_APP_ADJ; schedGroup = SCHED_GROUP_BACKGROUND; state.setCached(false); Loading @@ -1999,7 +1988,6 @@ public class OomAdjuster { } } } } if (false) Slog.i(TAG, "OOM " + app + ": initial adj=" + adj + " reason=" + state.getAdjType()); Loading Loading
services/core/java/com/android/server/am/ActivityManagerConstants.java +0 −17 Original line number Diff line number Diff line Loading @@ -129,7 +129,6 @@ final class ActivityManagerConstants extends ContentObserver { static final String KEY_KILL_BG_RESTRICTED_CACHED_IDLE = "kill_bg_restricted_cached_idle"; static final String KEY_KILL_BG_RESTRICTED_CACHED_IDLE_SETTLE_TIME = "kill_bg_restricted_cached_idle_settle_time"; static final String KEY_MAX_PREVIOUS_TIME = "max_previous_time"; /** * Note this key is on {@link DeviceConfig#NAMESPACE_ACTIVITY_MANAGER_COMPONENT_ALIAS}. * @see #mEnableComponentAlias Loading Loading @@ -193,7 +192,6 @@ final class ActivityManagerConstants extends ContentObserver { private static final float DEFAULT_FGS_START_DENIED_LOG_SAMPLE_RATE = 1; // 100% private static final long DEFAULT_PROCESS_KILL_TIMEOUT_MS = 10 * 1000; private static final long DEFAULT_NETWORK_ACCESS_TIMEOUT_MS = 200; // 0.2 sec private static final long DEFAULT_MAX_PREVIOUS_TIME = 60 * 1000; // 60s static final long DEFAULT_BACKGROUND_SETTLE_TIME = 60 * 1000; static final long DEFAULT_KILL_BG_RESTRICTED_CACHED_IDLE_SETTLE_TIME_MS = 60 * 1000; Loading Loading @@ -524,9 +522,6 @@ final class ActivityManagerConstants extends ContentObserver { public long TOP_TO_ALMOST_PERCEPTIBLE_GRACE_DURATION = DEFAULT_TOP_TO_ALMOST_PERCEPTIBLE_GRACE_DURATION; // How long a process can remain at previous oom_adj before dropping to cached public static long MAX_PREVIOUS_TIME = DEFAULT_MAX_PREVIOUS_TIME; /** * The minimum time we allow between crashes, for us to consider this * application to be bad and stop its services and reject broadcasts. Loading Loading @@ -1149,10 +1144,6 @@ final class ActivityManagerConstants extends ContentObserver { break; case KEY_TOP_TO_FGS_GRACE_DURATION: updateTopToFgsGraceDuration(); break; case KEY_MAX_PREVIOUS_TIME: updateMaxPreviousTime(); break; default: break; } Loading Loading @@ -1799,7 +1790,6 @@ final class ActivityManagerConstants extends ContentObserver { DEFAULT_LOW_SWAP_THRESHOLD_PERCENT); } private void updateTopToFgsGraceDuration() { TOP_TO_FGS_GRACE_DURATION = DeviceConfig.getLong( DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, Loading @@ -1807,13 +1797,6 @@ final class ActivityManagerConstants extends ContentObserver { DEFAULT_TOP_TO_FGS_GRACE_DURATION); } private void updateMaxPreviousTime() { MAX_PREVIOUS_TIME = DeviceConfig.getLong( DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_MAX_PREVIOUS_TIME, DEFAULT_MAX_PREVIOUS_TIME); } private void updateMinAssocLogDuration() { MIN_ASSOC_LOG_DURATION = DeviceConfig.getLong( DeviceConfig.NAMESPACE_ACTIVITY_MANAGER, KEY_MIN_ASSOC_LOG_DURATION, Loading
services/core/java/com/android/server/am/OomAdjuster.java +15 −27 Original line number Diff line number Diff line Loading @@ -1966,23 +1966,12 @@ public class OomAdjuster { } } } if (state.getCachedIsPreviousProcess() && state.getCachedHasActivities()) { // This was the previous process that showed UI to the user. We want to // try to keep it around more aggressively, to give a good experience // around switching between two apps. However, we don't want to keep the // process in this privileged state indefinitely. Eventually, allow the // app to be demoted to cached. if ((state.getSetProcState() == PROCESS_STATE_LAST_ACTIVITY && (state.getLastStateTime() + mConstants.MAX_PREVIOUS_TIME) < now)) { procState = PROCESS_STATE_LAST_ACTIVITY; schedGroup = SCHED_GROUP_BACKGROUND; state.setAdjType("previous-expired"); adj = CACHED_APP_MIN_ADJ; if (DEBUG_OOM_ADJ_REASON || logUid == appUid) { reportOomAdjMessageLocked(TAG_OOM_ADJ, "Expire prev adj: " + app); } } else { if (adj > PREVIOUS_APP_ADJ) { // This was the previous process that showed UI to the user. // We want to try to keep it around more aggressively, to give // a good experience around switching between two apps. adj = PREVIOUS_APP_ADJ; schedGroup = SCHED_GROUP_BACKGROUND; state.setCached(false); Loading @@ -1999,7 +1988,6 @@ public class OomAdjuster { } } } } if (false) Slog.i(TAG, "OOM " + app + ": initial adj=" + adj + " reason=" + state.getAdjType()); Loading