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

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

Merge "psc: Move hasAboveClient to ProcessRecordInternal" into main

parents 4e37fc9a 4b35b7bb
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -1927,20 +1927,18 @@ public abstract class OomAdjuster {
     * @return The proposed change to the schedGroup.
     */
    @GuardedBy({"mService", "mProcLock"})
    protected int setIntermediateAdjLSP(ProcessRecord app, int adj, int schedGroup) {
        final ProcessRecordInternal state = app;
        state.setCurRawAdj(adj);
    protected int setIntermediateAdjLSP(ProcessRecordInternal app, int adj, int schedGroup) {
        app.setCurRawAdj(adj);

        adj = applyBindAboveClientToAdj(app.mServices.hasAboveClient(), adj);
        if (adj > state.getMaxAdj()) {
            adj = state.getMaxAdj();
        adj = applyBindAboveClientToAdj(app.hasAboveClient(), adj);
        if (adj > app.getMaxAdj()) {
            adj = app.getMaxAdj();
            if (adj <= PERCEPTIBLE_LOW_APP_ADJ) {
                schedGroup = SCHED_GROUP_DEFAULT;
            }
        }

        state.setCurAdj(adj);

        app.setCurAdj(adj);
        return schedGroup;
    }

+5 −0
Original line number Diff line number Diff line
@@ -1168,6 +1168,11 @@ class ProcessRecord extends ProcessRecordInternal implements WindowProcessListen
                false/* default */);
    }

    @Override
    public boolean hasAboveClient() {
        return mServices.hasAboveClient();
    }

    boolean hasActivitiesOrRecentTasks() {
        return mWindowProcessController.hasActivitiesOrRecentTasks();
    }
+7 −0
Original line number Diff line number Diff line
@@ -187,6 +187,13 @@ public abstract class ProcessRecordInternal {
     */
    public abstract boolean hasCompatChange(@CachedCompatChangeId int cachedCompatChangeId);

    /**
     * Returns whether this process has bound to a service with
     * {@link android.content.Context#BIND_ABOVE_CLIENT}.
     * TODO(b/425766486): Remove it once ProcessRecordInternal could access ProcessServiceRecord.
     */
    public abstract boolean hasAboveClient();

    // Enable this to trace all OomAdjuster state transitions
    private static final boolean TRACE_OOM_ADJ = false;