Merge "Pre-emptively take a snapshot when finishing an activity before changing visibility" into qt-r1-dev

This commit is contained in:
TreeHugger Robot
2019-07-02 19:52:51 +00:00
committed by Android (Google) Code Review

View File

@@ -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;
@@ -4024,6 +4026,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);