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

Commit 84398222 authored by San Mehat's avatar San Mehat
Browse files

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



Change-Id: I94b84a45557cbce706c37d5088d398283a639c80
Signed-off-by: default avatarSan Mehat <san@google.com>
parent 39e64e76
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -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) {
                    new Thread() {
                        public void run() {
                            try {
                                service.formatVolume(Environment.getExternalStorageDirectory().toString());
                    } catch (android.os.RemoteException e) {
                            } 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");
                }