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

Commit da5b4a3e authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Introduce HapticFeedbackConstants.TEXT_HANDLE_MOVE

This CL	introduces a new haptic feedback type for the scenario where
the user is manually moving the text insertion/selection handle on the
touch devices such as touch screen.

Having a dedicated constant is necessary for device-wide consistency and
flexibility to fine tune the feedback in future.

Bug: 62454887
Bug: 62487772
Fixes: 62486763
Test: Confirmed that View#performHapticFeedback() with this constant
      triggers vibration.
Change-Id: I25841f20c3b8dbf0e9dabe75227c41d954193d33
parent 62031b89
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -61,6 +61,12 @@ public class HapticFeedbackConstants {
     */
    public static final int VIRTUAL_KEY_RELEASE = 7;

    /**
     * The user has performed a selection/insertion handle move on text field.
     * @hide
     */
    public static final int TEXT_HANDLE_MOVE = 8;

    /**
     * This is a private constant.  Feel free to renumber as desired.
     * @hide
+2 −0
Original line number Diff line number Diff line
@@ -7694,6 +7694,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                return VibrationEffect.get(VibrationEffect.EFFECT_TICK);
            case HapticFeedbackConstants.VIRTUAL_KEY_RELEASE:
                return VibrationEffect.get(VibrationEffect.EFFECT_TICK);
            case HapticFeedbackConstants.TEXT_HANDLE_MOVE:
                return VibrationEffect.get(VibrationEffect.EFFECT_TICK);
            default:
                return null;
        }