diff options
| author | 2024-08-13 16:37:32 -0700 | |
|---|---|---|
| committer | 2024-08-13 16:41:28 -0700 | |
| commit | 609ae17fc7f6a9e42c34cc2d8c90b6189505ccb6 (patch) | |
| tree | a68bda954c598efdfb02c190fb0bbce1df215911 | |
| parent | 68be647c541d172ec998486873a7c9c3095fde69 (diff) | |
Take task snapshot on exiting PiP
When expanding PiP to full-screen, we first keep Task windowing mode to
be pinned and therefore, the behind Task is going to be invisible and
misses the chance to take the task snapshot.
Fix the issue by forcefully take task snapshot when the Task windowing
mode is toggled.
Flag: EXEMPT bugfix
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/gvNLaUdJmwBpmtJ4VTxqCt
Bug: 342310361
Test: Expand PiP to full-screen with other app in foreground
Change-Id: I8ed6d1b41860c702d71e73d0702e835fcddea6a2
| -rw-r--r-- | services/core/java/com/android/server/wm/Task.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 12e91adef9c5..7c4e19345029 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -4689,6 +4689,15 @@ class Task extends TaskFragment { // it does not follow the ActivityStarter path. if (topActivity.shouldBeVisible()) { mAtmService.resumeAppSwitches(); + // In pip1, when expanding pip to full-screen, the "behind" task is not + // actually becoming invisible since task windowing mode is pinned. + if (!isPip2ExperimentEnabled) { + final ActivityRecord ar = mAtmService.mLastResumedActivity; + if (ar != null && ar.getTask() != null) { + mAtmService.takeTaskSnapshot(ar.getTask().mTaskId, + true /* updateCache */); + } + } } } else if (isPip2ExperimentEnabled) { super.setWindowingMode(windowingMode); |