diff options
| author | 2024-11-13 23:48:54 +0000 | |
|---|---|---|
| committer | 2024-11-13 23:48:54 +0000 | |
| commit | 8db50898b5c9e25e71ca607660ca12aed546b48c (patch) | |
| tree | 8fd959ca03bca276686cf31490007b3d4794af49 | |
| parent | f13aa1d82636d7fbcd9b490c66add79f9d215bbf (diff) | |
Hide task surface once it goes off-screen in close animation
Once the task has gone out of bounds, it still technically visible in SF
traces unless you explicitly hide it. This was causing flicker test's
"VisibleLayersShownMoreThanOneConsecutiveEntry" assertions to fail
because it expected the layer to still be visible but wasn't because
these assertions use visible region to determine visibility.
Flag: EXEMPT bugfix
Fix: 377651666
Fix: 371985078
Test: atest
com.android.wm.shell.flicker.CloseAllAppWithAppHeaderExitLandscape#closeAllAppsInDesktop
Test: atest
com.android.wm.shell.flicker.CloseAllAppWithAppHeaderExitPortrait#closeAllAppsInDesktop
Change-Id: Ie16ae257a63c18af135e845ce6c73ac56969cd05
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java index e848b889b314..2ae9828ca0db 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java @@ -254,8 +254,13 @@ public class FreeformTaskTransitionHandler finishT.hide(sc); final Rect startBounds = new Rect(change.getStartAbsBounds()); animator.addUpdateListener(animation -> { - t.setPosition(sc, startBounds.left, - startBounds.top + (animation.getAnimatedFraction() * screenHeight)); + final float newTop = startBounds.top + (animation.getAnimatedFraction() * screenHeight); + t.setPosition(sc, startBounds.left, newTop); + if (newTop > screenHeight) { + // At this point the task surface is off-screen, so hide it to prevent flicker + // failures. See b/377651666. + t.hide(sc); + } t.apply(); }); animator.addListener( |