Continue exportig on errors

This commit is contained in:
M66B 2021-04-18 08:18:31 +02:00
parent 8c1ef89aec
commit a6092c6cd2
1 changed files with 64 additions and 61 deletions

View File

@ -920,7 +920,8 @@ public class FragmentFolders extends FragmentBase {
long last = new Date().getTime();
ContentResolver resolver = context.getContentResolver();
try (OutputStream out = new BufferedOutputStream(resolver.openOutputStream(uri))) {
for (int i = 0; i < ids.size(); i++) {
for (int i = 0; i < ids.size(); i++)
try {
long now = new Date().getTime();
if (now - last > EXPORT_PROGRESS_INTERVAL) {
last = now;
@ -994,6 +995,8 @@ public class FragmentFolders extends FragmentBase {
cr = false;
}
});
} catch (Throwable ex) {
Log.e(ex);
}
} finally {
nm.cancel("export", 1);