Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab7046eb authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez
Browse files

[Floaty] Assistant haptics independent of invocation effect

This changes satisfies the logic behavior outlined in the table of:
https://b.corp.google.com/issues/417145104#comment6

This better separates the previous assistant haptics from the invocation
effect haptics.

Test: manual. Verified the correct haptics play according to the various
  combinations of the LPP invocation effect and LPP haptics flags (see the
  table in the buganizer comment above)
Flag: com.android.systemui.shared.enable_lpp_assist_invocation_haptic_effect
Bug: 417145104

Change-Id: I5676675b424e1a96b2e0c5d8cfb2878f246fbd1d
parent eab8e768
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1478,8 +1478,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                break;
            case LONG_PRESS_POWER_ASSISTANT:
                mPowerKeyHandled = true;
                if (!enableLppAssistInvocationHapticEffect()
                        && !enableLppAssistInvocationEffect()) {
                if (!enableLppAssistInvocationEffect()) {
                    performHapticFeedback(HapticFeedbackConstants.ASSISTANT_BUTTON,
                            "Power - Long Press - Go To Assistant");
                }
@@ -2563,6 +2562,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                if (getResolvedLongPressOnPowerBehavior() == LONG_PRESS_POWER_ASSISTANT) {
                    handleSingleKeyGestureInKeyGestureController(
                            KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_ASSISTANT, event);
                    if (!enableLppAssistInvocationHapticEffect()
                            && event.getAction() == ACTION_COMPLETE) {
                        // The invocation effect will not play haptics so we must play the
                        // assistant effect here
                        performHapticFeedback(HapticFeedbackConstants.ASSISTANT_BUTTON,
                                "Power - Long Press - Go To Assistant");
                    }
                    return;
                }
            }