Bug 752153 - Improve the exit procedure for the Gecko Android Looper r=blassey
authorJames Willcox <jwillcox@mozilla.com>
Mon, 07 May 2012 21:32:53 -0400
changeset 93440 56ffdd5c9388ab76c9c25cef55b91500e658b391
parent 93439 7d96ff6113c75a8aa67c8534f514847fa35ff440
child 93441 94ffc045ba89b4d4cea8aba91d789c58de41294b
push idunknown
push userunknown
push dateunknown
reviewersblassey
bugs752153
milestone15.0a1
Bug 752153 - Improve the exit procedure for the Gecko Android Looper r=blassey
mobile/android/base/GeckoAppShell.java
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -2141,34 +2141,34 @@ public class GeckoAppShell
     }
 
     public static void unlockScreenOrientation() {
         GeckoScreenOrientationListener.getInstance().unlockScreenOrientation();
     }
 
     public static void pumpMessageLoop() {
         // We're going to run the Looper below, but we need a way to break out, so
-        // we post this Runnable that throws a RuntimeException. This causes the loop
+        // we post this Runnable that throws an AssertionError. This causes the loop
         // to exit without marking the Looper as dead. The Runnable is added to the
         // end of the queue, so it will be executed after anything
         // else that has been added prior.
         //
         // A more civilized method would obviously be preferred. Looper.quit(),
         // however, marks the Looper as dead and it cannot be prepared or run
         // again. And since you can only have a single Looper per thread,
         // here we are.
         sGeckoHandler.post(new Runnable() {
             public void run() {
-                throw new RuntimeException();
+                throw new AssertionError();
             }
         });
         
         try {
             Looper.loop();
-        } catch(Exception ex) {}
+        } catch(Throwable ex) {}
     }
 
     static class AsyncResultHandler extends GeckoApp.FilePickerResultHandler {
         private long mId;
         AsyncResultHandler(long id) {
             mId = id;
         }