Remove haptics for long presses in 3-button-nav

This CL removes haptics for long presses on 3-button-nav buttons, except
when the long press triggers a user visible action.

This means that for example the haptics for long pressing the recents
button are removed, whereas haptics for long pressing the home button
remain active since that launches circle-to-search.

Bug: 408968370
Test: Manual, i.e. verified that no haptic feedback is played when
      long pressing the recents button
Flag: EXEMPT bugfix
Change-Id: Icfeade8a659a8aa4882ef139696c66f410980303
This commit is contained in:
Johannes Gallmann committed 2025-05-12 15:35:57 +00:00
1 parent 950b841d3d
commit 76621e0972
3 files changed
+22 -11

No files matched your search

@@ -922,7 +922,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
navButtonController.onButtonLongClick(buttonType, view));
buttonView.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
}
return false;
});
@@ -966,7 +967,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
hasSentDownEvent.set(false);
mHandler.postDelayed(longPressTimeout, PREDICTIVE_BACK_TIMEOUT_MS);
rect.set(0, 0, v.getWidth(), v.getHeight());
buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
buttonView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
}
boolean isCancelled = motionEventAction == MotionEvent.ACTION_CANCEL
|| (!rect.contains(event.getX(), event.getY())