diff options
author | Sumit Bajpai <sbajpai@codeaurora.org> | 2015-06-09 18:58:47 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:25:52 -0600 |
commit | aa20b98ddb70c4377b1b07405123f117d7477889 (patch) | |
tree | 4c2c53d60f19723e1305cf89801ebfff8819170f /jni | |
parent | e9b5ace257010e5b6dc325159a980f09a6437630 (diff) | |
download | android_packages_apps_Bluetooth-aa20b98ddb70c4377b1b07405123f117d7477889.tar.gz android_packages_apps_Bluetooth-aa20b98ddb70c4377b1b07405123f117d7477889.tar.bz2 android_packages_apps_Bluetooth-aa20b98ddb70c4377b1b07405123f117d7477889.zip |
BT:[3/3] Send VSC to SOC for VOIP connectivity network type.
- Get Connectivity Manager instance to find current active network
when VOIP requests BT app to create SCO.
- If active connectivity network is WIFI, update same to SOC
via vendor specific command before sending SCO request for VOIP
CRs-Fixed: 821566
Change-Id: I5835e71b533e00a6e4b82607b10657ef311877ae
Diffstat (limited to 'jni')
-rw-r--r-- | jni/com_android_bluetooth_hfp.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/jni/com_android_bluetooth_hfp.cpp b/jni/com_android_bluetooth_hfp.cpp index 8ec590c7c..0c4e12ce6 100644 --- a/jni/com_android_bluetooth_hfp.cpp +++ b/jni/com_android_bluetooth_hfp.cpp @@ -915,6 +915,20 @@ static jboolean bindStringResponseNative(JNIEnv *env, jobject object, jstring re return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE; } +static jboolean voipNetworkWifiInfoNative(JNIEnv *env, jobject object, + jboolean isVoipStarted, jboolean isNetworkWifi) { + bt_status_t status; + if (!sBluetoothHfpInterface) return JNI_FALSE; + + if ( (status = sBluetoothHfpInterface->voip_network_type_wifi(isVoipStarted ? + BTHF_VOIP_STATE_STARTED : BTHF_VOIP_STATE_STOPPED, isNetworkWifi ? + BTHF_VOIP_CALL_NETWORK_TYPE_WIFI : BTHF_VOIP_CALL_NETWORK_TYPE_MOBILE)) + != BT_STATUS_SUCCESS) { + ALOGE("Failed sending VOIP network type, status: %d", status); + } + return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE; +} + static JNINativeMethod sMethods[] = { {"classInitNative", "()V", (void *) classInitNative}, {"initializeNative", "(I)V", (void *) initializeNative}, @@ -935,7 +949,8 @@ static JNINativeMethod sMethods[] = { {"phoneStateChangeNative", "(IIILjava/lang/String;I)Z", (void *) phoneStateChangeNative}, {"configureWBSNative", "([BI)Z", (void *) configureWBSNative}, {"bindResponseNative", "(IZ[B)Z", (void *)bindResponseNative}, - {"bindStringResponseNative", "(Ljava/lang/String;[B)Z", (void *)bindStringResponseNative} + {"bindStringResponseNative", "(Ljava/lang/String;[B)Z", (void *)bindStringResponseNative}, + {"voipNetworkWifiInfoNative", "(ZZ)Z", (void *)voipNetworkWifiInfoNative} }; int register_com_android_bluetooth_hfp(JNIEnv* env) |