OSDN Git Service

Fix JNI for sendDtmfNative
authorJoseph Pirozzo <pirozzoj@google.com>
Thu, 20 Apr 2017 18:30:38 +0000 (11:30 -0700)
committerJoseph Pirozzo <pirozzoj@google.com>
Thu, 20 Apr 2017 22:51:03 +0000 (15:51 -0700)
sendDtmfNative had the parameters reversed in the static function
declaration causing DTMF (dial tones durring a call) to crash the BT
stack.

Bug: 36359320
Test: Make a phonecall via HFP and tap digits, observe no crash and
proper AT+VTS commands in btsnoop_hci.log.

Change-Id: Icf66a22886bfebd6aebcf1033f59d0562c57db2f
(cherry picked from commit 39a589093e26ed58d5aa54d8793c43394c60becc)

jni/com_android_bluetooth_hfpclient.cpp

index 9ae7d85..4bb1380 100644 (file)
@@ -697,8 +697,8 @@ static jboolean retrieveSubscriberInfoNative(JNIEnv* env, jobject object,
   return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
 }
 
-static jboolean sendDtmfNative(JNIEnv* env, jobject object, jbyte code,
-                               jbyteArray address) {
+static jboolean sendDtmfNative(JNIEnv* env, jobject object, jbyteArray address,
+                               jbyte code) {
   if (!sBluetoothHfpClientInterface) return JNI_FALSE;
 
   jbyte* addr = env->GetByteArrayElements(address, NULL);