Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b71861cd authored by Jerome Gaillard's avatar Jerome Gaillard
Browse files

Add arguments to native methods required for host builds

Critical methods need to have CRITICAL_JNI_PARAMS(_COMMA) added to their
list of arguments to ensure they work on host JVM as well as ART.

Bug: 179113771
Test: lunch sdk && m libandroid_runtime
Change-Id: I7ae9d37b2b9e3426f37113ad5d9b1bb946c219cb
parent 015c5af3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ static jlong Font_getBufferAddress(CRITICAL_JNI_PARAMS_COMMA jlong fontPtr) {
}

// Critical Native
static jlong Font_getReleaseNativeFontFunc() {
static jlong Font_getReleaseNativeFontFunc(CRITICAL_JNI_PARAMS) {
    return reinterpret_cast<jlong>(releaseFont);
}

+2 −2
Original line number Diff line number Diff line
@@ -101,13 +101,13 @@ static jint FontFamily_getVariant(CRITICAL_JNI_PARAMS_COMMA jlong familyPtr) {
}

// CriticalNative
static jint FontFamily_getFontSize(jlong familyPtr) {
static jint FontFamily_getFontSize(CRITICAL_JNI_PARAMS_COMMA jlong familyPtr) {
    FontFamilyWrapper* family = reinterpret_cast<FontFamilyWrapper*>(familyPtr);
    return family->family->getNumFonts();
}

// CriticalNative
static jlong FontFamily_getFont(jlong familyPtr, jint index) {
static jlong FontFamily_getFont(CRITICAL_JNI_PARAMS_COMMA jlong familyPtr, jint index) {
    FontFamilyWrapper* family = reinterpret_cast<FontFamilyWrapper*>(familyPtr);
    std::shared_ptr<minikin::Font> font = family->family->getFontRef(index);
    return reinterpret_cast<jlong>(new FontWrapper(std::move(font)));