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

Commit 02c7e95f authored by Rubin Xu's avatar Rubin Xu Committed by Android (Google) Code Review
Browse files

Merge "No longer use ExternalStorageFormatter to format external storage" into mnc-dev

parents 6799ef42 ccbdc57e
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