Merge "Update process info while making activity visible" into rvc-qpr-dev am: 5c344f7431

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12383609

Change-Id: I9ace4b45b9a9a369fc7bd6e6925685b7efa00195
This commit is contained in:
Louis Chang
2020-08-19 01:31:13 +00:00
committed by Automerger Merge Worker

View File

@@ -4732,6 +4732,15 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
Slog.v(TAG_VISIBILITY, "Start visible activity, " + this);
}
setState(STARTED, "makeActiveIfNeeded");
// Update process info while making an activity from invisible to visible, to make
// sure the process state is updated to foreground.
if (app != null) {
app.updateProcessInfo(false /* updateServiceConnectionActivities */,
true /* activityChange */, true /* updateOomAdj */,
true /* addPendingTopUid */);
}
try {
mAtmService.getLifecycleManager().scheduleTransaction(app.getThread(), appToken,
StartActivityItem.obtain());