From 180162e1e12a31abf6c212a88d04585c8533572c Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Wed, 22 Apr 2020 14:40:32 -0700 Subject: [PATCH] Do not schedule transition in onTaskVanished With the latest change, dismiss a PiP should now be originated from SysUI itself. When the onTaskVanished callback happens as a result of removeStacksInWindowingMode, there's no necessity for SysUI to start transition again. Plus, the SurfaceControl would be revoked when onTaskVanished happens and it would be a fatal error if SysUI does so. Bug: 153280613 Bug: 152214447 Test: manually enter/exit/close PiP Change-Id: I785eaac52fa1410ef2a22c41035cf952410a7335 --- .../src/com/android/systemui/pip/PipTaskOrganizer.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java b/packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java index 9eae3ca232ff0..9c8fb7c52eecd 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java +++ b/packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java @@ -285,6 +285,8 @@ public class PipTaskOrganizer extends TaskOrganizer { * Meanwhile this callback is invoked whenever the task is removed. For instance: * - as a result of removeStacksInWindowingModes from WM * - activity itself is died + * Nevertheless, we simply update the internal state here as all the heavy lifting should + * have been done in WM. */ @Override public void onTaskVanished(ActivityManager.RunningTaskInfo info) { @@ -297,10 +299,6 @@ public class PipTaskOrganizer extends TaskOrganizer { Log.wtf(TAG, "Unrecognized token: " + token); return; } - final Rect boundsToRestore = mBoundsToRestore.remove(token.asBinder()); - scheduleAnimateResizePip(mLastReportedBounds, boundsToRestore, - TRANSITION_DIRECTION_TO_FULLSCREEN, mEnterExitAnimationDuration, - null /* updateBoundsCallback */); mInPip = false; }