diff options
| author | Vince Leung <leungv@google.com> | 2020-12-22 00:26:58 +0000 |
|---|---|---|
| committer | Vince Leung <leungv@google.com> | 2021-01-10 22:55:15 +0000 |
| commit | 9eb7e9fe2d865b8e117928d25e6454053f38599d (patch) | |
| tree | 3831ad8b3963d41fc0b4657dd3a7f1b1bee60220 /core/java/android | |
| parent | 2f1258d279a888ebbc3972cfbb7db96806c9d99c (diff) | |
Add PRIMITIVE_LOW_TICK VibrationEffect
Bug: 174561580
Change-Id: I553a06b6dfb9d4a743d6aa1a6b0b728d90dbeee1
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/VibrationEffect.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/java/android/os/VibrationEffect.java b/core/java/android/os/VibrationEffect.java index b57418d751bc..c0b2ada7860c 100644 --- a/core/java/android/os/VibrationEffect.java +++ b/core/java/android/os/VibrationEffect.java @@ -1071,6 +1071,7 @@ public abstract class VibrationEffect implements Parcelable { PRIMITIVE_SLOW_RISE, PRIMITIVE_QUICK_FALL, PRIMITIVE_TICK, + PRIMITIVE_LOW_TICK, }) @Retention(RetentionPolicy.SOURCE) public @interface Primitive {} @@ -1116,6 +1117,12 @@ public abstract class VibrationEffect implements Parcelable { */ // Internally this maps to the HAL constant CompositePrimitive::LIGHT_TICK public static final int PRIMITIVE_TICK = 7; + /** + * This very short low frequency effect should produce a light crisp sensation + * intended to be used repetitively for dynamic feedback. + */ + // Internally this maps to the HAL constant CompositePrimitive::LOW_TICK + public static final int PRIMITIVE_LOW_TICK = 8; private ArrayList<PrimitiveEffect> mEffects = new ArrayList<>(); @@ -1194,7 +1201,7 @@ public abstract class VibrationEffect implements Parcelable { * */ static int checkPrimitive(int primitiveId) { - Preconditions.checkArgumentInRange(primitiveId, PRIMITIVE_NOOP, PRIMITIVE_TICK, + Preconditions.checkArgumentInRange(primitiveId, PRIMITIVE_NOOP, PRIMITIVE_LOW_TICK, "primitiveId"); return primitiveId; } @@ -1223,6 +1230,8 @@ public abstract class VibrationEffect implements Parcelable { return "PRIMITIVE_QUICK_FALL"; case PRIMITIVE_TICK: return "PRIMITIVE_TICK"; + case PRIMITIVE_LOW_TICK: + return "PRIMITIVE_LOW_TICK"; default: return Integer.toString(id); } |
