Loading android/app/jni/com_android_bluetooth_a2dp.cpp +20 −30 Original line number Diff line number Diff line Loading @@ -33,13 +33,11 @@ static const btav_interface_t *sBluetoothA2dpInterface = NULL; static jobject mCallbacksObj = NULL; static void bta2dp_connection_state_callback(btav_connection_state_t state, bt_bdaddr_t* bd_addr) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading @@ -52,13 +50,11 @@ static void bta2dp_connection_state_callback(btav_connection_state_t state, bt_b } static void bta2dp_audio_state_callback(btav_audio_state_t state, bt_bdaddr_t* bd_addr) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading @@ -84,14 +80,13 @@ static void classInitNative(JNIEnv* env, jclass clazz) { method_onAudioStateChanged = env->GetMethodID(clazz, "onAudioStateChanged", "(I[B)V"); ALOGI("%s: succeeds", __FUNCTION__); ALOGI("%s: succeeds", __func__); } static void initNative(JNIEnv *env, jobject object) { const bt_interface_t* btInf; bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { const bt_interface_t* btInf = getBluetoothInterface(); if (btInf == NULL) { ALOGE("Bluetooth module is not loaded"); return; } Loading @@ -113,13 +108,15 @@ static void initNative(JNIEnv *env, jobject object) { return; } if ( (sBluetoothA2dpInterface = (btav_interface_t *) btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_ID)) == NULL) { sBluetoothA2dpInterface = (btav_interface_t *) btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_ID); if (sBluetoothA2dpInterface == NULL) { ALOGE("Failed to get Bluetooth A2DP Interface"); return; } if ( (status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed to initialize Bluetooth A2DP, status: %d", status); sBluetoothA2dpInterface = NULL; return; Loading @@ -127,9 +124,8 @@ static void initNative(JNIEnv *env, jobject object) { } static void cleanupNative(JNIEnv *env, jobject object) { const bt_interface_t* btInf; if ( (btInf = getBluetoothInterface()) == NULL) { const bt_interface_t* btInf = getBluetoothInterface(); if (btInf == NULL) { ALOGE("Bluetooth module is not loaded"); return; } Loading @@ -146,21 +142,17 @@ static void cleanupNative(JNIEnv *env, jobject object) { } static jboolean connectA2dpNative(JNIEnv *env, jobject object, jbyteArray address) { jbyte *addr; bt_bdaddr_t * btAddr; bt_status_t status; ALOGI("%s: sBluetoothA2dpInterface: %p", __FUNCTION__, sBluetoothA2dpInterface); ALOGI("%s: sBluetoothA2dpInterface: %p", __func__, sBluetoothA2dpInterface); if (!sBluetoothA2dpInterface) return JNI_FALSE; addr = env->GetByteArrayElements(address, NULL); btAddr = (bt_bdaddr_t *) addr; jbyte *addr = env->GetByteArrayElements(address, NULL); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } if ((status = sBluetoothA2dpInterface->connect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->connect((bt_bdaddr_t *)addr); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF connection, status: %d", status); } env->ReleaseByteArrayElements(address, addr, 0); Loading @@ -168,18 +160,16 @@ static jboolean connectA2dpNative(JNIEnv *env, jobject object, jbyteArray addres } static jboolean disconnectA2dpNative(JNIEnv *env, jobject object, jbyteArray address) { jbyte *addr; bt_status_t status; if (!sBluetoothA2dpInterface) return JNI_FALSE; addr = env->GetByteArrayElements(address, NULL); jbyte *addr = env->GetByteArrayElements(address, NULL); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } if ( (status = sBluetoothA2dpInterface->disconnect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->disconnect((bt_bdaddr_t *)addr); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF disconnection, status: %d", status); } env->ReleaseByteArrayElements(address, addr, 0); Loading android/app/jni/com_android_bluetooth_a2dp_sink.cpp +21 −36 Original line number Diff line number Diff line Loading @@ -34,13 +34,11 @@ static const btav_interface_t *sBluetoothA2dpInterface = NULL; static jobject mCallbacksObj = NULL; static void bta2dp_connection_state_callback(btav_connection_state_t state, bt_bdaddr_t* bd_addr) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading @@ -53,13 +51,11 @@ static void bta2dp_connection_state_callback(btav_connection_state_t state, bt_b } static void bta2dp_audio_state_callback(btav_audio_state_t state, bt_bdaddr_t* bd_addr) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading @@ -72,13 +68,11 @@ static void bta2dp_audio_state_callback(btav_audio_state_t state, bt_bdaddr_t* b } static void bta2dp_audio_config_callback(bt_bdaddr_t *bd_addr, uint32_t sample_rate, uint8_t channel_count) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading Loading @@ -106,14 +100,12 @@ static void classInitNative(JNIEnv* env, jclass clazz) { method_onAudioConfigChanged = env->GetMethodID(clazz, "onAudioConfigChanged", "([BII)V"); ALOGI("%s: succeeds", __FUNCTION__); ALOGI("%s: succeeds", __func__); } static void initNative(JNIEnv *env, jobject object) { const bt_interface_t* btInf; bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { const bt_interface_t* btInf = getBluetoothInterface(); if (btInf == NULL) { ALOGE("Bluetooth module is not loaded"); return; } Loading @@ -130,13 +122,15 @@ static void initNative(JNIEnv *env, jobject object) { mCallbacksObj = NULL; } if ( (sBluetoothA2dpInterface = (btav_interface_t *) btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_SINK_ID)) == NULL) { sBluetoothA2dpInterface = (btav_interface_t *) btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_SINK_ID); if (sBluetoothA2dpInterface == NULL) { ALOGE("Failed to get Bluetooth A2DP Sink Interface"); return; } if ( (status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed to initialize Bluetooth A2DP Sink, status: %d", status); sBluetoothA2dpInterface = NULL; return; Loading @@ -146,9 +140,9 @@ static void initNative(JNIEnv *env, jobject object) { } static void cleanupNative(JNIEnv *env, jobject object) { const bt_interface_t* btInf; const bt_interface_t* btInf = getBluetoothInterface(); if ( (btInf = getBluetoothInterface()) == NULL) { if (btInf == NULL) { ALOGE("Bluetooth module is not loaded"); return; } Loading @@ -165,21 +159,17 @@ static void cleanupNative(JNIEnv *env, jobject object) { } static jboolean connectA2dpNative(JNIEnv *env, jobject object, jbyteArray address) { jbyte *addr; bt_bdaddr_t * btAddr; bt_status_t status; ALOGI("%s: sBluetoothA2dpInterface: %p", __FUNCTION__, sBluetoothA2dpInterface); ALOGI("%s: sBluetoothA2dpInterface: %p", __func__, sBluetoothA2dpInterface); if (!sBluetoothA2dpInterface) return JNI_FALSE; addr = env->GetByteArrayElements(address, NULL); btAddr = (bt_bdaddr_t *) addr; jbyte *addr = env->GetByteArrayElements(address, NULL); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } if ((status = sBluetoothA2dpInterface->connect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->connect((bt_bdaddr_t *)addr); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF connection, status: %d", status); } env->ReleaseByteArrayElements(address, addr, 0); Loading @@ -187,18 +177,17 @@ static jboolean connectA2dpNative(JNIEnv *env, jobject object, jbyteArray addres } static jboolean disconnectA2dpNative(JNIEnv *env, jobject object, jbyteArray address) { jbyte *addr; bt_status_t status; if (!sBluetoothA2dpInterface) return JNI_FALSE; addr = env->GetByteArrayElements(address, NULL); jbyte *addr = env->GetByteArrayElements(address, NULL); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } if ( (status = sBluetoothA2dpInterface->disconnect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->disconnect((bt_bdaddr_t *)addr); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF disconnection, status: %d", status); } env->ReleaseByteArrayElements(address, addr, 0); Loading @@ -207,16 +196,12 @@ static jboolean disconnectA2dpNative(JNIEnv *env, jobject object, jbyteArray add static void informAudioFocusStateNative(JNIEnv *env, jobject object, jint focus_state) { if (!sBluetoothA2dpInterface) return; sBluetoothA2dpInterface->set_audio_focus_state((uint8_t) focus_state); } static void informAudioTrackGainNative(JNIEnv *env, jobject object, jfloat gain) { if (!sBluetoothA2dpInterface) return; sBluetoothA2dpInterface->set_audio_track_gain((float) gain); } static JNINativeMethod sMethods[] = { Loading Loading
android/app/jni/com_android_bluetooth_a2dp.cpp +20 −30 Original line number Diff line number Diff line Loading @@ -33,13 +33,11 @@ static const btav_interface_t *sBluetoothA2dpInterface = NULL; static jobject mCallbacksObj = NULL; static void bta2dp_connection_state_callback(btav_connection_state_t state, bt_bdaddr_t* bd_addr) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading @@ -52,13 +50,11 @@ static void bta2dp_connection_state_callback(btav_connection_state_t state, bt_b } static void bta2dp_audio_state_callback(btav_audio_state_t state, bt_bdaddr_t* bd_addr) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading @@ -84,14 +80,13 @@ static void classInitNative(JNIEnv* env, jclass clazz) { method_onAudioStateChanged = env->GetMethodID(clazz, "onAudioStateChanged", "(I[B)V"); ALOGI("%s: succeeds", __FUNCTION__); ALOGI("%s: succeeds", __func__); } static void initNative(JNIEnv *env, jobject object) { const bt_interface_t* btInf; bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { const bt_interface_t* btInf = getBluetoothInterface(); if (btInf == NULL) { ALOGE("Bluetooth module is not loaded"); return; } Loading @@ -113,13 +108,15 @@ static void initNative(JNIEnv *env, jobject object) { return; } if ( (sBluetoothA2dpInterface = (btav_interface_t *) btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_ID)) == NULL) { sBluetoothA2dpInterface = (btav_interface_t *) btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_ID); if (sBluetoothA2dpInterface == NULL) { ALOGE("Failed to get Bluetooth A2DP Interface"); return; } if ( (status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed to initialize Bluetooth A2DP, status: %d", status); sBluetoothA2dpInterface = NULL; return; Loading @@ -127,9 +124,8 @@ static void initNative(JNIEnv *env, jobject object) { } static void cleanupNative(JNIEnv *env, jobject object) { const bt_interface_t* btInf; if ( (btInf = getBluetoothInterface()) == NULL) { const bt_interface_t* btInf = getBluetoothInterface(); if (btInf == NULL) { ALOGE("Bluetooth module is not loaded"); return; } Loading @@ -146,21 +142,17 @@ static void cleanupNative(JNIEnv *env, jobject object) { } static jboolean connectA2dpNative(JNIEnv *env, jobject object, jbyteArray address) { jbyte *addr; bt_bdaddr_t * btAddr; bt_status_t status; ALOGI("%s: sBluetoothA2dpInterface: %p", __FUNCTION__, sBluetoothA2dpInterface); ALOGI("%s: sBluetoothA2dpInterface: %p", __func__, sBluetoothA2dpInterface); if (!sBluetoothA2dpInterface) return JNI_FALSE; addr = env->GetByteArrayElements(address, NULL); btAddr = (bt_bdaddr_t *) addr; jbyte *addr = env->GetByteArrayElements(address, NULL); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } if ((status = sBluetoothA2dpInterface->connect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->connect((bt_bdaddr_t *)addr); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF connection, status: %d", status); } env->ReleaseByteArrayElements(address, addr, 0); Loading @@ -168,18 +160,16 @@ static jboolean connectA2dpNative(JNIEnv *env, jobject object, jbyteArray addres } static jboolean disconnectA2dpNative(JNIEnv *env, jobject object, jbyteArray address) { jbyte *addr; bt_status_t status; if (!sBluetoothA2dpInterface) return JNI_FALSE; addr = env->GetByteArrayElements(address, NULL); jbyte *addr = env->GetByteArrayElements(address, NULL); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } if ( (status = sBluetoothA2dpInterface->disconnect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->disconnect((bt_bdaddr_t *)addr); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF disconnection, status: %d", status); } env->ReleaseByteArrayElements(address, addr, 0); Loading
android/app/jni/com_android_bluetooth_a2dp_sink.cpp +21 −36 Original line number Diff line number Diff line Loading @@ -34,13 +34,11 @@ static const btav_interface_t *sBluetoothA2dpInterface = NULL; static jobject mCallbacksObj = NULL; static void bta2dp_connection_state_callback(btav_connection_state_t state, bt_bdaddr_t* bd_addr) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading @@ -53,13 +51,11 @@ static void bta2dp_connection_state_callback(btav_connection_state_t state, bt_b } static void bta2dp_audio_state_callback(btav_audio_state_t state, bt_bdaddr_t* bd_addr) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading @@ -72,13 +68,11 @@ static void bta2dp_audio_state_callback(btav_audio_state_t state, bt_bdaddr_t* b } static void bta2dp_audio_config_callback(bt_bdaddr_t *bd_addr, uint32_t sample_rate, uint8_t channel_count) { jbyteArray addr; ALOGI("%s", __func__); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid()) return; addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); jbyteArray addr = sCallbackEnv->NewByteArray(sizeof(bt_bdaddr_t)); if (!addr) { ALOGE("Fail to new jbyteArray bd addr for connection state"); return; Loading Loading @@ -106,14 +100,12 @@ static void classInitNative(JNIEnv* env, jclass clazz) { method_onAudioConfigChanged = env->GetMethodID(clazz, "onAudioConfigChanged", "([BII)V"); ALOGI("%s: succeeds", __FUNCTION__); ALOGI("%s: succeeds", __func__); } static void initNative(JNIEnv *env, jobject object) { const bt_interface_t* btInf; bt_status_t status; if ( (btInf = getBluetoothInterface()) == NULL) { const bt_interface_t* btInf = getBluetoothInterface(); if (btInf == NULL) { ALOGE("Bluetooth module is not loaded"); return; } Loading @@ -130,13 +122,15 @@ static void initNative(JNIEnv *env, jobject object) { mCallbacksObj = NULL; } if ( (sBluetoothA2dpInterface = (btav_interface_t *) btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_SINK_ID)) == NULL) { sBluetoothA2dpInterface = (btav_interface_t *) btInf->get_profile_interface(BT_PROFILE_ADVANCED_AUDIO_SINK_ID); if (sBluetoothA2dpInterface == NULL) { ALOGE("Failed to get Bluetooth A2DP Sink Interface"); return; } if ( (status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->init(&sBluetoothA2dpCallbacks); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed to initialize Bluetooth A2DP Sink, status: %d", status); sBluetoothA2dpInterface = NULL; return; Loading @@ -146,9 +140,9 @@ static void initNative(JNIEnv *env, jobject object) { } static void cleanupNative(JNIEnv *env, jobject object) { const bt_interface_t* btInf; const bt_interface_t* btInf = getBluetoothInterface(); if ( (btInf = getBluetoothInterface()) == NULL) { if (btInf == NULL) { ALOGE("Bluetooth module is not loaded"); return; } Loading @@ -165,21 +159,17 @@ static void cleanupNative(JNIEnv *env, jobject object) { } static jboolean connectA2dpNative(JNIEnv *env, jobject object, jbyteArray address) { jbyte *addr; bt_bdaddr_t * btAddr; bt_status_t status; ALOGI("%s: sBluetoothA2dpInterface: %p", __FUNCTION__, sBluetoothA2dpInterface); ALOGI("%s: sBluetoothA2dpInterface: %p", __func__, sBluetoothA2dpInterface); if (!sBluetoothA2dpInterface) return JNI_FALSE; addr = env->GetByteArrayElements(address, NULL); btAddr = (bt_bdaddr_t *) addr; jbyte *addr = env->GetByteArrayElements(address, NULL); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } if ((status = sBluetoothA2dpInterface->connect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->connect((bt_bdaddr_t *)addr); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF connection, status: %d", status); } env->ReleaseByteArrayElements(address, addr, 0); Loading @@ -187,18 +177,17 @@ static jboolean connectA2dpNative(JNIEnv *env, jobject object, jbyteArray addres } static jboolean disconnectA2dpNative(JNIEnv *env, jobject object, jbyteArray address) { jbyte *addr; bt_status_t status; if (!sBluetoothA2dpInterface) return JNI_FALSE; addr = env->GetByteArrayElements(address, NULL); jbyte *addr = env->GetByteArrayElements(address, NULL); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } if ( (status = sBluetoothA2dpInterface->disconnect((bt_bdaddr_t *)addr)) != BT_STATUS_SUCCESS) { bt_status_t status = sBluetoothA2dpInterface->disconnect((bt_bdaddr_t *)addr); if (status != BT_STATUS_SUCCESS) { ALOGE("Failed HF disconnection, status: %d", status); } env->ReleaseByteArrayElements(address, addr, 0); Loading @@ -207,16 +196,12 @@ static jboolean disconnectA2dpNative(JNIEnv *env, jobject object, jbyteArray add static void informAudioFocusStateNative(JNIEnv *env, jobject object, jint focus_state) { if (!sBluetoothA2dpInterface) return; sBluetoothA2dpInterface->set_audio_focus_state((uint8_t) focus_state); } static void informAudioTrackGainNative(JNIEnv *env, jobject object, jfloat gain) { if (!sBluetoothA2dpInterface) return; sBluetoothA2dpInterface->set_audio_track_gain((float) gain); } static JNINativeMethod sMethods[] = { Loading