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

Commit 1b355669 authored by guopingy's avatar guopingy
Browse files

Prevent SD-card mount failure when erase sd card completed

if user select Erase SD-card from settings, make sure
internal/external SD card can be mounted back to
device after Erase SD card.

CRs-Fixed: 623918

Change-Id: I060b7f45a14cc241b99ded3272715d1865335721
parent 1ef0a357
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ public class ExternalStorageFormatter extends Service

    private boolean mFactoryReset = false;
    private boolean mAlwaysReset = false;
    private boolean mIsCancelled = false;
    private boolean mIsFormatSuccess = false;

    StorageEventListener mStorageListener = new StorageEventListener() {
@@ -130,7 +129,6 @@ public class ExternalStorageFormatter extends Service
    @Override
    public void onCancel(DialogInterface dialog) {

        mIsCancelled=true;
        IMountService mountService = getMountService();
        try {
            final StorageVolume[] volumes = mountService.getVolumeList();
@@ -197,7 +195,7 @@ public class ExternalStorageFormatter extends Service
                || Environment.MEDIA_MOUNTED_READ_ONLY.equals(status)) {
            updateProgressDialog(R.string.progress_unmounting);
            try {
                if(mIsCancelled && mIsFormatSuccess) return;
                if(mIsFormatSuccess) return;
                final IMountService mountService = getMountService();
                final StorageVolume[] volumes = mountService.getVolumeList();
                final ArrayList<StorageVolume> physicalVols = StorageManager.getPhysicalExternalVolume(volumes);