Move TEXT_HANDLE_MOVE and CLOCK_TICK to TEXTURE_TICK.
TEXTURE_TICK is a new constant that is expected to be called repeatedly
in order to simulate a texture effect when a user is interacting with
the device, like with TEXT_HANDLE_MOVE.
Bug: 111461797
Test: Manual
Change-Id: Ia21de3ce1755a908b4bd4fcbdda411864e5b9fe9
diff --git a/core/java/android/os/VibrationEffect.java b/core/java/android/os/VibrationEffect.java
index c74cbff..7958ddd 100644
--- a/core/java/android/os/VibrationEffect.java
+++ b/core/java/android/os/VibrationEffect.java
@@ -23,7 +23,7 @@
import android.content.ContentResolver;
import android.content.Context;
import android.hardware.vibrator.V1_0.EffectStrength;
-import android.hardware.vibrator.V1_2.Effect;
+import android.hardware.vibrator.V1_3.Effect;
import android.net.Uri;
import android.util.MathUtils;
@@ -94,6 +94,18 @@
*/
public static final int EFFECT_HEAVY_CLICK = Effect.HEAVY_CLICK;
+ /**
+ * A texture effect meant to replicate soft ticks.
+ *
+ * Unlike normal effects, texture effects are meant to be called repeatedly, generally in
+ * response to some motion, in order to replicate the feeling of some texture underneath the
+ * user's fingers.
+ *
+ * @see #get(int)
+ * @hide
+ */
+ public static final int EFFECT_TEXTURE_TICK = Effect.TEXTURE_TICK;
+
/** {@hide} */
@TestApi
public static final int EFFECT_STRENGTH_LIGHT = EffectStrength.LIGHT;
@@ -746,6 +758,7 @@
case EFFECT_CLICK:
case EFFECT_DOUBLE_CLICK:
case EFFECT_TICK:
+ case EFFECT_TEXTURE_TICK:
case EFFECT_THUD:
case EFFECT_POP:
case EFFECT_HEAVY_CLICK:
@@ -798,7 +811,7 @@
out.writeInt(mEffectStrength);
}
- public static final @android.annotation.NonNull Parcelable.Creator<Prebaked> CREATOR =
+ public static final @NonNull Parcelable.Creator<Prebaked> CREATOR =
new Parcelable.Creator<Prebaked>() {
@Override
public Prebaked createFromParcel(Parcel in) {
@@ -813,7 +826,7 @@
};
}
- public static final @android.annotation.NonNull Parcelable.Creator<VibrationEffect> CREATOR =
+ public static final @NonNull Parcelable.Creator<VibrationEffect> CREATOR =
new Parcelable.Creator<VibrationEffect>() {
@Override
public VibrationEffect createFromParcel(Parcel in) {