From 7a9b53cd31356fc0b3d1d65ad136c891d11e7be3 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Thu, 8 Jun 2023 16:28:03 +0800 Subject: [PATCH] Fix surface didn't fade out when dismiss We did fade-out on snapshot if exist rather than surface itself before due to the surface didn't have content. But this issue seems had been fixed so it cause we cannot see the animation due to the surface layer is higher than snapshot. Now we can fade out the surface directly so just remove using snapshot in this case. Fix: 286353033 Test: manual Test: pass existing tests Change-Id: Icd04940f69b4a4102068be14785718ea8ae77a3a --- .../shell/splitscreen/SplitScreenTransitions.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java index 986309948adab..d21f8a48e62a0 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java @@ -199,19 +199,7 @@ class SplitScreenTransitions { boolean isOpening = TransitionUtil.isOpeningType(info.getType()); if (!isOpening && (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK)) { // fade out - if (change.getSnapshot() != null) { - // This case is happened if task is going to reparent to TDA, the origin leash - // doesn't rendor so we use snapshot to replace it animating. - t.reparent(change.getSnapshot(), info.getRoot(rootIdx).getLeash()); - // Use origin leash layer. - t.setLayer(change.getSnapshot(), info.getChanges().size() - i); - t.setPosition(change.getSnapshot(), change.getStartAbsBounds().left, - change.getStartAbsBounds().top); - t.show(change.getSnapshot()); - startFadeAnimation(change.getSnapshot(), false /* show */); - } else { - startFadeAnimation(leash, false /* show */); - } + startFadeAnimation(leash, false /* show */); } else if (mode == TRANSIT_CHANGE && change.getSnapshot() != null) { t.reparent(change.getSnapshot(), info.getRoot(rootIdx).getLeash()); // Ensure snapshot it on the top of all transition surfaces