[fix] Adds missing canScheduleExactAlarm guard.

This commit is contained in:
Patrick Schneider 2025-08-22 12:26:27 +02:00
commit f07974daee
2 changed files with 3 additions and 3 deletions

View file

@ -10,8 +10,8 @@ android {
applicationId "org.secuso.aktivpause"
minSdkVersion 21
targetSdkVersion 34
versionCode 101
versionName "1.2.5"
versionCode 102
versionName "1.2.6"
vectorDrawables.useSupportLibrary = true
}
buildTypes {

View file

@ -144,7 +144,7 @@ public class TimerSchedulerReceiver extends WakefulBroadcastReceiver {
}
}
if((done || !scheduleExerciseDaysEnabled)) {
if((done || !scheduleExerciseDaysEnabled) && (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) || alarmManager.canScheduleExactAlarms()) {
AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), automaticTimerPending);
}
}