mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 18:15:49 +01:00
Make sure to close the outputstream of the export
This commit is contained in:
parent
bf729f41b2
commit
6370c6cac1
@ -65,8 +65,9 @@ public class PeriodicExporter extends BroadcastReceiver {
|
||||
return;
|
||||
}
|
||||
Uri dstUri = Uri.parse(dst);
|
||||
OutputStream out = context.getContentResolver().openOutputStream(dstUri);
|
||||
helper.exportDB(dbHandler, out);
|
||||
try (OutputStream out = context.getContentResolver().openOutputStream(dstUri)) {
|
||||
helper.exportDB(dbHandler, out);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
GB.updateExportFailedNotification(context.getString(R.string.notif_export_failed_title), context);
|
||||
LOG.info("Exception while exporting DB: ", ex);
|
||||
|
Loading…
Reference in New Issue
Block a user