From 47f338fc128b0dfb4711689d2ab0c52c01b80514 Mon Sep 17 00:00:00 2001 From: Marcus Brummer Date: Sat, 21 Aug 2021 17:15:46 +0200 Subject: [PATCH] Check if vibration duration is > 0 on Android --- platform/android/java/lib/src/org/godotengine/godot/Godot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.java b/platform/android/java/lib/src/org/godotengine/godot/Godot.java index 2926031bcca..896b1699535 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.java @@ -317,7 +317,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC @SuppressLint("MissingPermission") @Keep private void vibrate(int durationMs) { - if (requestPermission("VIBRATE")) { + if (durationMs > 0 && requestPermission("VIBRATE")) { Vibrator v = (Vibrator)getContext().getSystemService(Context.VIBRATOR_SERVICE); if (v != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {