+ } else if (requestCode == ACTION_SELECT_STORAGE_PATH && resultCode == RESULT_OK) {
+ File currentStorageDir = new File(mStoragePath);
+ File upcomingStorageDir = new File(data.getStringExtra(UploadFilesActivity.EXTRA_CHOSEN_FILES));
+
+ if (currentStorageDir != upcomingStorageDir) {
+ Intent migrationIntent = new Intent(this, StorageMigrationActivity.class);
+ migrationIntent.putExtra(StorageMigrationActivity.KEY_MIGRATION_SOURCE_DIR,
+ currentStorageDir.getAbsolutePath());
+ migrationIntent.putExtra(StorageMigrationActivity.KEY_MIGRATION_TARGET_DIR,
+ currentStorageDir.getAbsolutePath());
+ startActivityForResult(migrationIntent, ACTION_PERFORM_MIGRATION);
+ }
+ } else if (requestCode == ACTION_PERFORM_MIGRATION && resultCode == RESULT_OK) {
+ String resultStorageDir = data.getStringExtra(StorageMigrationActivity.KEY_MIGRATION_TARGET_DIR);
+ mStoragePath = resultStorageDir;
+ mPrefStoragePath.setSummary(mStoragePath);