Merge "Add fallback for TEXTURE_TICK" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-19 05:35:02 +00:00
committed by Android (Google) Code Review
3 changed files with 6 additions and 0 deletions

View File

@@ -2010,6 +2010,7 @@ package android.os {
field public static final int EFFECT_STRENGTH_LIGHT = 0; // 0x0
field public static final int EFFECT_STRENGTH_MEDIUM = 1; // 0x1
field public static final int EFFECT_STRENGTH_STRONG = 2; // 0x2
field public static final int EFFECT_TEXTURE_TICK = 21; // 0x15
field public static final int EFFECT_THUD = 3; // 0x3
field public static final int[] RINGTONES;
}

View File

@@ -104,6 +104,7 @@ public abstract class VibrationEffect implements Parcelable {
* @see #get(int)
* @hide
*/
@TestApi
public static final int EFFECT_TEXTURE_TICK = Effect.TEXTURE_TICK;
/** {@hide} */

View File

@@ -236,6 +236,7 @@ public class VibratorService extends IVibratorService.Stub
case VibrationEffect.EFFECT_CLICK:
case VibrationEffect.EFFECT_DOUBLE_CLICK:
case VibrationEffect.EFFECT_HEAVY_CLICK:
case VibrationEffect.EFFECT_TEXTURE_TICK:
case VibrationEffect.EFFECT_TICK:
case VibrationEffect.EFFECT_POP:
case VibrationEffect.EFFECT_THUD:
@@ -379,6 +380,9 @@ public class VibratorService extends IVibratorService.Stub
mFallbackEffects.put(VibrationEffect.EFFECT_TICK, tickEffect);
mFallbackEffects.put(VibrationEffect.EFFECT_HEAVY_CLICK, heavyClickEffect);
mFallbackEffects.put(VibrationEffect.EFFECT_TEXTURE_TICK,
VibrationEffect.get(VibrationEffect.EFFECT_TICK, false));
mScaleLevels = new SparseArray<>();
mScaleLevels.put(SCALE_VERY_LOW,
new ScaleLevel(SCALE_VERY_LOW_GAMMA, SCALE_VERY_LOW_MAX_AMPLITUDE));