Bug 1370915 - Reorganize compatibility checks in BrowserApp and GeckoApp to avoid attempting to load mozglue on unsupported hardware. r=jchen

This commit is contained in:
Dylan Roeh 2017-11-17 08:51:39 -06:00
parent 09426b3bf3
commit aa335d6514
2 changed files with 13 additions and 7 deletions

View File

@ -621,8 +621,13 @@ public class BrowserApp extends GeckoApp
final Context appContext = getApplicationContext();
showSplashScreen = true;
GeckoLoader.loadMozGlue(appContext);
if (!HardwareUtils.isSupportedSystem() || !GeckoLoader.neonCompatible()) {
boolean supported = HardwareUtils.isSupportedSystem();
if (supported) {
GeckoLoader.loadMozGlue(appContext);
supported = GeckoLoader.neonCompatible();
}
if (!supported) {
// This build does not support the Android version of the device; Exit early.
super.onCreate(savedInstanceState);
return;

View File

@ -914,11 +914,12 @@ public abstract class GeckoApp extends GeckoActivity
enableStrictMode();
}
// Mozglue should already be loaded by BrowserApp.onCreate() in Fennec, but in
// custom tabs it may not be.
GeckoLoader.loadMozGlue(getApplicationContext());
if (!HardwareUtils.isSupportedSystem() || !GeckoLoader.neonCompatible()) {
boolean supported = HardwareUtils.isSupportedSystem();
if (supported) {
GeckoLoader.loadMozGlue(getApplicationContext());
supported = GeckoLoader.neonCompatible();
}
if (!supported) {
// This build does not support the Android version of the device: Show an error and finish the app.
mIsAbortingAppLaunch = true;
super.onCreate(savedInstanceState);