Bug 1073328 - Prevent using our own handler as system handler. r=snorp, a=lmandel
authorJim Chen <nchen@mozilla.com>
Fri, 26 Sep 2014 15:45:46 -0400
changeset 225961 967cb2edcd52
parent 225960 43e9c7a57468
child 225962 de49643707ae
push id4088
push userryanvm@gmail.com
push date2014-11-06 15:24 +0000
treeherdermozilla-beta@dfe08b30f41f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, lmandel
bugs1073328
milestone34.0
Bug 1073328 - Prevent using our own handler as system handler. r=snorp, a=lmandel
mobile/android/base/GeckoAppShell.java
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -206,17 +206,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);
             }
         });
     }