Merge "Remove haptic primitives that aren't ready yet." into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6bd4a7edb8
@@ -37160,12 +37160,10 @@ package android.os {
|
||||
method @Nullable public android.os.VibrationEffect.Composition addPrimitive(int, @FloatRange(from=0.0f, to=1.0f) float, @IntRange(from=0) int);
|
||||
method @NonNull public android.os.VibrationEffect compose();
|
||||
field public static final int PRIMITIVE_CLICK = 1; // 0x1
|
||||
field public static final int PRIMITIVE_LIGHT_TICK = 7; // 0x7
|
||||
field public static final int PRIMITIVE_QUICK_FALL = 6; // 0x6
|
||||
field public static final int PRIMITIVE_QUICK_RISE = 4; // 0x4
|
||||
field public static final int PRIMITIVE_SLOW_RISE = 5; // 0x5
|
||||
field public static final int PRIMITIVE_SPIN = 3; // 0x3
|
||||
field public static final int PRIMITIVE_THUD = 2; // 0x2
|
||||
field public static final int PRIMITIVE_TICK = 7; // 0x7
|
||||
}
|
||||
|
||||
public abstract class Vibrator {
|
||||
|
||||
@@ -963,7 +963,7 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
PRIMITIVE_QUICK_RISE,
|
||||
PRIMITIVE_SLOW_RISE,
|
||||
PRIMITIVE_QUICK_FALL,
|
||||
PRIMITIVE_LIGHT_TICK,
|
||||
PRIMITIVE_TICK,
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Primitive {}
|
||||
@@ -981,10 +981,14 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
* A haptic effect that simulates downwards movement with gravity. Often
|
||||
* followed by extra energy of hitting and reverberation to augment
|
||||
* physicality.
|
||||
*
|
||||
* @hide Not confident enough to expose publicly yet
|
||||
*/
|
||||
public static final int PRIMITIVE_THUD = 2;
|
||||
/**
|
||||
* A haptic effect that simulates spinning momentum.
|
||||
*
|
||||
* @hide Not confident enough to expose publicly yet
|
||||
*/
|
||||
public static final int PRIMITIVE_SPIN = 3;
|
||||
/**
|
||||
@@ -1003,7 +1007,8 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
* This very short effect should produce a light crisp sensation intended
|
||||
* to be used repetitively for dynamic feedback.
|
||||
*/
|
||||
public static final int PRIMITIVE_LIGHT_TICK = 7;
|
||||
// Internally this maps to the HAL constant CompositePrimitive::LIGHT_TICK
|
||||
public static final int PRIMITIVE_TICK = 7;
|
||||
|
||||
|
||||
private ArrayList<PrimitiveEffect> mEffects = new ArrayList<>();
|
||||
@@ -1081,7 +1086,7 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
*
|
||||
*/
|
||||
static int checkPrimitive(int primitiveId) {
|
||||
Preconditions.checkArgumentInRange(primitiveId, PRIMITIVE_NOOP, PRIMITIVE_LIGHT_TICK,
|
||||
Preconditions.checkArgumentInRange(primitiveId, PRIMITIVE_NOOP, PRIMITIVE_TICK,
|
||||
"primitiveId");
|
||||
return primitiveId;
|
||||
}
|
||||
@@ -1108,8 +1113,8 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
return "PRIMITIVE_SLOW_RISE";
|
||||
case PRIMITIVE_QUICK_FALL:
|
||||
return "PRIMITIVE_QUICK_FALL";
|
||||
case PRIMITIVE_LIGHT_TICK:
|
||||
return "PRIMITIVE_LIGHT_TICK";
|
||||
case PRIMITIVE_TICK:
|
||||
return "PRIMITIVE_TICK";
|
||||
|
||||
default:
|
||||
return Integer.toString(id);
|
||||
|
||||
Reference in New Issue
Block a user