From e40082ea4c4277bc9b811a91599a07e1eb8f9d2e Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 5 Jun 2018 16:03:12 -0700 Subject: [PATCH] Fix PiP regression when the stack animation is canceled - We should immediately run the animation-end logic when the PiP animation is canceled and the final resize does not happen. Also ensure we call this animation end logic when not running a PiP animation (though nothing currently does this). Bug: 109712078 Test: Enter PiP from a landscape app, ensure that the animation state is cleared Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerPinnedStackTests Change-Id: Icd559a5377215eddc5fa4b1d3629d914396d9a3d --- services/core/java/com/android/server/wm/TaskStack.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index c59540b3d0886..76c9c262cd762 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -1682,6 +1682,10 @@ public class TaskStack extends WindowContainer implements if (finalStackSize != null) { setPinnedStackSize(finalStackSize, null); + } else { + // We have been canceled, so the final stack size is null, still run the + // animation-end logic + onPipAnimationEndResize(); } try { @@ -1693,6 +1697,9 @@ public class TaskStack extends WindowContainer implements } catch (RemoteException e) { // I don't believe you... } + } else { + // No PiP animation, just run the normal animation-end logic + onPipAnimationEndResize(); } }