Merge "Check the process state for the killProcessesForRemovedTask"

This commit is contained in:
Jing Ji
2022-05-04 17:57:18 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 2 deletions

View File

@@ -16651,7 +16651,7 @@ public class ActivityManagerService extends IActivityManager.Stub
final WindowProcessController wpc =
(WindowProcessController) procsToKill.get(i);
final ProcessRecord pr = (ProcessRecord) wpc.mOwner;
if (pr.mState.getSetSchedGroup() == ProcessList.SCHED_GROUP_BACKGROUND
if (ActivityManager.isProcStateBackground(pr.mState.getSetProcState())
&& pr.mReceivers.numberOfCurReceivers() == 0) {
pr.killLocked("remove task", ApplicationExitInfo.REASON_USER_REQUESTED,
ApplicationExitInfo.SUBREASON_REMOVE_TASK, true);

View File

@@ -2597,7 +2597,7 @@ public class OomAdjuster {
reportOomAdjMessageLocked(TAG_OOM_ADJ, msg);
}
if (app.getWaitingToKill() != null && app.mReceivers.numberOfCurReceivers() == 0
&& state.getSetSchedGroup() == ProcessList.SCHED_GROUP_BACKGROUND) {
&& ActivityManager.isProcStateBackground(state.getSetProcState())) {
app.killLocked(app.getWaitingToKill(), ApplicationExitInfo.REASON_USER_REQUESTED,
ApplicationExitInfo.SUBREASON_REMOVE_TASK, true);
success = false;