From 61e6dcf2ea75270ab4e1ea5a929c9570e8a4e01c Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 9 Sep 2023 08:39:30 +0200 Subject: [PATCH] Stop services before import --- .../java/eu/faircode/email/FragmentOptionsBackup.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java b/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java index 6c0175cd3d..0e742e2290 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java @@ -739,6 +739,9 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere NoStreamException.check(uri, context); + ServiceSynchronize.stop(context); + ServiceSend.stop(context); + StringBuilder data = new StringBuilder(); Log.i("Reading URI=" + uri); ContentResolver resolver = context.getContentResolver(); @@ -1251,7 +1254,6 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere db.endTransaction(); } - ServiceSynchronize.eval(context, "import"); Log.i("Imported data"); SpannableStringBuilder ssb = new SpannableStringBuilderEx(); @@ -1261,6 +1263,11 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere return null; } + @Override + protected void onExecuted(Bundle args, Void data) { + ServiceSynchronize.eval(context, "import"); + } + @Override protected void onException(Bundle args, Throwable ex) { if (ex instanceof NoStreamException)