Loading android/app/jni/com_android_bluetooth_hfp.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -807,6 +807,18 @@ static jboolean configureWBSNative(JNIEnv* env, jobject object, return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE; } static jboolean setScoAllowedNative(JNIEnv* env, jobject object, jboolean value) { if (!sBluetoothHfpInterface) return JNI_FALSE; bt_status_t status = sBluetoothHfpInterface->set_sco_allowed(value == JNI_TRUE); if (status != 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}, {"initializeNative", "(IZ)V", (void*)initializeNative}, Loading @@ -832,6 +844,7 @@ static JNINativeMethod sMethods[] = { {"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) { Loading android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java +2 −0 Original line number Diff line number Diff line Loading @@ -2113,6 +2113,7 @@ final class HeadsetStateMachine extends StateMachine { public void setAudioRouteAllowed(boolean allowed) { mAudioRouteAllowed = allowed; setScoAllowedNative(allowed); } public boolean getAudioRouteAllowed() { Loading Loading @@ -3429,4 +3430,5 @@ final class HeadsetStateMachine extends StateMachine { 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); } Loading
android/app/jni/com_android_bluetooth_hfp.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -807,6 +807,18 @@ static jboolean configureWBSNative(JNIEnv* env, jobject object, return (status == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE; } static jboolean setScoAllowedNative(JNIEnv* env, jobject object, jboolean value) { if (!sBluetoothHfpInterface) return JNI_FALSE; bt_status_t status = sBluetoothHfpInterface->set_sco_allowed(value == JNI_TRUE); if (status != 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}, {"initializeNative", "(IZ)V", (void*)initializeNative}, Loading @@ -832,6 +844,7 @@ static JNINativeMethod sMethods[] = { {"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) { Loading
android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java +2 −0 Original line number Diff line number Diff line Loading @@ -2113,6 +2113,7 @@ final class HeadsetStateMachine extends StateMachine { public void setAudioRouteAllowed(boolean allowed) { mAudioRouteAllowed = allowed; setScoAllowedNative(allowed); } public boolean getAudioRouteAllowed() { Loading Loading @@ -3429,4 +3430,5 @@ final class HeadsetStateMachine extends StateMachine { 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); }