-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[android] Refactor mapview + associated classes to high-level JNI bindings #8083
Conversation
@ivovandongen, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @zugaldia and @1ec5 to be potential reviewers. |
Looking great so far! |
a654051
to
677ba1d
Compare
677ba1d
to
b8e11e2
Compare
I'm able to build
|
@tobrun Could you clean your build first and try again? Just did a fresh build without problems:
|
082630d
to
40e96c4
Compare
40e96c4
to
bb123db
Compare
|
||
void Feature::registerNative(jni::JNIEnv& env) { | ||
// Lookup the class | ||
Feature::javaClass = *jni::Class<Feature>::Find(env).NewGlobalRef(env).release(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to specify Feature::
in these static methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Saw your comments too late. Will fix this up in a follow-up pr
jni::Class<Marker> Marker::javaClass; | ||
|
||
mbgl::Point<double> Marker::getPosition(jni::JNIEnv& env, jni::Object<Marker> marker) { | ||
static auto positionField = Marker::javaClass.GetField<jni::Object<LatLng>>(env, "position"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these fields guaranteed to be the same on all threads? Can these methods be invoked on other threads?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one class definition for all threads as far as I know. The passed in env is assumed to be already attached.
Fixes #6533
Main classes: