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

Commit ccbdc57e authored by Rubin Xu's avatar Rubin Xu
Browse files

No longer use ExternalStorageFormatter to format external storage

Bug: 9433509
Change-Id: I5723828de080df568937004157acf830ca190f81
parent 91ba69df
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -22,9 +22,7 @@ import android.content.pm.ActivityInfo;
import android.os.AsyncTask;
import android.service.persistentdata.PersistentDataBlockManager;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.os.storage.ExternalStorageFormatter;

import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.os.UserManager;
@@ -111,19 +109,13 @@ public class MasterClearConfirm extends InstrumentedFragment {
    };

    private void doMasterClear() {
        if (mEraseSdCard) {
            Intent intent = new Intent(ExternalStorageFormatter.FORMAT_AND_FACTORY_RESET);
            intent.putExtra(Intent.EXTRA_REASON, "MasterClearConfirm");
            intent.setComponent(ExternalStorageFormatter.COMPONENT_NAME);
            getActivity().startService(intent);
        } else {
        Intent intent = new Intent(Intent.ACTION_MASTER_CLEAR);
        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
        intent.putExtra(Intent.EXTRA_REASON, "MasterClearConfirm");
        intent.putExtra(Intent.EXTRA_WIPE_EXTERNAL_STORAGE, mEraseSdCard);
        getActivity().sendBroadcast(intent);
        // Intent handling is asynchronous -- assume it will happen soon.
    }
    }

    /**
     * Configure the UI for the final confirmation interaction