summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/StorageManagerService.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index 1ce3dfe9f3a0..bffe346db9bc 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -2252,8 +2252,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);
}