Settings: Fix for http://b/issue?id=2538399 (ANR while formatting sd)

Change-Id: I94b84a45557cbce706c37d5088d398283a639c80
Signed-off-by: San Mehat <san@google.com>
This commit is contained in:
San Mehat
2010-03-29 14:30:38 -07:00
parent 39e64e76c1
commit 8439822289

View File

@@ -64,15 +64,19 @@ public class MediaFormat extends Activity {
if (Utils.isMonkeyRunning()) {
return;
}
IMountService service =
final IMountService service =
IMountService.Stub.asInterface(ServiceManager.getService("mount"));
if (service != null) {
try {
service.formatVolume(Environment.getExternalStorageDirectory().toString());
} catch (android.os.RemoteException e) {
// Intentionally blank - there's nothing we can do here
Log.w("MediaFormat", "Unable to invoke IMountService.formatMedia()");
}
new Thread() {
public void run() {
try {
service.formatVolume(Environment.getExternalStorageDirectory().toString());
} catch (Exception e) {
// Intentionally blank - there's nothing we can do here
Log.w("MediaFormat", "Unable to invoke IMountService.formatMedia()");
}
}
}.start();
} else {
Log.w("MediaFormat", "Unable to locate IMountService");
}