mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-20 05:49:13 +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());
|
file = File.createTempFile(VaultRepository.FILENAME_PREFIX_EXPORT + "-", ".json", getExportCacheDir());
|
||||||
outStream = new FileOutputStream(file);
|
outStream = new FileOutputStream(file);
|
||||||
cb.exportVault(outStream);
|
cb.exportVault(outStream);
|
||||||
|
|
||||||
new ExportTask(requireContext(), new ExportResultListener()).execute(getLifecycle(), new ExportTask.Params(file, uri));
|
|
||||||
} catch (VaultRepositoryException | IOException e) {
|
} catch (VaultRepositoryException | IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Dialogs.showErrorDialog(requireContext(), R.string.exporting_vault_error, e);
|
Dialogs.showErrorDialog(requireContext(), R.string.exporting_vault_error, e);
|
||||||
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (outStream != null) {
|
if (outStream != null) {
|
||||||
|
@ -532,6 +531,8 @@ public class ImportExportPreferencesFragment extends PreferencesFragment {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new ExportTask(requireContext(), new ExportResultListener()).execute(getLifecycle(), new ExportTask.Params(file, uri));
|
||||||
}, _exportFilter);
|
}, _exportFilter);
|
||||||
_exportFilter = null;
|
_exportFilter = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue