Merge pull request #7720 from osmandapp/DataStorage

Data storage
This commit is contained in:
max-klaus 2019-10-22 17:40:47 +03:00 committed by GitHub
commit 52d5627e15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -500,6 +500,7 @@ public class DataStorageFragment extends BaseSettingsFragment implements DataSto
private long copiedSize; private long copiedSize;
private int failedCount; private int failedCount;
private long failedSize; private long failedSize;
private String exceptionMessage;
public MoveFilesToDifferentDirectory(OsmandActionBarActivity activity, File from, File to) { public MoveFilesToDifferentDirectory(OsmandActionBarActivity activity, File from, File to) {
this.activity = new WeakReference<>(activity); this.activity = new WeakReference<>(activity);
@ -561,7 +562,7 @@ public class DataStorageFragment extends BaseSettingsFragment implements DataSto
if (result.booleanValue() && runOnSuccess != null) { if (result.booleanValue() && runOnSuccess != null) {
runOnSuccess.run(); runOnSuccess.run();
} else if (!result.booleanValue()) { } else if (!result.booleanValue()) {
Toast.makeText(ctx, R.string.shared_string_io_error, Toast.LENGTH_LONG).show(); Toast.makeText(ctx, ctx.getString(R.string.shared_string_io_error) + ": " + exceptionMessage, Toast.LENGTH_LONG).show();
} }
} }
try { try {
@ -633,6 +634,7 @@ public class DataStorageFragment extends BaseSettingsFragment implements DataSto
try { try {
movingFiles(from, to, 0); movingFiles(from, to, 0);
} catch (IOException e) { } catch (IOException e) {
exceptionMessage = e.getMessage();
return false; return false;
} }
return true; return true;