From 30233c6fbd71df0bf4ad48d588450d089de7af97 Mon Sep 17 00:00:00 2001 From: "[1;3C" Date: Fri, 11 Sep 2020 14:26:24 -0700 Subject: [PATCH] Reset Task surface to fullscreen when appeared Some other modes leave the task surface in a bad state, so if fullscreen gets onTaskAppeared, reset everything to fullscreen Bug: 168278812 Test: Open an app, put it into pip, close pip by dragging to X, open the app from recents. Change-Id: Icf4df30eb44fa0a589e7d0bd9be1eb2e72fc492a --- .../src/com/android/wm/shell/FullscreenTaskListener.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java index d0051db9e9fcf..9047b71253dad 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java @@ -46,6 +46,12 @@ class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener { final SurfaceControl.Transaction t = mTransactionPool.acquire(); ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Fullscreen Task Appeared: #%d", taskInfo.taskId); + // Reset several properties back to fullscreen (PiP, for example, leaves all these + // properties in a bad state). + t.setPosition(leash, 0, 0); + t.setWindowCrop(leash, null); + t.setAlpha(leash, 1f); + t.setMatrix(leash, 1, 0, 0, 1); t.show(leash); t.apply(); }