From 49084b0b5381fcfa6fcb65e2ffd63e229bc46d3d Mon Sep 17 00:00:00 2001 From: Evan Rosky Date: Thu, 14 Apr 2022 14:38:34 -0700 Subject: [PATCH] Hide leaf-tasks at end of swipe-to-home animation This is needed for split-screen. Since their leaf tasks are not "independent", Transitions.java will not hide them in the finish-transaction (it shouldn't because it doesn't know if the parent is doing the hiding). In recents' case, though, we know that the tasks will be hidden at leaf-level (due to being reparented out of split). Without hiding here, there will be a flicker after it gets reparented out of the animation leash, but before the app visibility is committed in WMCore. Bug: 228883780 Test: Enter split, swipe-to-home. Change-Id: I9d0fa1542cb82aabbc89998368864107cee56c72 --- .../systemui/shared/system/RemoteTransitionCompat.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java index d7f8235d76a93..ef93bc3110721 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java @@ -388,12 +388,17 @@ public class RemoteTransitionCompat implements Parcelable { wct.restoreTransientOrder(mRecentsTask); } } else { - if (!sendUserLeaveHint) { - for (int i = 0; i < mPausingTasks.size(); ++i) { + for (int i = 0; i < mPausingTasks.size(); ++i) { + if (!sendUserLeaveHint) { // This means recents is not *actually* finishing, so of course we gotta // do special stuff in WMCore to accommodate. wct.setDoNotPip(mPausingTasks.get(i)); } + // Since we will reparent out of the leashes, pre-emptively hide the child + // surface to match the leash. Otherwise, there will be a flicker before the + // visibility gets committed in Core when using split-screen (in splitscreen, + // the leaf-tasks are not "independent" so aren't hidden by normal setup). + t.hide(mInfo.getChange(mPausingTasks.get(i)).getLeash()); } if (mPipTask != null && mPipTransaction != null && sendUserLeaveHint) { t.show(mInfo.getChange(mPipTask).getLeash());