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

Commit f36e67b0 authored by Gaurav Asati's avatar Gaurav Asati Committed by Linux Build Service Account
Browse files

Bluetooth: Call API with empty string.

 - In case of redial null was sent from apps,
   due to NULL checks in JNI there was exception
   generated while calling stack API.Call stack
   API with empty string instead of null.

CRs-Fixed: 911108
Change-Id: Iedeb8a700a46145b250985b3f850f992dddcedc6
parent f1f18679
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -509,9 +509,16 @@ static jboolean dialNative(JNIEnv *env, jobject object, jstring number_str) {
        number = env->GetStringUTFChars(number_str, NULL);
    }

    if (number != NULL) {
        if ( (status = sBluetoothHfpClientInterface->dial(number)) != BT_STATUS_SUCCESS) {
            ALOGE("Failed to dial, status: %d", status);
        }
    } else {
        if ( (status = sBluetoothHfpClientInterface->dial("")) != BT_STATUS_SUCCESS) {
            ALOGE("Failed to dial, status: %d", status);
        }
    }

    if (number != NULL) {
        env->ReleaseStringUTFChars(number_str, number);
    }