diff --git a/mobile/android/base/AppConstants.java.in b/mobile/android/base/AppConstants.java.in index 3e180bdec125..959787fa6bbd 100644 --- a/mobile/android/base/AppConstants.java.in +++ b/mobile/android/base/AppConstants.java.in @@ -291,7 +291,7 @@ public class AppConstants { //#endif /** - * Target CPU architecture: "armeabi-v7a", "x86, "mips", .. + * Target CPU architecture: "armeabi-v7a", "arm64-v8a", "x86", "mips", .. */ public static final String ANDROID_CPU_ARCH = "@ANDROID_CPU_ARCH@"; diff --git a/mobile/android/geckoview/BuildConfig.java.in b/mobile/android/geckoview/BuildConfig.java.in index 297853f1b2d1..809d3157b3a6 100644 --- a/mobile/android/geckoview/BuildConfig.java.in +++ b/mobile/android/geckoview/BuildConfig.java.in @@ -51,7 +51,7 @@ public class BuildConfig { MOZ_APP_VERSION; /** - * Target CPU architecture: "armeabi-v7a", "x86, "mips", .. + * Target CPU architecture: "armeabi-v7a", "arm64-v8a", "x86", "mips", .. */ public static final String ANDROID_CPU_ARCH = "@ANDROID_CPU_ARCH@"; } diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareUtils.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareUtils.java index ea08d89dcc6e..dc55089b0ed1 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareUtils.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareUtils.java @@ -85,6 +85,11 @@ public final class HardwareUtils { return Build.CPU_ABI != null && Build.CPU_ABI.equals("armeabi-v7a"); } + public static boolean isARM64System() { + // 64-bit support was introduced in 21. + return Build.VERSION.SDK_INT >= 21 && "arm64-v8a".equals(Build.SUPPORTED_ABIS[0]); + } + public static boolean isX86System() { if (Build.CPU_ABI != null && Build.CPU_ABI.equals("x86")) { return true; @@ -122,8 +127,10 @@ public final class HardwareUtils { // See http://developer.android.com/ndk/guides/abis.html final boolean isSystemX86 = isX86System(); final boolean isSystemARM = !isSystemX86 && isARMSystem(); + final boolean isSystemARM64 = isARM64System(); boolean isAppARM = BuildConfig.ANDROID_CPU_ARCH.startsWith("armeabi-v7a"); + boolean isAppARM64 = BuildConfig.ANDROID_CPU_ARCH.startsWith("arm64-v8a"); boolean isAppX86 = BuildConfig.ANDROID_CPU_ARCH.startsWith("x86"); // Only reject known incompatible ABIs. Better safe than sorry. @@ -131,7 +138,8 @@ public final class HardwareUtils { return false; } - if ((isSystemX86 && isAppX86) || (isSystemARM && isAppARM)) { + if ((isSystemX86 && isAppX86) || (isSystemARM && isAppARM) || + (isSystemARM64 && (isAppARM64 || isAppARM))) { return true; }