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
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 3e9377e..7daea69 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -4735,6 +4735,15 @@
                 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());