return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
}
+static jboolean setScoAllowedNative(JNIEnv *env, jobject object, jboolean value) {
+ bt_status_t status;
+
+ if (!sBluetoothHfpInterface) return JNI_FALSE;
+
+ if ((status = sBluetoothHfpInterface->set_sco_allowed(
+ value == JNI_TRUE)) != BT_STATUS_SUCCESS) {
+ ALOGE("Failed HF set sco allowed, status: %d", status);
+ }
+ return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE;
+}
static JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void *) classInitNative},
{"clccResponseNative", "(IIIIZLjava/lang/String;I[B)Z", (void *) clccResponseNative},
{"phoneStateChangeNative", "(IIILjava/lang/String;I)Z", (void *) phoneStateChangeNative},
{"configureWBSNative", "([BI)Z", (void *) configureWBSNative},
+ {"setScoAllowedNative", "(Z)Z", (void *) setScoAllowedNative},
};
int register_com_android_bluetooth_hfp(JNIEnv* env)
public void setAudioRouteAllowed(boolean allowed) {
mAudioRouteAllowed = allowed;
+ setScoAllowedNative(allowed);
}
public boolean getAudioRouteAllowed() {
private native boolean phoneStateChangeNative(int numActive, int numHeld, int callState,
String number, int type);
private native boolean configureWBSNative(byte[] address,int condec_config);
+ private native boolean setScoAllowedNative(boolean value);
}