Stop services before import

This commit is contained in:
M66B 2023-09-09 08:39:30 +02:00
parent 0eb7b23bc4
commit 61e6dcf2ea
1 changed files with 8 additions and 1 deletions

View File

@ -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)