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

Commit 04994989 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Add a new KEYBOARD_TAP haptic feedback type for very short, low-latency vibration.

The minimum value varies from device to device, so this is useful for defining
the shortest and most efficient vibration. The VibratorService creates a Thread
when playing back vibration patterns, so this allows you to avoid thread creation
and associated scheduling delays by specifying a one-shot duration in the config
file.
parent bab28017
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -139895,7 +139895,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="bundleWithValues" type="android.os.Bundle">
<parameter name="bundle" type="android.os.Bundle">
</parameter>
</constructor>
<method name="fillInNotifierBundle"
@@ -164736,6 +164736,17 @@
 visibility="public"
>
</field>
<field name="KEYBOARD_TAP"
 type="int"
 transient="false"
 volatile="false"
 value="3"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="LONG_PRESS"
 type="int"
 transient="false"
+6 −1
Original line number Diff line number Diff line
@@ -40,6 +40,11 @@ public class HapticFeedbackConstants {
     */
    public static final int SCROLL_BARRIER = 2;
    
    /**
     * The user has pressed a soft keyboard key.
     */
    public static final int KEYBOARD_TAP = 3;

    /**
     * This is a private constant.  Feel free to renumber as desired.
     * @hide
+5 −0
Original line number Diff line number Diff line
@@ -138,6 +138,11 @@
        <item>30</item>
    </integer-array>

    <!-- Vibrator pattern for a very short but reliable vibration for soft keyboard tap -->
    <integer-array name="config_keyboardTapVibePattern">
        <item>40</item>
    </integer-array>

    <!-- Vibrator pattern for feedback about booting with safe mode disabled -->
    <integer-array name="config_safeModeDisabledVibePattern">
        <item>0</item>