diff options
Diffstat (limited to 'platform/android/src/style/layers/custom_layer.cpp')
-rw-r--r-- | platform/android/src/style/layers/custom_layer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/android/src/style/layers/custom_layer.cpp b/platform/android/src/style/layers/custom_layer.cpp index c0dcc24f06..f6f3bb249c 100644 --- a/platform/android/src/style/layers/custom_layer.cpp +++ b/platform/android/src/style/layers/custom_layer.cpp @@ -7,7 +7,7 @@ namespace mbgl { namespace android { - CustomLayer::CustomLayer(jni::JNIEnv& env, jni::String layerId, jni::jlong host) + CustomLayer::CustomLayer(jni::JNIEnv& env, const jni::String& layerId, jni::jlong host) : Layer(env, std::make_unique<mbgl::style::CustomLayer>( jni::Make<std::string>(env, layerId), std::unique_ptr<mbgl::style::CustomLayerHost>(reinterpret_cast<mbgl::style::CustomLayerHost*>(host))) @@ -33,22 +33,22 @@ namespace android { } } - jni::jobject* CustomLayer::createJavaPeer(jni::JNIEnv& env) { - static auto javaClass = jni::Class<CustomLayer>::Singleton(env); + jni::Local<jni::Object<Layer>> CustomLayer::createJavaPeer(jni::JNIEnv& env) { + static auto& javaClass = jni::Class<CustomLayer>::Singleton(env); static auto constructor = javaClass.GetConstructor<jni::jlong>(env); return javaClass.New(env, constructor, reinterpret_cast<jni::jlong>(this)); } void CustomLayer::registerNative(jni::JNIEnv& env) { // Lookup the class - static auto javaClass = jni::Class<CustomLayer>::Singleton(env); + static auto& javaClass = jni::Class<CustomLayer>::Singleton(env); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) // Register the peer jni::RegisterNativePeer<CustomLayer>( env, javaClass, "nativePtr", - std::make_unique<CustomLayer, JNIEnv&, jni::String, jni::jlong>, + jni::MakePeer<CustomLayer, const jni::String&, jni::jlong>, "initialize", "finalize", METHOD(&CustomLayer::update, "nativeUpdate")); |