diff options
-rw-r--r-- | android/cpp/jni.cpp | 7 | ||||
-rw-r--r-- | gyp/mbgl-android.gypi | 3 | ||||
-rw-r--r-- | include/mbgl/android/jni.hpp | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index 0f42e2cf5f..fd92ba8f46 100644 --- a/android/cpp/jni.cpp +++ b/android/cpp/jni.cpp @@ -10,6 +10,7 @@ #include <jni.h> #include <android/native_window_jni.h> +#include <sys/system_properties.h> #include <coffeecatch/coffeejni.h> @@ -38,6 +39,7 @@ namespace android { std::string cachePath; std::string dataPath; std::string apkPath; +std::string androidRelease; jmethodID onMapChangedId = nullptr; jmethodID onFpsChangedId = nullptr; @@ -933,6 +935,11 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { return JNI_ERR; } + + char release[PROP_VALUE_MAX] = ""; + __system_property_get("ro.build.version.release", release); + androidRelease = std::string(release); + return JNI_VERSION_1_6; } diff --git a/gyp/mbgl-android.gypi b/gyp/mbgl-android.gypi index a22eaace13..0725ea3e46 100644 --- a/gyp/mbgl-android.gypi +++ b/gyp/mbgl-android.gypi @@ -5,6 +5,9 @@ 'type': 'static_library', 'standalone_static_library': 1, 'hard_dependency': 1, + 'dependencies': [ + 'version', + ], 'variables': { 'cflags_cc': [ '<@(png_cflags)', diff --git a/include/mbgl/android/jni.hpp b/include/mbgl/android/jni.hpp index 31772cf59c..883f691cb2 100644 --- a/include/mbgl/android/jni.hpp +++ b/include/mbgl/android/jni.hpp @@ -10,6 +10,7 @@ namespace android { extern std::string cachePath; extern std::string dataPath; extern std::string apkPath; +extern std::string androidRelease; extern jmethodID onMapChangedId; extern jmethodID onFpsChangedId; |