Merge "Fix start application proc state when screen off" into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
bbb61252cb
@@ -1713,6 +1713,11 @@ public class OomAdjuster {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isScreenOnOrAnimatingLocked(ProcessStateRecord state) {
|
||||||
|
return mService.mWakefulness.get() == PowerManagerInternal.WAKEFULNESS_AWAKE
|
||||||
|
|| state.isRunningRemoteAnimation();
|
||||||
|
}
|
||||||
|
|
||||||
@GuardedBy({"mService", "mProcLock"})
|
@GuardedBy({"mService", "mProcLock"})
|
||||||
private boolean computeOomAdjLSP(ProcessRecord app, int cachedAdj,
|
private boolean computeOomAdjLSP(ProcessRecord app, int cachedAdj,
|
||||||
ProcessRecord topApp, boolean doingAll, long now, boolean cycleReEval,
|
ProcessRecord topApp, boolean doingAll, long now, boolean cycleReEval,
|
||||||
@@ -1794,8 +1799,7 @@ public class OomAdjuster {
|
|||||||
state.setSystemNoUi(false);
|
state.setSystemNoUi(false);
|
||||||
}
|
}
|
||||||
if (!state.isSystemNoUi()) {
|
if (!state.isSystemNoUi()) {
|
||||||
if (mService.mWakefulness.get() == PowerManagerInternal.WAKEFULNESS_AWAKE
|
if (isScreenOnOrAnimatingLocked(state)) {
|
||||||
|| state.isRunningRemoteAnimation()) {
|
|
||||||
// screen on or animating, promote UI
|
// screen on or animating, promote UI
|
||||||
state.setCurProcState(ActivityManager.PROCESS_STATE_PERSISTENT_UI);
|
state.setCurProcState(ActivityManager.PROCESS_STATE_PERSISTENT_UI);
|
||||||
state.setCurrentSchedulingGroup(SCHED_GROUP_TOP_APP);
|
state.setCurrentSchedulingGroup(SCHED_GROUP_TOP_APP);
|
||||||
@@ -3281,8 +3285,10 @@ public class OomAdjuster {
|
|||||||
} else {
|
} else {
|
||||||
setThreadPriority(app.getPid(), THREAD_PRIORITY_TOP_APP_BOOST);
|
setThreadPriority(app.getPid(), THREAD_PRIORITY_TOP_APP_BOOST);
|
||||||
}
|
}
|
||||||
|
if (isScreenOnOrAnimatingLocked(state)) {
|
||||||
initialSchedGroup = SCHED_GROUP_TOP_APP;
|
initialSchedGroup = SCHED_GROUP_TOP_APP;
|
||||||
initialProcState = PROCESS_STATE_TOP;
|
initialProcState = PROCESS_STATE_TOP;
|
||||||
|
}
|
||||||
initialCapability = PROCESS_CAPABILITY_ALL;
|
initialCapability = PROCESS_CAPABILITY_ALL;
|
||||||
initialCached = false;
|
initialCached = false;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user