Fix crash occuring when using Recognizer
The SR_RecognizerResultGetKeyList should return [Ljava/lang/String,
however the code as written before the change will actually return
[[Ljava/lang/String
This "worked" before, probably by accident, but since
dvmFindArrayClassForElement has been rewritten to no longer used a
cached arrayClass. The dvmFindArrayClassForElement actually prepends
the [ and it should not be in SR_RecognizerResultGetKeyList.
Change-Id: Ida74600f224d8a7f9906c51b1881dcb9451cc289
diff --git a/srec_jni/android_speech_srec_Recognizer.cpp b/srec_jni/android_speech_srec_Recognizer.cpp
index abaf883..e0cd0f6 100644
--- a/srec_jni/android_speech_srec_Recognizer.cpp
+++ b/srec_jni/android_speech_srec_Recognizer.cpp
@@ -503,7 +503,7 @@
}
// create String[] of keys
- jclass stringClass = env->FindClass("[Ljava/lang/String;");
+ jclass stringClass = env->FindClass("java/lang/String");
if (!stringClass) return NULL;
jobjectArray array = env->NewObjectArray(listSize, stringClass, NULL);
if (!array) return NULL;