mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Vibrate when entering call reconnecting state.
This commit is contained in:
committed by
Greyson Parrelli
parent
745dfc3fbb
commit
f2046c3c05
@@ -14,13 +14,17 @@ public final class VibrateUtil {
|
||||
private VibrateUtil() { }
|
||||
|
||||
public static void vibrateTick(@NonNull Context context) {
|
||||
vibrate(context, TICK_LENGTH);
|
||||
}
|
||||
|
||||
public static void vibrate(@NonNull Context context, int duration) {
|
||||
Vibrator vibrator = ServiceUtil.getVibrator(context);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
VibrationEffect effect = VibrationEffect.createOneShot(TICK_LENGTH, 64);
|
||||
VibrationEffect effect = VibrationEffect.createOneShot(duration, 64);
|
||||
vibrator.vibrate(effect);
|
||||
} else {
|
||||
vibrator.vibrate(TICK_LENGTH);
|
||||
vibrator.vibrate(duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user