From 86d8cb8b05a3c29fa635506a5d7d271520dea3d7 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Wed, 10 May 2023 15:17:28 +0800 Subject: [PATCH] Temporarily disable consecutive visibility assertion of close pip There is no visual problem. Maybe the test should exclude the condition if the invisible reason is because the requested position is outside screen. This fixes missing shadow of PiP task because the default finish transaction resets most surface attributes according to Transition#buildFinishTransaction. Bug: 270678766 Test: ClosePipBySwipingDownTest Change-Id: I76ddbf094d77a5e88a9203b9a54a16bc6a9b3fc6 --- .../src/com/android/wm/shell/pip/PipTransition.java | 3 --- .../wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java index db516c0e74f93..9677728d1d18d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java @@ -888,9 +888,6 @@ public class PipTransition extends PipTransitionController { // setting bounds. animator.setPipTransactionHandler(mTransactionConsumer).applySurfaceControlTransaction( leash, finishTransaction, PipAnimationController.FRACTION_END); - // Remove the workaround after fixing ClosePipBySwipingDownTest that detects the shadow - // as unexpected visible. - finishTransaction.setShadowRadius(leash, 0); // Start to animate enter PiP. animator.setPipTransactionHandler(mPipOrganizer.getPipTransactionHandler()).start(); } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt index e6544c9f39bc7..98fc91b334cf8 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt @@ -95,4 +95,14 @@ open class ClosePipBySwipingDownTest(flicker: FlickerTest) : ClosePipTransition( fun focusDoesNotChange() { flicker.assertEventLog { this.focusDoesNotChange() } } + + @Test + override fun visibleLayersShownMoreThanOneConsecutiveEntry() { + // TODO(b/270678766): Enable the assertion after fixing the case: + // Assume the PiP task has shadow. + // 1. The PiP activity is visible -> Task is invisible because it is occluded by activity. + // 2. Activity becomes invisible -> Task is visible because it has shadow. + // 3. Task is moved outside screen -> Task becomes invisible. + // The assertion is triggered for 2 that the Task is only visible in one frame. + } }