MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / callStringMethod

Method callStringMethod

framework/utils/Android/JniUtils.cpp:118–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116
117
118std::string JniUtils::callStringMethod(JNIEnv *env, jobject jObj, jmethodID method) {
119 if (env == nullptr || jObj == nullptr || method == nullptr) {
120 return "";
121 }
122
123 CallObjectMethod tmpGetObject(env, jObj, method);
124 auto objec = (jstring) tmpGetObject.getValue();
125 GetStringUTFChars tmpObj(env, objec);
126 char *ch_Obj = tmpObj.getChars();
127 return ch_Obj == nullptr ? "" : std::string(ch_Obj);
128}

Callers

nothing calls this directly

Calls 3

stringClass · 0.85
getCharsMethod · 0.80
getValueMethod · 0.45

Tested by

no test coverage detected