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 697856 0f66c86d7988cad6b00cacb1f22858ed089e6f4a
parent 697757 b0a6b4678b2f7dfb499328946b95366775f71edd
child 697857 c9547266f220d0fc5fb6bd060289b573a5b72ad4
push id89125
push usernalexander@mozilla.com
push dateTue, 14 Nov 2017 21:04:06 +0000
reviewersdarchons
bugs1415778
milestone59.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
@@ -108,17 +108,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