This commit is contained in:
Tommaso Berlose
2020-05-06 16:16:31 +02:00
parent e2503decd2
commit 2e684e0902
29 changed files with 185 additions and 26 deletions

View File

@ -23,4 +23,14 @@ object AlarmHelper {
""
}
}
fun isAlarmProbablyWrong(context: Context): Boolean {
with(context.getSystemService(Context.ALARM_SERVICE) as AlarmManager) {
val alarm = nextAlarmClock
return (
alarm != null
&& alarm.triggerTime - Calendar.getInstance().timeInMillis < 5 * 60 * 1000
)
}
}
}