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
This commit is contained in:
jorgegil@google.com
2021-03-29 17:52:26 -07:00
parent 4acab1d9ae
commit 49ba723e7e

View File

@@ -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;