Handle missing migration source volume.

Users can try migrating primary storage while the current location
is missing/unmounted.  Fail gracefully instead of runtime restarting.

Bug: 21927076
Change-Id: I54b92487faf9e62d5d309734bf4c436a9259d156
This commit is contained in:
Jeff Sharkey
2015-07-05 14:17:40 -07:00
parent 5b45c3cb2f
commit 6a0082b483
2 changed files with 11 additions and 2 deletions

View File

@@ -81,6 +81,11 @@ public abstract class MigrateEstimateTask extends AsyncTask<Void, Void, Long> im
final VolumeInfo privateVol = mContext.getPackageManager().getPrimaryStorageCurrentVolume();
final VolumeInfo emulatedVol = mStorage.findEmulatedForPrivate(privateVol);
if (emulatedVol == null) {
Log.w(TAG, "Failed to find current primary storage");
return -1L;
}
final String path = emulatedVol.getPath().getAbsolutePath();
Log.d(TAG, "Estimating for current path " + path);