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

Commit 0c1957d3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "psc: Migrate hasActiveInstrumentation to ProcessRecordInternal" into main

parents d97a3d2f 16418fca
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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.
@@ -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;
@@ -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 {
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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;
+2 −1
Original line number Diff line number Diff line
@@ -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;
    }

+3 −0
Original line number Diff line number Diff line
@@ -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;