diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-10-04 11:56:26 +0300 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-10-04 13:18:23 +0300 |
commit | 198e3453394ccb2b1f7db72d1858cfd18e302a1e (patch) | |
tree | daff6ffd927fe6aa904b07970da91f869fe2fdc0 /platform/android/src/mapbox.cpp | |
parent | 946b9d22818c76325ce6f5bf4804494f461f2c0a (diff) | |
download | qtlocation-mapboxgl-198e3453394ccb2b1f7db72d1858cfd18e302a1e.tar.gz |
[android] Check if Mapbox instance exists before creating default file source
This check is needed for mbgl-benchmark target, as it does not require Mapbox
instance, nor Android asset manager.
Diffstat (limited to 'platform/android/src/mapbox.cpp')
-rw-r--r-- | platform/android/src/mapbox.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/android/src/mapbox.cpp b/platform/android/src/mapbox.cpp index c835518b42..5246739cf6 100644 --- a/platform/android/src/mapbox.cpp +++ b/platform/android/src/mapbox.cpp @@ -9,6 +9,12 @@ jni::Local<jni::Object<AssetManager>> Mapbox::getAssetManager(jni::JNIEnv& env) return javaClass.Call(env, method); } +jboolean Mapbox::hasInstance(jni::JNIEnv& env) { + static auto& javaClass = jni::Class<Mapbox>::Singleton(env); + auto method = javaClass.GetStaticMethod<jboolean()>(env, "hasInstance"); + return javaClass.Call(env, method); +} + void Mapbox::registerNative(jni::JNIEnv& env) { jni::Class<Mapbox>::Singleton(env); } |