From 15ebdf1e7c9722cac448e500d180f11d7d6b069b Mon Sep 17 00:00:00 2001 From: Rahul Banerjee Date: Mon, 1 Aug 2022 11:07:36 -0700 Subject: [PATCH] Actually trigger back action on Back Arrow fling Currently, when the New Back Arrow is flung and the finger lifted, we do not actually send the trigger event -- but we do if the finger is lifted after coming to a "stop", i.e., a commit without a "fling". To test, swipe from the right edge inwards, and release while your finger is in motion (as opposed to "stop moving, and then lift"). Bug: 240272871 Test: Manual Change-Id: I81d6e6b1bb42c2cd12d14ae861ba8eb9f3081d11 --- .../systemui/navigationbar/gestural/BackPanelController.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/BackPanelController.kt b/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/BackPanelController.kt index b05e75ea1c974..b44b4def33f45 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/BackPanelController.kt +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/BackPanelController.kt @@ -510,7 +510,6 @@ class BackPanelController private constructor( private fun playCommitBackAnimation() { // Check if we should vibrate again if (previousState != GestureState.FLUNG) { - backCallback.triggerBack() velocityTracker!!.computeCurrentVelocity(1000) val isSlow = abs(velocityTracker!!.xVelocity) < 500 val hasNotVibratedRecently = @@ -519,6 +518,10 @@ class BackPanelController private constructor( vibratorHelper.vibrate(VibrationEffect.EFFECT_CLICK) } } + // Dispatch the actual back trigger + if (DEBUG) Log.d(TAG, "playCommitBackAnimation() invoked triggerBack() on backCallback") + backCallback.triggerBack() + playAnimation(setGoneEndListener) }