Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasterWanna <MasterWanna@users.noreply.github.com>2021-05-03 18:49:00 +0300
committerMasterWanna <MasterWanna@users.noreply.github.com>2021-05-03 18:49:00 +0300
commitbab97f32a4969b62ebab1052f67f39effc1e04f1 (patch)
treede66548fbf1f2ded80bf9f1bec23061b28071879 /app/src/main/java/it/niedermann/owncloud/notes/persistence/migration
parent398cb4f8abf416e452e32de4c4486b869027a143 (diff)
SyncWorker called for update settings into running
Diffstat (limited to 'app/src/main/java/it/niedermann/owncloud/notes/persistence/migration')
-rw-r--r--app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java
index 641b943b..18e9eba0 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_21_22.java
@@ -8,6 +8,8 @@ import androidx.preference.PreferenceManager;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
+import it.niedermann.owncloud.notes.persistence.SyncWorker;
+
/**
* Enabling backgroundSync, set from {@link String} values to {@link Boolean} values
* https://github.com/stefan-niedermann/nextcloud-notes/issues/1168
@@ -30,10 +32,14 @@ public class Migration_21_22 extends Migration {
if (sharedPreferences.getString("backgroundSync", "on").equals("off")) {
editor.remove("backgroundSync");
editor.putBoolean("backgroundSync", false);
+ SyncWorker.update(context, false);
} else {
editor.remove("backgroundSync");
editor.putBoolean("backgroundSync", true);
+ SyncWorker.update(context, true);
}
+ } else {
+ SyncWorker.update(context, true);
}
editor.apply();
}