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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user