Loading services/core/java/com/android/server/am/OomAdjuster.java +4 −4 Original line number Diff line number Diff line Loading @@ -1335,7 +1335,7 @@ public abstract class OomAdjuster { app.killLocked("isolated not needed", ApplicationExitInfo.REASON_OTHER, ApplicationExitInfo.SUBREASON_ISOLATED_NOT_NEEDED, true); } else if (app.isSdkSandbox && psr.numberOfRunningServices() <= 0 && app.getActiveInstrumentation() == null) { && !app.hasActiveInstrumentation()) { // If this is an SDK sandbox process and there are no services running it, we // aggressively kill the sandbox as we usually don't want to re-use the same // sandbox again. Loading Loading @@ -2003,7 +2003,7 @@ public abstract class OomAdjuster { public abstract boolean computeProviderHostOomAdjLSP(ContentProviderConnection conn, ProcessRecord app, ProcessRecord client, boolean dryRun); protected int getDefaultCapability(ProcessRecord app, int procState) { protected int getDefaultCapability(ProcessRecordInternal app, int procState) { final int networkCapabilities = NetworkPolicyManager.getDefaultProcessNetworkCapabilities(procState); final int baseCapabilities; Loading @@ -2014,7 +2014,7 @@ public abstract class OomAdjuster { baseCapabilities = PROCESS_CAPABILITY_ALL; // BFSL allowed break; case PROCESS_STATE_BOUND_TOP: if (app.getActiveInstrumentation() != null) { if (app.hasActiveInstrumentation()) { baseCapabilities = PROCESS_CAPABILITY_BFSL | PROCESS_CAPABILITY_ALL_IMPLICIT; } else { Loading @@ -2022,7 +2022,7 @@ public abstract class OomAdjuster { } break; case PROCESS_STATE_FOREGROUND_SERVICE: if (app.getActiveInstrumentation() != null) { if (app.hasActiveInstrumentation()) { baseCapabilities = PROCESS_CAPABILITY_ALL_IMPLICIT; } else { // Capability from foreground service is conditional depending on Loading services/core/java/com/android/server/am/OomAdjusterImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -1302,7 +1302,7 @@ public class OomAdjusterImpl extends OomAdjuster { if (DEBUG_OOM_ADJ_REASON || logUid == appUid) { reportOomAdjMessageLocked(TAG_OOM_ADJ, "Making running remote anim: " + app); } } else if (app.getActiveInstrumentation() != null) { } else if (app.hasActiveInstrumentation()) { // Don't want to kill running instrumentation. adj = FOREGROUND_APP_ADJ; schedGroup = SCHED_GROUP_DEFAULT; Loading services/core/java/com/android/server/am/ProcessRecord.java +2 −1 Original line number Diff line number Diff line Loading @@ -978,8 +978,9 @@ class ProcessRecord extends ProcessRecordInternal implements WindowProcessListen return mInstr; } @Override @GuardedBy(anyOf = {"mService", "mProcLock"}) boolean hasActiveInstrumentation() { public boolean hasActiveInstrumentation() { return mInstr != null; } Loading services/core/java/com/android/server/am/psc/ProcessRecordInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,9 @@ public abstract class ProcessRecordInternal { */ public abstract boolean hasAboveClient(); /** Returns true if there is an active instrumentation running in this process. */ public abstract boolean hasActiveInstrumentation(); // Enable this to trace all OomAdjuster state transitions private static final boolean TRACE_OOM_ADJ = false; Loading Loading
services/core/java/com/android/server/am/OomAdjuster.java +4 −4 Original line number Diff line number Diff line Loading @@ -1335,7 +1335,7 @@ public abstract class OomAdjuster { app.killLocked("isolated not needed", ApplicationExitInfo.REASON_OTHER, ApplicationExitInfo.SUBREASON_ISOLATED_NOT_NEEDED, true); } else if (app.isSdkSandbox && psr.numberOfRunningServices() <= 0 && app.getActiveInstrumentation() == null) { && !app.hasActiveInstrumentation()) { // If this is an SDK sandbox process and there are no services running it, we // aggressively kill the sandbox as we usually don't want to re-use the same // sandbox again. Loading Loading @@ -2003,7 +2003,7 @@ public abstract class OomAdjuster { public abstract boolean computeProviderHostOomAdjLSP(ContentProviderConnection conn, ProcessRecord app, ProcessRecord client, boolean dryRun); protected int getDefaultCapability(ProcessRecord app, int procState) { protected int getDefaultCapability(ProcessRecordInternal app, int procState) { final int networkCapabilities = NetworkPolicyManager.getDefaultProcessNetworkCapabilities(procState); final int baseCapabilities; Loading @@ -2014,7 +2014,7 @@ public abstract class OomAdjuster { baseCapabilities = PROCESS_CAPABILITY_ALL; // BFSL allowed break; case PROCESS_STATE_BOUND_TOP: if (app.getActiveInstrumentation() != null) { if (app.hasActiveInstrumentation()) { baseCapabilities = PROCESS_CAPABILITY_BFSL | PROCESS_CAPABILITY_ALL_IMPLICIT; } else { Loading @@ -2022,7 +2022,7 @@ public abstract class OomAdjuster { } break; case PROCESS_STATE_FOREGROUND_SERVICE: if (app.getActiveInstrumentation() != null) { if (app.hasActiveInstrumentation()) { baseCapabilities = PROCESS_CAPABILITY_ALL_IMPLICIT; } else { // Capability from foreground service is conditional depending on Loading
services/core/java/com/android/server/am/OomAdjusterImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -1302,7 +1302,7 @@ public class OomAdjusterImpl extends OomAdjuster { if (DEBUG_OOM_ADJ_REASON || logUid == appUid) { reportOomAdjMessageLocked(TAG_OOM_ADJ, "Making running remote anim: " + app); } } else if (app.getActiveInstrumentation() != null) { } else if (app.hasActiveInstrumentation()) { // Don't want to kill running instrumentation. adj = FOREGROUND_APP_ADJ; schedGroup = SCHED_GROUP_DEFAULT; Loading
services/core/java/com/android/server/am/ProcessRecord.java +2 −1 Original line number Diff line number Diff line Loading @@ -978,8 +978,9 @@ class ProcessRecord extends ProcessRecordInternal implements WindowProcessListen return mInstr; } @Override @GuardedBy(anyOf = {"mService", "mProcLock"}) boolean hasActiveInstrumentation() { public boolean hasActiveInstrumentation() { return mInstr != null; } Loading
services/core/java/com/android/server/am/psc/ProcessRecordInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,9 @@ public abstract class ProcessRecordInternal { */ public abstract boolean hasAboveClient(); /** Returns true if there is an active instrumentation running in this process. */ public abstract boolean hasActiveInstrumentation(); // Enable this to trace all OomAdjuster state transitions private static final boolean TRACE_OOM_ADJ = false; Loading