Check if vibration duration is > 0 on Android

(cherry picked from commit 47f338fc12)
This commit is contained in:
Marcus Brummer 2021-08-21 17:15:46 +02:00 committed by Rémi Verschelde
parent 1b585634f1
commit 2abf2a6622
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -442,7 +442,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) {