Fixed unintentional vibrates

This commit is contained in:
M66B 2016-06-26 14:46:10 +02:00
parent 4d2fd917bf
commit f92994e4f4
1 changed files with 5 additions and 3 deletions

View File

@ -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();