Bug 1345267 - Check NEON compatibility in BrowserApp/GeckoApp.onCreate() and fail with an appropriate error message if necessary. r=jchen
--- 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;
}