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

Commit 4f6ee254 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #3117472: Format storage dialog still broken

Change-Id: I19b3a04e33785a56cb14457e4e3cd9232f585bb1
parent 7dc08fb0
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.internal.app;

import com.android.internal.os.storage.ExternalStorageFormatter;

import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -23,10 +25,6 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.storage.IMountService;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.Environment;
import android.util.Log;

/**
@@ -95,14 +93,9 @@ public class ExternalMediaFormatActivity extends AlertActivity implements Dialog
    public void onClick(DialogInterface dialog, int which) {

        if (which == POSITIVE_BUTTON) {
            IMountService mountService = IMountService.Stub.asInterface(ServiceManager
                .getService("mount"));
            if (mountService != null) {
                try {
                    mountService.formatVolume(Environment.getExternalStorageDirectory().toString());
                } catch (RemoteException e) {
                }
            }
            Intent intent = new Intent(ExternalStorageFormatter.FORMAT_ONLY);
            intent.setComponent(ExternalStorageFormatter.COMPONENT_NAME);
            startService(intent);
        }

        // No matter what, finish the activity