| 865 | } |
| 866 | |
| 867 | vector<string> CallbackHandlers::GetTypeMetadata(const string &name, int index) { |
| 868 | JEnv env; |
| 869 | |
| 870 | string canonicalName = Util::ConvertFromJniToCanonicalName(name); |
| 871 | |
| 872 | JniLocalRef className(env.NewStringUTF(canonicalName.c_str())); |
| 873 | jint idx = index; |
| 874 | |
| 875 | JniLocalRef pubApi( |
| 876 | env.CallStaticObjectMethod(RUNTIME_CLASS, GET_TYPE_METADATA, (jstring) className, idx)); |
| 877 | |
| 878 | jsize length = env.GetArrayLength(pubApi); |
| 879 | |
| 880 | assert(length > 0); |
| 881 | |
| 882 | vector<string> result; |
| 883 | |
| 884 | for (jsize i = 0; i < length; i++) { |
| 885 | JniLocalRef s(env.GetObjectArrayElement(pubApi, i)); |
| 886 | const char *pc = env.GetStringUTFChars(s, nullptr); |
| 887 | result.push_back(string(pc)); |
| 888 | env.ReleaseStringUTFChars(s, pc); |
| 889 | } |
| 890 | |
| 891 | return result; |
| 892 | } |
| 893 | |
| 894 | Local<Value> CallbackHandlers::CallJSMethod(Isolate *isolate, JNIEnv *_env, |
| 895 | const Local<Object> &jsObject, const string &methodName, |
nothing calls this directly
no test coverage detected