|
@@ -205,8 +205,14 @@ public class StorageMigration {
|
|
|
if (succeed) {
|
|
|
mProgressDialog.hide();
|
|
|
} else {
|
|
|
- mProgressDialog.getButton(ProgressDialog.BUTTON_POSITIVE).setVisibility(View.VISIBLE);
|
|
|
- mProgressDialog.setIndeterminateDrawable(mContext.getResources().getDrawable(R.drawable.image_fail));
|
|
|
+
|
|
|
+ if (code == R.string.file_migration_failed_not_readable) {
|
|
|
+ mProgressDialog.hide();
|
|
|
+ askToStillMove();
|
|
|
+ } else {
|
|
|
+ mProgressDialog.getButton(ProgressDialog.BUTTON_POSITIVE).setVisibility(View.VISIBLE);
|
|
|
+ mProgressDialog.setIndeterminateDrawable(mContext.getResources().getDrawable(R.drawable.image_fail));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (mListener != null) {
|
|
@@ -214,6 +220,29 @@ public class StorageMigration {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void askToStillMove() {
|
|
|
+
|
|
|
+ new AlertDialog.Builder(mContext)
|
|
|
+ .setMessage("Source directory not readable. Do you still want to change the storage path to "
|
|
|
+ + mStorageTarget + "? Note: all data will have to be downloaded again.")
|
|
|
+ .setNegativeButton(R.string.common_no, new OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ dialogInterface.dismiss();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .setPositiveButton(R.string.common_yes, new OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
+ if (mListener != null) {
|
|
|
+ mListener.onStorageMigrationFinished(mStorageTarget, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .create()
|
|
|
+ .show();
|
|
|
+ }
|
|
|
+
|
|
|
protected boolean[] saveAccountsSyncStatus() {
|
|
|
boolean[] syncs = new boolean[mOcAccounts.length];
|
|
|
for (int i = 0; i < mOcAccounts.length; ++i) {
|