summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2019-06-28 14:43:10 -0700
committer Winson Chung <winsonc@google.com> 2019-06-29 06:01:19 +0000
commit6dad90e5883db82c345a3ab592b26f0fd69fe28d (patch)
treea9571053922b1a307de730468047e5e8e6727264
parent8fa9dd817300b3df6ee8de5f0a9ad13216e0b08c (diff)
Pre-emptively take a snapshot when finishing an activity before changing visibility
- Finishing an activity in force landscape will normally trigger a visibility change and configuration change before the closing apps are handled (when snapshots are normally taken) resulting in snapshots showing for the wrong orientation. Preemptively take the screenshot if we know that we are finishing the activity and ignore the subsequent closing app snapshot. Bug: 132687470 Test: Go into forced landscape app, back out of the app, then go to Overview and ensure that the full snapshot is shown in the right orientation Change-Id: I8f9283188da00a09e499c3c16eff5b45fcaa73d1
-rw-r--r--services/core/java/com/android/server/wm/ActivityStack.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStack.java b/services/core/java/com/android/server/wm/ActivityStack.java
index 74c3069462ea..5591cb30c6ad 100644
--- a/services/core/java/com/android/server/wm/ActivityStack.java
+++ b/services/core/java/com/android/server/wm/ActivityStack.java
@@ -164,6 +164,8 @@ import com.android.server.am.AppTimeTracker;
import com.android.server.am.EventLogTags;
import com.android.server.am.PendingIntentRecord;
+import com.google.android.collect.Sets;
+
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
@@ -4022,6 +4024,14 @@ class ActivityStack extends ConfigurationContainer {
}
getDisplay().mDisplayContent.prepareAppTransition(transit, false);
+ // When finishing the activity pre-emptively take the snapshot before the app window
+ // is marked as hidden and any configuration changes take place
+ if (mWindowManager.mTaskSnapshotController != null) {
+ final ArraySet<Task> tasks = Sets.newArraySet(task.mTask);
+ mWindowManager.mTaskSnapshotController.snapshotTasks(tasks);
+ mWindowManager.mTaskSnapshotController.addSkipClosingAppSnapshotTasks(tasks);
+ }
+
// Tell window manager to prepare for this one to be removed.
r.setVisibility(false);