From adae4870fb862acf83837922362ca1762c19c9aa Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Mon, 3 Jan 2022 16:58:26 +0800 Subject: Fix toucn unresponsive after half fold in split After fold animation finished, it will always set null bounds crop to surface and cause root task surface bounds abnormal. Fix by ignoring root task surface in StageTaskUnfoldController because it would not effect animation. Fix: 211132158 Test: manual Test: pass existing tests Change-Id: Iece8f7e7d437bdff1cf9e738df3acc075729b993 --- .../com/android/wm/shell/splitscreen/StageTaskUnfoldController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskUnfoldController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskUnfoldController.java index e904f6a9e22c..4849163e96fd 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskUnfoldController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskUnfoldController.java @@ -100,6 +100,9 @@ public class StageTaskUnfoldController implements UnfoldListener, OnInsetsChange * @param leash surface leash for the appeared task */ public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) { + // Only handle child task surface here. + if (!taskInfo.hasParentTask()) return; + AnimationContext context = new AnimationContext(leash); mAnimationContextByTaskId.put(taskInfo.taskId, context); } @@ -109,6 +112,8 @@ public class StageTaskUnfoldController implements UnfoldListener, OnInsetsChange * @param taskInfo info for the vanished task */ public void onTaskVanished(ActivityManager.RunningTaskInfo taskInfo) { + if (!taskInfo.hasParentTask()) return; + AnimationContext context = mAnimationContextByTaskId.get(taskInfo.taskId); if (context != null) { final SurfaceControl.Transaction transaction = mTransactionPool.acquire(); -- cgit v1.2.3-59-g8ed1b