From 08c9c63ceb085ec57fd0354a3283084c0be4d414 Mon Sep 17 00:00:00 2001 From: Jason Mylen Date: Mon, 17 Oct 2022 17:41:22 +0000 Subject: [PATCH] Move reset haptic effect into the move event handling. This is a low risk fix for the regression of the haptic effect not being played by not changing any of the event handling, even though that is likely worth further investigation. See ag/16624524 for and b/197602842 for more context. Fix: 197602842 Test: manual Change-Id: Iacdcb4e9cd3541d6d1ec4f0b1b406ff3f74f46bb --- .../systemui/shade/NotificationPanelViewController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 200579ad17cec..f56ecbb6753ff 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -4663,8 +4663,6 @@ public final class NotificationPanelViewController { private void startOpening(MotionEvent event) { updatePanelExpansionAndVisibility(); - // Reset at start so haptic can be triggered as soon as panel starts to open. - mHasVibratedOnOpen = false; //TODO: keyguard opens QS a different way; log that too? // Log the position of the swipe that opened the panel @@ -6180,6 +6178,10 @@ public final class NotificationPanelViewController { } break; case MotionEvent.ACTION_MOVE: + if (isFullyCollapsed()) { + // If panel is fully collapsed, reset haptic effect before adding movement. + mHasVibratedOnOpen = false; + } addMovement(event); if (!isFullyCollapsed()) { maybeVibrateOnOpening(true /* openingWithTouch */);