Bug 1073328 - Prevent using our own handler as system handler; r=snorp
authorJim Chen <nchen@mozilla.com>
Fri, 26 Sep 2014 15:45:46 -0400
changeset 207559 4793e12b972083254882011f0b2bb47ff19c3ff1
parent 207558 64550e741f147f73c02948f55c93369d426d44b2
child 207560 8bc6dfe614be695a8e41fac192d14a0e0fe26be1
push id27562
push usercbook@mozilla.com
push dateMon, 29 Sep 2014 13:45:04 +0000
treeherdermozilla-central@f57209ddc739 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1073328
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1073328 - Prevent using our own handler as system handler; r=snorp
mobile/android/base/GeckoAppShell.java
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -207,17 +207,19 @@ public class GeckoAppShell
     public static void removeObserver(String observerKey) {
         sendEventToGecko(GeckoEvent.createRemoveObserverEvent(observerKey));
     }
     public static native Message getNextMessageFromQueue(MessageQueue queue);
     public static native void onSurfaceTextureFrameAvailable(Object surfaceTexture, int id);
     public static native void dispatchMemoryPressure();
 
     public static void registerGlobalExceptionHandler() {
-        systemUncaughtHandler = Thread.getDefaultUncaughtExceptionHandler();
+        if (systemUncaughtHandler == null) {
+            systemUncaughtHandler = Thread.getDefaultUncaughtExceptionHandler();
+        }
 
         Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
             @Override
             public void uncaughtException(Thread thread, Throwable e) {
                 handleUncaughtException(thread, e);
             }
         });
     }