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

Commit e9dbf208 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix issue #3117472: Format storage dialog still broken" into gingerbread

parents aa6df366 4f6ee254
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