mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-04-23 06:07:18 +02:00
Fallback to inexact alarm if exact is forbidden
This commit is contained in:
parent
975e5543d1
commit
963ed146eb
@ -48,7 +48,11 @@ fun Context.scheduleNextAutomaticBackup() {
|
|||||||
val pendingIntent = getAutomaticBackupIntent()
|
val pendingIntent = getAutomaticBackupIntent()
|
||||||
val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||||
try {
|
try {
|
||||||
AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, backupAtMillis, pendingIntent)
|
if (isUpsideDownCakePlus() && alarmManager.canScheduleExactAlarms()) {
|
||||||
|
AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, backupAtMillis, pendingIntent)
|
||||||
|
} else {
|
||||||
|
AlarmManagerCompat.setAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, backupAtMillis, pendingIntent)
|
||||||
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
showErrorToast(e)
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ indicatorfastscroll = "4524cd0b61"
|
|||||||
#Room
|
#Room
|
||||||
room = "2.6.0-alpha02"
|
room = "2.6.0-alpha02"
|
||||||
#Simple tools
|
#Simple tools
|
||||||
simple-commons = "c5a32fb1f3"
|
simple-commons = "d1629c7f1a"
|
||||||
#Gradle
|
#Gradle
|
||||||
gradlePlugins-agp = "8.1.0"
|
gradlePlugins-agp = "8.1.0"
|
||||||
#build
|
#build
|
||||||
|
Loading…
x
Reference in New Issue
Block a user