diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-01-17 13:25:27 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-01-17 13:25:27 +0100 |
commit | 7e0cc3b545a5b47a8770e55e5476e9646809a618 (patch) | |
tree | a57127d2f1e8ed14506f47f54e44f1e3028d8214 /platform/android/src/jni.cpp | |
parent | ea273d4e75f51a6cb7a6fc7573c7722e34e730f1 (diff) | |
download | qtlocation-mapboxgl-7e0cc3b545a5b47a8770e55e5476e9646809a618.tar.gz |
[android] introduce generic Peer object for JNI wrappingupstream/7743-nativepeer-defaultfilesource
Diffstat (limited to 'platform/android/src/jni.cpp')
-rwxr-xr-x | platform/android/src/jni.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/platform/android/src/jni.cpp b/platform/android/src/jni.cpp index d136766455..a4631997ad 100755 --- a/platform/android/src/jni.cpp +++ b/platform/android/src/jni.cpp @@ -9,12 +9,12 @@ #include <sys/system_properties.h> #include "jni.hpp" +#include "jni/peer.hpp" #include "java_types.hpp" #include "native_map_view.hpp" #include "connectivity_listener.hpp" #include "style/layers/layers.hpp" #include "style/sources/sources.hpp" -#include "storage/default_file_source_peer.hpp" #include "conversion/conversion.hpp" #include "conversion/collection.hpp" @@ -298,7 +298,7 @@ namespace { using namespace mbgl::android; using DebugOptions = mbgl::MapDebugOptions; -jlong nativeCreate(JNIEnv *env, jni::jobject* obj, jni::Object<DefaultFileSourcePeer> fileSource, jfloat pixelRatio, jint availableProcessors, jlong totalMemory) { +jlong nativeCreate(JNIEnv *env, jni::jobject* obj, jni::Object<Peer<mbgl::DefaultFileSource>> fileSource, jfloat pixelRatio, jint availableProcessors, jlong totalMemory) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeCreate"); return reinterpret_cast<jlong>(new NativeMapView(env, jni::Unwrap(obj), fileSource, pixelRatio, availableProcessors, totalMemory)); } @@ -1705,9 +1705,7 @@ void registerNatives(JavaVM *vm) { registerNativeLayers(env); registerNativeSources(env); ConnectivityListener::registerNative(env); - - mbgl::Log::Error(mbgl::Event::JNI, "registering DefaultFileSource peer"); - DefaultFileSourcePeer::registerNative(env); + Peer<DefaultFileSource>::RegisterNative(env); latLngClass = &jni::FindClass(env, "com/mapbox/mapboxsdk/geometry/LatLng"); latLngClass = jni::NewGlobalRef(env, latLngClass).release(); |