diff --git a/build/autoconf/android.m4 b/build/autoconf/android.m4 index d689c2c32f32..c746fbd5b798 100644 --- a/build/autoconf/android.m4 +++ b/build/autoconf/android.m4 @@ -408,4 +408,34 @@ case "$target" in ;; esac +MOZ_ARG_WITH_STRING(android-min-sdk, +[ --with-android-min-sdk=[VER] Impose a minimum Firefox for Android SDK version], +[ MOZ_ANDROID_MIN_SDK_VERSION=$withval ]) + +MOZ_ARG_WITH_STRING(android-max-sdk, +[ --with-android-max-sdk=[VER] Impose a maximum Firefox for Android SDK version], +[ MOZ_ANDROID_MAX_SDK_VERSION=$withval ]) + +if test -n "$MOZ_ANDROID_MIN_SDK_VERSION"; then + if test -n "$MOZ_ANDROID_MAX_SDK_VERSION"; then + if test $MOZ_ANDROID_MAX_SDK_VERSION -lt $MOZ_ANDROID_MIN_SDK_VERSION ; then + AC_MSG_ERROR([--with-android-max-sdk must be at least the value of --with-android-min-sdk.]) + fi + fi + + if test $MOZ_ANDROID_MIN_SDK_VERSION -gt $ANDROID_TARGET_SDK ; then + AC_MSG_ERROR([--with-android-min-sdk is expected to be less than $ANDROID_TARGET_SDK]) + fi + + AC_DEFINE_UNQUOTED(MOZ_ANDROID_MIN_SDK_VERSION, $MOZ_ANDROID_MIN_SDK_VERSION) +fi + +if test -n "$MOZ_ANDROID_MAX_SDK_VERSION"; then + if test $MOZ_ANDROID_MAX_SDK_VERSION -lt $1 ; then + AC_MSG_ERROR([--with-android-max-sdk must be at least $1.]) + fi + + AC_DEFINE_UNQUOTED(MOZ_ANDROID_MAX_SDK_VERSION, $MOZ_ANDROID_MAX_SDK_VERSION) +fi + ]) diff --git a/mobile/android/confvars.sh b/mobile/android/confvars.sh index c7d3afe56985..f95aadf1d450 100644 --- a/mobile/android/confvars.sh +++ b/mobile/android/confvars.sh @@ -12,6 +12,10 @@ MOZ_BRANDING_DIRECTORY=mobile/android/branding/unofficial MOZ_OFFICIAL_BRANDING_DIRECTORY=mobile/android/branding/official # MOZ_APP_DISPLAYNAME is set by branding/configure.sh +# We support Android SDK version 9 and up by default. +# See the --enable-android-min-sdk and --enable-android-max-sdk arguments in configure.in. +MOZ_ANDROID_MIN_SDK_VERSION=9 + MOZ_SAFE_BROWSING=1 MOZ_DISABLE_CRYPTOLEGACY=1