From 49ba723e7e3472d7f10ce51845bceab259018bf0 Mon Sep 17 00:00:00 2001 From: "jorgegil@google.com" Date: Mon, 29 Mar 2021 17:52:26 -0700 Subject: [PATCH] Don't skip cleaning up PIP state in onTaskVanished even if EXITING_PIP onTaskVanished's clean up work is sometimes skipped when the current state of PIP is EXITING_PIP because that is considered to be a "not in pip state". Instead, make sure clean up does happen and only skip it if the state is already UNDEFINED (i.e. if onTaskVanished is called twice or before onTaskAppeared). Bug: 176302696 Test: Enter PIP with maps, go back to fullscreen, make sure back gesture works Change-Id: I81e862f1d24892e565d1f8fcf2af0976caba7474 --- .../Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java index fa31a0a4e5162..f663d553cf5ed 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java @@ -553,7 +553,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, */ @Override public void onTaskVanished(ActivityManager.RunningTaskInfo info) { - if (!mState.isInPip()) { + if (mState == State.UNDEFINED) { return; } final WindowContainerToken token = info.token;