-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create StarboardBridge native class with jni_generator #4545
Conversation
84430a4
to
73034db
Compare
2611aed
to
87fa6c1
Compare
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.
Hey Hao, I'm not sure if the PR is ready for review yet since the description has WIP. Ping me when you need reviews.
c2faad2
to
4f85854
Compare
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.
This is a nice first step. Can you put a comment in PR or in the FR about the next steps?
cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java
Outdated
Show resolved
Hide resolved
cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java
Show resolved
Hide resolved
cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java
Show resolved
Hide resolved
12b814a
to
654b9ba
Compare
This reverts commit 4580609.
b/372559388 This PR configures jni_generator for cobalt_apk_java. It creates the corresponding native class StarboardBridge for cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java, adhering to Chromium's JNI standards. The StarboardBridge native class is implemented as a singleton and is initialized with the same JNIEnv and jobject used when calling the Starboard custom JniEnvExt::Initialize function. Additionally, it updates the JNI function calls in starboard/android/shared/application_android.cc to align with Chromium's modern JNI standards. This PR amends the reverted PR #4545 There was an issue in the reverted PR that there are old annotations @UsedByNative embeded in the inner function calls in getResourceOverlay, somehow making the app not able to launch.. Culprit -> https://github.com/youtube/cobalt/pull/4545/files#diff-22285847addbd15025f71dadd357129f86573e042655067048f94fae301fb1d3R480. We can not blindly replace @UsedByNative with @CalledByNative, when switching to @CalledByNative, we should make sure to replace all occurrence of @UserByNative inside, and implement the new JNI template functions. I don't get why compiler didn't complain about the getResourceOverlay issue tho.
b/372559388
This PR configures jni_generator for cobalt_apk_java.
It creates the corresponding native class StarboardBridge for cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java, adhering to Chromium's JNI standards.
The StarboardBridge native class is implemented as a singleton and is initialized with the same JNIEnv and jobject used when calling the Starboard custom JniEnvExt::Initialize function.
Additionally, it updates the JNI function calls in starboard/android/shared/application_android.cc to align with Chromium's modern JNI standards.