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