Loading services/core/java/com/android/server/am/OomAdjuster.java +6 −8 Original line number Diff line number Diff line Loading @@ -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; } Loading services/core/java/com/android/server/am/ProcessRecord.java +5 −0 Original line number Diff line number Diff line Loading @@ -1168,6 +1168,11 @@ class ProcessRecord extends ProcessRecordInternal implements WindowProcessListen false/* default */); } @Override public boolean hasAboveClient() { return mServices.hasAboveClient(); } boolean hasActivitiesOrRecentTasks() { return mWindowProcessController.hasActivitiesOrRecentTasks(); } Loading services/core/java/com/android/server/am/psc/ProcessRecordInternal.java +7 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading
services/core/java/com/android/server/am/OomAdjuster.java +6 −8 Original line number Diff line number Diff line Loading @@ -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; } Loading
services/core/java/com/android/server/am/ProcessRecord.java +5 −0 Original line number Diff line number Diff line Loading @@ -1168,6 +1168,11 @@ class ProcessRecord extends ProcessRecordInternal implements WindowProcessListen false/* default */); } @Override public boolean hasAboveClient() { return mServices.hasAboveClient(); } boolean hasActivitiesOrRecentTasks() { return mWindowProcessController.hasActivitiesOrRecentTasks(); } Loading
services/core/java/com/android/server/am/psc/ProcessRecordInternal.java +7 −0 Original line number Diff line number Diff line Loading @@ -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; Loading