From a0a0526f058ba80b492cf41aec302c6e5d293425 Mon Sep 17 00:00:00 2001 From: Federico Iosue Date: Mon, 1 Jun 2015 01:50:26 +0200 Subject: [PATCH] Minor changes to reminders on upgrade --- .../omninotes/async/DataBackupIntentService.java | 2 +- .../omninotes/async/upgrade/UpgradeProcessor.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/omniNotes/src/main/java/it/feio/android/omninotes/async/DataBackupIntentService.java b/omniNotes/src/main/java/it/feio/android/omninotes/async/DataBackupIntentService.java index 960d6dfca0..c040499019 100644 --- a/omniNotes/src/main/java/it/feio/android/omninotes/async/DataBackupIntentService.java +++ b/omniNotes/src/main/java/it/feio/android/omninotes/async/DataBackupIntentService.java @@ -509,7 +509,7 @@ private boolean importSettings(File backupDir) { private void resetReminders() { Log.d(Constants.TAG, "Resettings reminders"); for (Note note : DbHelper.getInstance().getNotesWithReminderNotFired()) { - ReminderHelper.addReminder(OmniNotes.getAppContext(), note); + ReminderHelper.addReminder(OmniNotes.getAppContext(), note, false); } } diff --git a/omniNotes/src/main/java/it/feio/android/omninotes/async/upgrade/UpgradeProcessor.java b/omniNotes/src/main/java/it/feio/android/omninotes/async/upgrade/UpgradeProcessor.java index 1f96a7e8f1..657e84e5be 100644 --- a/omniNotes/src/main/java/it/feio/android/omninotes/async/upgrade/UpgradeProcessor.java +++ b/omniNotes/src/main/java/it/feio/android/omninotes/async/upgrade/UpgradeProcessor.java @@ -21,9 +21,12 @@ import android.os.AsyncTask; import android.text.TextUtils; import android.util.Log; +import it.feio.android.omninotes.OmniNotes; import it.feio.android.omninotes.db.DbHelper; import it.feio.android.omninotes.models.Attachment; +import it.feio.android.omninotes.models.Note; import it.feio.android.omninotes.utils.Constants; +import it.feio.android.omninotes.utils.ReminderHelper; import it.feio.android.omninotes.utils.StorageHelper; import org.apache.commons.io.FilenameUtils; @@ -145,4 +148,14 @@ private void onUpgradeTo480() { } } + + /** + * Reschedule reminders after upgrade + */ + private void onUpgradeTo482() { + for (Note note : DbHelper.getInstance().getNotesWithReminderNotFired()) { + ReminderHelper.addReminder(OmniNotes.getAppContext(), note, false); + } + } + }