diff options
| -rw-r--r-- | core/java/android/app/IActivityTaskManager.aidl | 5 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityTaskManagerService.java | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/core/java/android/app/IActivityTaskManager.aidl b/core/java/android/app/IActivityTaskManager.aidl index 1f8784bf72dd..df6badcffe8e 100644 --- a/core/java/android/app/IActivityTaskManager.aidl +++ b/core/java/android/app/IActivityTaskManager.aidl @@ -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); diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java index f462efc00ce6..7a100fceb901 100644 --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java @@ -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 { |