diff --git a/app/src/main/java/eu/faircode/netguard/Widget.java b/app/src/main/java/eu/faircode/netguard/Widget.java index ee87a367..718bb49b 100644 --- a/app/src/main/java/eu/faircode/netguard/Widget.java +++ b/app/src/main/java/eu/faircode/netguard/Widget.java @@ -62,9 +62,11 @@ public class Widget extends AppWidgetProvider { am.cancel(pi); // Vibrate - Vibrator vs = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); - if (vs.hasVibrator()) - vs.vibrate(50); + if (INTENT_OFF.equals(intent.getAction()) || INTENT_ON.equals(intent.getAction())) { + Vibrator vs = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); + if (vs.hasVibrator()) + vs.vibrate(50); + } if (INTENT_OFF.equals(intent.getAction())) { prefs.edit().putBoolean("enabled", false).apply();