From 9f72c67e657057c1d8b40fbc1073e2c4f8b24d69 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Fri, 25 Feb 2022 13:30:39 +0000 Subject: [PATCH] Fix split screen divider corners flicker Divider bar might be hidden before swipe-up gesture started when users touching task bar region. This makes sure to update visibility of divider bar only after gesture started. Fix: 219995626 Test: long press task bar region to stash/unstash task bar, divider bar won't be hidden as long as it didn't trigger swipe up gesture. Change-Id: Iacf690c84a3ad4b5e4fc9b066e9a1ecb8a8aa7d1 --- .../com/android/quickstep/AbsSwipeUpHandler.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 2cb7100378..9c28bce026 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -833,12 +833,9 @@ public abstract class AbsSwipeUpHandler, // Notify when the animation starts flushOnRecentsAnimationAndLauncherBound(); - // Start hiding the divider - setDividerShown(false /* shown */, false /* immediate */); - // Only add the callback to enable the input consumer after we actually have the controller mStateCallback.runOnceAtState(STATE_APP_CONTROLLER_RECEIVED | STATE_GESTURE_STARTED, - mRecentsAnimationController::enableInputConsumer); + this::startInterceptingTouchesForGesture); mStateCallback.setStateOnUiThread(STATE_APP_CONTROLLER_RECEIVED); mPassedOverviewThreshold = false; @@ -1457,6 +1454,17 @@ public abstract class AbsSwipeUpHandler, return swipePipToHomeAnimator; } + private void startInterceptingTouchesForGesture() { + if (mRecentsAnimationController == null) { + return; + } + + mRecentsAnimationController.enableInputConsumer(); + + // Start hiding the divider + setDividerShown(false /* shown */, true /* immediate */); + } + private void computeRecentsScrollIfInvisible() { if (mRecentsView != null && mRecentsView.getVisibility() != View.VISIBLE) { // Views typically don't compute scroll when invisible as an optimization,