Fix scheduled backup jobs cancelling itself.

This commit is contained in:
Cody Henthorne
2023-02-28 13:49:43 -05:00
committed by Greyson Parrelli
parent 8cbad2c3a6
commit e635c3030e

View File

@@ -56,9 +56,9 @@ public final class LocalBackupJob extends BaseJob {
.setQueue(QUEUE)
.setMaxInstancesForFactory(1)
.setMaxAttempts(3);
if (force || Build.VERSION.SDK_INT >= 31) {
if (force) {
jobManager.cancelAllInQueue(QUEUE);
} else {
} else if (Build.VERSION.SDK_INT < 31) {
parameters.addConstraint(ChargingConstraint.KEY);
}