Fix issue #3117472: Format storage dialog still broken

Change-Id: I19b3a04e33785a56cb14457e4e3cd9232f585bb1
This commit is contained in:
Dianne Hackborn
2010-10-21 16:39:53 -07:00
parent 7dc08fb070
commit 4f6ee254bc

View File

@ -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