Add separate deviceInstallVersion preference

main
Alex Baker 12 hours ago
parent ec647abefc
commit a3c663a45b

@ -163,6 +163,9 @@ class Upgrader @Inject constructor(
} else {
setInstallDetails(to)
}
if (preferences.deviceInstallVersion == 0) {
preferences.deviceInstallVersion = from
}
preferences.lastSubscribeRequest -= TimeUnit.DAYS.toMillis(7)
preferences.setCurrentVersion(to)
}
@ -170,6 +173,7 @@ class Upgrader @Inject constructor(
private fun setInstallDetails(version: Int) {
preferences.installVersion = version
preferences.installDate = currentTimeMillis()
preferences.deviceInstallVersion = version
}
private fun run(from: Int, version: Int, runnable: suspend () -> Unit) {

@ -475,7 +475,8 @@ class TasksJsonImporter @Inject constructor(
}
private val ignorePrefs = intArrayOf(
R.string.p_current_version,
R.string.p_backups_android_backup_last
R.string.p_backups_android_backup_last,
R.string.p_device_install_version,
)
}
}

@ -343,6 +343,10 @@ class Preferences @JvmOverloads constructor(
get() = getLong(R.string.p_install_date, 0L)
set(value) = setLong(R.string.p_install_date, value)
var deviceInstallVersion: Int
get() = getInt(R.string.p_device_install_version, 0)
set(value) = setInt(R.string.p_device_install_version, value)
override var sortMode: Int
get() = getInt(R.string.p_sort_mode, SortHelper.SORT_DUE)
set(value) { setInt(R.string.p_sort_mode, value) }

@ -398,6 +398,7 @@
<string name="p_current_version">cv</string>
<string name="p_install_version">install_version</string>
<string name="p_install_date">install_date</string>
<string name="p_device_install_version">device_install_version</string>
<string name="p_default_location">default_location</string>
<string name="p_warn_notifications_disabled">warn_notifications_disabled</string>
<string name="p_warn_alarms_disabled">warn_alarms_disabled</string>

Loading…
Cancel
Save