Merge "Forget volumes that have been freshly formatted." into rvc-dev am: 2ad10d0dde am: 0f167f7cd0 am: 6513ae1807 am: 701c424023
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11883072 Change-Id: I3bf39932ebb850b86daa2254542f10459eae9342
This commit is contained in:
@@ -2260,8 +2260,15 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS);
|
||||
|
||||
final VolumeInfo vol = findVolumeByIdOrThrow(volId);
|
||||
final String fsUuid = vol.fsUuid;
|
||||
try {
|
||||
mVold.format(vol.id, "auto");
|
||||
|
||||
// After a successful format above, we should forget about any
|
||||
// records for the old partition, since it'll never appear again
|
||||
if (!TextUtils.isEmpty(fsUuid)) {
|
||||
forgetVolume(fsUuid);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Slog.wtf(TAG, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user