Skip to content

Commit a21921f

Browse files
committed
Update: Move setting to exact schedules to advanced settings
1 parent 60a1e25 commit a21921f

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/main/java/com/machiav3lli/backup/ui/pages/AdvancedPrefsPage.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ import com.machiav3lli.backup.ui.compose.component.TextInput
4848
import com.machiav3lli.backup.ui.compose.icons.Phosphor
4949
import com.machiav3lli.backup.ui.compose.icons.phosphor.AndroidLogo
5050
import com.machiav3lli.backup.ui.compose.icons.phosphor.AsteriskSimple
51+
import com.machiav3lli.backup.ui.compose.icons.phosphor.Clock
5152
import com.machiav3lli.backup.ui.compose.icons.phosphor.ClockCounterClockwise
5253
import com.machiav3lli.backup.ui.compose.icons.phosphor.Hash
5354
import com.machiav3lli.backup.ui.compose.icons.phosphor.ShieldStar
5455
import com.machiav3lli.backup.ui.compose.icons.phosphor.Warning
5556
import com.machiav3lli.backup.ui.compose.mix
5657
import com.machiav3lli.backup.utils.SystemUtils.numCores
5758
import com.machiav3lli.backup.utils.extensions.Android
59+
import com.machiav3lli.backup.utils.scheduleAlarmsOnce
5860
import kotlinx.collections.immutable.persistentListOf
5961
import kotlinx.collections.immutable.toPersistentList
6062

@@ -325,12 +327,6 @@ val pref_useAlarmClock = BooleanPref(
325327
defaultValue = false
326328
)
327329

328-
val pref_useExactAlarm = BooleanPref(
329-
key = "dev-adv.useExactAlarm",
330-
summaryId = R.string.prefs_useexactalarm_summary,
331-
defaultValue = false
332-
)
333-
334330
val pref_backupPauseApps = BooleanPref(
335331
key = "dev-adv.backupPauseApps",
336332
summary = """
@@ -649,6 +645,14 @@ val pref_allowDowngrade = BooleanPref(
649645
defaultValue = false
650646
)
651647

648+
val pref_useExactAlarm = BooleanPref(
649+
key = "adv.useExactAlarm",
650+
titleId = R.string.prefs_useexactalarm_title,
651+
summaryId = R.string.prefs_useexactalarm_summary,
652+
icon = Phosphor.Clock,
653+
defaultValue = true,
654+
onChanged = { scheduleAlarmsOnce(NeoApp.context) }
655+
)
652656

653657
//---------------------------------------- values that should persist for internal purposes (no UI)
654658

src/main/res/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
<string name="prefs_usecolumnnamesaf_summary" translatable="false">eventually disable this, if you have problems with SAF storage</string>
193193
<string name="prefs_cancelonstart_summary" translatable="false">cancel all remaining jobs on OAndBackupX start [needs reboot]</string>
194194
<string name="prefs_usealarmclock_summary" translatable="false">use the alarm clock to schedule backups, this shows an alarm icon in the notification bar [needs reboot]</string>
195-
<string name="prefs_useexactalarm_summary" translatable="false">if not using useAlarmClock, then use exact alarms, otherwise use inexact alarms which may be better for battery [needs reboot]</string>
195+
<string name="prefs_useexactalarm_summary">if not using useAlarmClock, then use exact alarms, otherwise use inexact alarms which may be better for battery</string>
196196
<string name="prefs_backuptarcmd_summary" translatable="false">use tar shell command for backup</string>
197197
<string name="prefs_restoretarcmd_summary" translatable="false">use tar shell command for restore</string>
198198
<string name="prefs_stricthardlinks_summary" translatable="false">for API tar only: unpack hard links as hard links (otherwise they become symlinks)</string>
@@ -503,4 +503,5 @@
503503
<string name="refresh_failed">Refresh failed</string>
504504
<string name="backupdir_inaccessible">Backup location is not accessible</string>
505505
<string name="unknown_error">Unknown error</string>
506+
<string name="prefs_useexactalarm_title">Use exact alarm for schedules</string>
506507
</resources>

0 commit comments

Comments
 (0)