Bug 1415778 - Pre: Don't use ANDROID_PACKAGE_NAME in GeckoView. r=darchons draft
authorNick Alexander <nalexander@mozilla.com>
Wed, 08 Nov 2017 21:15:12 -0800
changeset 695699 b950688bd08a0b491baf863ea196dcf7e360ce2c
parent 695600 2bdf6eed0f64a51dfe099e089852533595f1a896
child 695700 aace47e406e5e518aa789e5bfcb7a6932b567594
push id88507
push usernalexander@mozilla.com
push dateThu, 09 Nov 2017 17:47:59 +0000
reviewersdarchons
bugs1415778
milestone58.0a1
Bug 1415778 - Pre: Don't use ANDROID_PACKAGE_NAME in GeckoView. r=darchons MozReview-Commit-ID: FswHnEIBM35
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -107,17 +107,21 @@ public class GeckoAppShell
     private static final String LOGTAG = "GeckoAppShell";
 
     // We have static members only.
     private GeckoAppShell() { }
 
     private static final CrashHandler CRASH_HANDLER = new CrashHandler() {
         @Override
         protected String getAppPackageName() {
-            return AppConstants.ANDROID_PACKAGE_NAME;
+            final Context appContext = getAppContext();
+            if (appContext == null) {
+                return "<unknown>";
+            }
+            return appContext.getPackageName();
         }
 
         @Override
         protected Context getAppContext() {
             return getApplicationContext();
         }
 
         @Override