Update process info while making activity visible

The top fullscreen activity converted to translucent while running
exit transition, which resulted in the activity below being visible.
Since the the process state of the activity below remained as
background, some operations required to be done as a foreground
(opening camera) was being rejected.

Bug: 162216572
Test: back to camera from filmstrip
Change-Id: Ib746f5a2c5409f142819f7eba89c7948c756c23e
This commit is contained in:
Louis Chang
2020-08-17 10:48:53 +08:00
parent f237648d35
commit 6839126036

View File

@@ -4735,6 +4735,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());