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

Commit f76a30ec authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by Automerger Merge Worker
Browse files

Merge "Move jniGetReferent to its only user (framework)." am: a1cf11bf am:...

Merge "Move jniGetReferent to its only user (framework)." am: a1cf11bf am: ef698823 am: 1c3e4e38 am: 919eb49b am: d46e1f5a

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1437075

Change-Id: I7518562dbecaf49389f65a9288f5be234a760772
parents 9e6e2bec d46e1f5a
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -90,6 +90,12 @@ static inline int RegisterMethodsOrDie(JNIEnv* env, const char* className,
    return res;
    return res;
}
}


static inline jobject jniGetReferent(JNIEnv* env, jobject ref) {
    jclass cls = FindClassOrDie(env, "java/lang/ref/Reference");
    jmethodID get = GetMethodIDOrDie(env, cls, "get", "()Ljava/lang/Object;");
    return env->CallObjectMethod(ref, get);
}

/**
/**
 * Read the specified field from jobject, and convert to std::string.
 * Read the specified field from jobject, and convert to std::string.
 * If the field cannot be obtained, return defaultValue.
 * If the field cannot be obtained, return defaultValue.