make sure the reminder sounds and vibrations loop

This commit is contained in:
tibbi 2018-03-14 10:01:57 +01:00
parent b6e0d8381f
commit 5e564bfa25
2 changed files with 8 additions and 4 deletions

View file

@ -229,11 +229,13 @@ class TimerFragment : Fragment() {
} }
if (context.config.timerVibrate) { if (context.config.timerVibrate) {
val vibrateArray = LongArray(120) { 500 } val vibrateArray = LongArray(2) { 500 }
builder.setVibrate(vibrateArray) builder.setVibrate(vibrateArray)
} }
return builder.build() val notification = builder.build()
notification.flags = notification.flags or Notification.FLAG_INSISTENT
return notification
} }
private fun getTimerPendingIntent(context: Context): PendingIntent { private fun getTimerPendingIntent(context: Context): PendingIntent {

View file

@ -73,11 +73,13 @@ class AlarmReceiver : BroadcastReceiver() {
} }
if (alarm.vibrate) { if (alarm.vibrate) {
val vibrateArray = LongArray(context.config.alarmMaxReminderSecs * 2) { 500 } val vibrateArray = LongArray(2) { 500 }
builder.setVibrate(vibrateArray) builder.setVibrate(vibrateArray)
} }
return builder.build() val notification = builder.build()
notification.flags = notification.flags or Notification.FLAG_INSISTENT
return notification
} }
private fun getSnoozePendingIntent(context: Context, alarm: Alarm): PendingIntent { private fun getSnoozePendingIntent(context: Context, alarm: Alarm): PendingIntent {