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

Commit 3f0af8be authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Return correct status for android.media.AudioRecord.read(short[]...)

This is similar to Change-Id: If43c63a4ceeb8fef98708f0d42496d2fb90a21fd

Bug: 9776374
Change-Id: I8d9e03b70ad55b4e1b3acfe26e31de8b374e2b43
parent bc668ac4
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -402,10 +402,13 @@ static jint android_media_AudioRecord_readInShortArray(JNIEnv *env, jobject thi
                                                        jshortArray javaAudioData,
                                                        jint offsetInShorts, jint sizeInShorts) {

    return (android_media_AudioRecord_readInByteArray(env, thiz,
    jint read = android_media_AudioRecord_readInByteArray(env, thiz,
                                                        (jbyteArray) javaAudioData,
                                                        offsetInShorts*2, sizeInShorts*2)
            / 2);
                                                        offsetInShorts*2, sizeInShorts*2);
    if (read > 0) {
        read /= 2;
    }
    return read;
}

// ----------------------------------------------------------------------------