Bug 1345267 - Check NEON compatibility in BrowserApp/GeckoApp.onCreate() and fail with an appropriate error message if necessary. r=jchen
☠☠ backed out by ce8ddd8bb7df ☠ ☠
authorDylan Roeh <droeh@mozilla.com>
Fri, 10 Mar 2017 10:29:31 -0600
changeset 496834 0cbf58746caee825d6d858c061ca8547427e5b8c
parent 496833 0e2602904cdcab1f1e210000d08bb5c76ebe983c
child 496835 a8448c330babbb5a7f4ba134cfc71b21d3d8f6aa
push id48705
push userbmo:gl@mozilla.com
push dateFri, 10 Mar 2017 18:47:07 +0000
reviewersjchen
bugs1345267
milestone55.0a1
Bug 1345267 - Check NEON compatibility in BrowserApp/GeckoApp.onCreate() and fail with an appropriate error message if necessary. r=jchen
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -583,17 +583,20 @@ public class BrowserApp extends GeckoApp
         if (AndroidGamepadManager.handleKeyEvent(event)) {
             return true;
         }
         return super.onKeyUp(keyCode, event);
     }
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
-        if (!HardwareUtils.isSupportedSystem()) {
+        final Context appContext = getApplicationContext();
+
+        GeckoLoader.loadMozGlue(appContext);
+        if (!HardwareUtils.isSupportedSystem() || !GeckoLoader.neonCompatible()) {
             // This build does not support the Android version of the device; Exit early.
             super.onCreate(savedInstanceState);
             return;
         }
 
         final SafeIntent intent = new SafeIntent(getIntent());
         final boolean isInAutomation = IntentUtils.getIsInAutomationFromEnvironment(intent);
 
@@ -605,18 +608,16 @@ public class BrowserApp extends GeckoApp
 
         // This has to be prepared prior to calling GeckoApp.onCreate, because
         // widget code and BrowserToolbar need it, and they're created by the
         // layout, which GeckoApp takes care of.
         ((GeckoApplication) getApplication()).prepareLightweightTheme();
 
         super.onCreate(savedInstanceState);
 
-        final Context appContext = getApplicationContext();
-
         initSwitchboard(this, intent, isInAutomation);
         initTelemetryUploader(isInAutomation);
 
         mBrowserChrome = (ViewGroup) findViewById(R.id.browser_chrome);
         mActionBarFlipper = (ViewFlipper) findViewById(R.id.browser_actionbar);
         mActionBar = (ActionModeCompatView) findViewById(R.id.actionbar);
 
         mVideoPlayer = (VideoPlayer) findViewById(R.id.video_player);
@@ -1740,20 +1741,16 @@ public class BrowserApp extends GeckoApp
         mBrowserToolbar.refresh();
     }
 
     @Override // BundleEventListener
     public void handleMessage(final String event, final GeckoBundle message,
                               final EventCallback callback) {
         switch (event) {
             case "Gecko:Ready":
-                if (!GeckoLoader.neonCompatible()) {
-                    conditionallyNotifyEOL();
-                }
-
                 EventDispatcher.getInstance().registerUiThreadListener(this, "Gecko:DelayedStartup");
 
                 // Handle this message in GeckoApp, but also enable the Settings
                 // menuitem, which is specific to BrowserApp.
                 super.handleMessage(event, message, callback);
 
                 final Menu menu = mMenu;
                 ThreadUtils.postToUiThread(new Runnable() {
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -1143,17 +1143,17 @@ public abstract class GeckoApp
     public void onCreate(Bundle savedInstanceState) {
         GeckoAppShell.ensureCrashHandling();
 
         // Enable Android Strict Mode for developers' local builds (the "default" channel).
         if ("default".equals(AppConstants.MOZ_UPDATE_CHANNEL)) {
             enableStrictMode();
         }
 
-        if (!HardwareUtils.isSupportedSystem()) {
+        if (!HardwareUtils.isSupportedSystem() || !GeckoLoader.neonCompatible()) {
             // This build does not support the Android version of the device: Show an error and finish the app.
             mIsAbortingAppLaunch = true;
             super.onCreate(savedInstanceState);
             showSDKVersionError();
             finish();
             return;
         }