Fresh installs now have auto update enabled

This commit is contained in:
Jay 2020-01-09 22:10:05 -08:00
parent 8c8e4fd716
commit c692510c54
2 changed files with 7 additions and 2 deletions

View File

@ -20,7 +20,12 @@ object Migrations {
if (oldVersion < BuildConfig.VERSION_CODE) { if (oldVersion < BuildConfig.VERSION_CODE) {
preferences.lastVersionCode().set(BuildConfig.VERSION_CODE) preferences.lastVersionCode().set(BuildConfig.VERSION_CODE)
if (oldVersion == 0) return false if (oldVersion == 0) {
if (BuildConfig.INCLUDE_UPDATER && preferences.automaticUpdates()) {
UpdaterJob.setupTask()
}
return false
}
if (oldVersion < 14) { if (oldVersion < 14) {
// Restore jobs after upgrading to evernote's job scheduler. // Restore jobs after upgrading to evernote's job scheduler.

View File

@ -163,7 +163,7 @@ class PreferencesHelper(val context: Context) {
fun librarySortingAscending() = rxPrefs.getBoolean("library_sorting_ascending", true) fun librarySortingAscending() = rxPrefs.getBoolean("library_sorting_ascending", true)
fun automaticUpdates() = prefs.getBoolean(Keys.automaticUpdates, false) fun automaticUpdates() = prefs.getBoolean(Keys.automaticUpdates, true)
fun automaticExtUpdates() = rxPrefs.getBoolean(Keys.automaticExtUpdates, false) fun automaticExtUpdates() = rxPrefs.getBoolean(Keys.automaticExtUpdates, false)