| 676 | } |
| 677 | |
| 678 | int32_t JNIHelper::CallIntMethod(jobject object, const char* strMethodName, |
| 679 | const char* strSignature, ...) { |
| 680 | int32_t i = 0; |
| 681 | if (activity_ == NULL) { |
| 682 | LOGI( |
| 683 | "JNIHelper has not been initialized. Call init() to initialize the " |
| 684 | "helper"); |
| 685 | return i; |
| 686 | } |
| 687 | |
| 688 | JNIEnv* env = AttachCurrentThread(); |
| 689 | jclass cls = env->GetObjectClass(object); |
| 690 | jmethodID mid = env->GetMethodID(cls, strMethodName, strSignature); |
| 691 | if (mid == NULL) { |
| 692 | LOGI("method ID %s, '%s' not found", strMethodName, strSignature); |
| 693 | return i; |
| 694 | } |
| 695 | va_list args; |
| 696 | va_start(args, strSignature); |
| 697 | i = env->CallIntMethodV(object, mid, args); |
| 698 | va_end(args); |
| 699 | |
| 700 | env->DeleteLocalRef(cls); |
| 701 | return i; |
| 702 | } |
| 703 | |
| 704 | bool JNIHelper::CallBooleanMethod(jobject object, const char* strMethodName, |
| 705 | const char* strSignature, ...) { |
no outgoing calls
no test coverage detected