Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25687797 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Capture real snapshot of task for non cache case" into main

parents 8cd9a246 0760a96c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -269,7 +269,10 @@ interface IActivityTaskManager {
     * task snapshot cache only if requested.
     *
     * @param taskId the id of the task to take a snapshot of
     * @param updateCache whether to store the new snapshot in the system's task snapshot cache
     * @param updateCache Whether to store the new snapshot in the system's task snapshot cache.
     *                    If it is true, the snapshot can be either real content or app-theme mode
     *                    depending on the attributes of app. Otherwise, the snapshot will be taken
     *                    with real content.
     * @return a graphic buffer representing a screenshot of a task
     */
    android.window.TaskSnapshot takeTaskSnapshot(int taskId, boolean updateCache);
+5 −1
Original line number Diff line number Diff line
@@ -3859,10 +3859,14 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                    Slog.w(TAG, "takeTaskSnapshot: taskId=" + taskId + " not found or not visible");
                    return null;
                }
                // Note that if updateCache is true, ActivityRecord#shouldUseAppThemeSnapshot will
                // be used to decide whether the task is allowed to be captured because that may
                // be retrieved by recents. While if updateCache is false, the real snapshot will
                // always be taken and the snapshot won't be put into SnapshotPersister.
                if (updateCache) {
                    return mWindowManager.mTaskSnapshotController.recordSnapshot(task);
                } else {
                    return mWindowManager.mTaskSnapshotController.captureSnapshot(task);
                    return mWindowManager.mTaskSnapshotController.snapshot(task);
                }
            }
        } finally {