mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-19 05:19:12 +00:00
Flush temporary export file before starting ExportTask
The previous logic was not an issue because FileOutputStream is unbuffered, but still, this is more correct.
This commit is contained in:
parent
ad2dc803fb
commit
e8d712ec71
1 changed files with 3 additions and 2 deletions
|
@ -518,11 +518,10 @@ public class ImportExportPreferencesFragment extends PreferencesFragment {
|
|||
file = File.createTempFile(VaultRepository.FILENAME_PREFIX_EXPORT + "-", ".json", getExportCacheDir());
|
||||
outStream = new FileOutputStream(file);
|
||||
cb.exportVault(outStream);
|
||||
|
||||
new ExportTask(requireContext(), new ExportResultListener()).execute(getLifecycle(), new ExportTask.Params(file, uri));
|
||||
} catch (VaultRepositoryException | IOException e) {
|
||||
e.printStackTrace();
|
||||
Dialogs.showErrorDialog(requireContext(), R.string.exporting_vault_error, e);
|
||||
return;
|
||||
} finally {
|
||||
try {
|
||||
if (outStream != null) {
|
||||
|
@ -532,6 +531,8 @@ public class ImportExportPreferencesFragment extends PreferencesFragment {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
new ExportTask(requireContext(), new ExportResultListener()).execute(getLifecycle(), new ExportTask.Params(file, uri));
|
||||
}, _exportFilter);
|
||||
_exportFilter = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue