Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ad10d0d authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Forget volumes that have been freshly formatted." into rvc-dev

parents 3a05bfb7 e56dab21
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2259,8 +2259,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);
        }