summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2010-03-29 14:30:38 -0700
committerSan Mehat <san@google.com>2010-03-29 14:32:02 -0700
commit84398222890a060a0d6feb3b35544781ba2108be (patch)
treee1d2c465ed8d8c41ac1526a51a88e0d4529e8c15
parent39e64e76c14f6ad0a844cea6c9ea9865f0b9261e (diff)
downloadpackages_apps_settings-84398222890a060a0d6feb3b35544781ba2108be.zip
packages_apps_settings-84398222890a060a0d6feb3b35544781ba2108be.tar.gz
packages_apps_settings-84398222890a060a0d6feb3b35544781ba2108be.tar.bz2
Settings: Fix for http://b/issue?id=2538399 (ANR while formatting sd)
Change-Id: I94b84a45557cbce706c37d5088d398283a639c80 Signed-off-by: San Mehat <san@google.com>
-rw-r--r--src/com/android/settings/MediaFormat.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/com/android/settings/MediaFormat.java b/src/com/android/settings/MediaFormat.java
index 71d2766..075534d 100644
--- a/src/com/android/settings/MediaFormat.java
+++ b/src/com/android/settings/MediaFormat.java
@@ -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");
}