Loading android/app/jni/com_android_bluetooth_a2dp.cpp +4 −6 Original line number Diff line number Diff line Loading @@ -399,13 +399,11 @@ static jboolean setActiveDeviceNative(JNIEnv* env, jobject object, } jbyte* addr = env->GetByteArrayElements(address, nullptr); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } RawAddress bd_addr; RawAddress bd_addr = RawAddress::kEmpty; if (addr) { bd_addr.FromOctets(reinterpret_cast<const uint8_t*>(addr)); } bt_status_t status = sBluetoothA2dpInterface->set_active_device(bd_addr); if (status != BT_STATUS_SUCCESS) { ALOGE("%s: Failed A2DP set_active_device, status: %d", __func__, status); Loading android/app/src/com/android/bluetooth/a2dp/A2dpNativeInterface.java +3 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,9 @@ public class A2dpNativeInterface { } private byte[] getByteAddress(BluetoothDevice device) { if (device == null) { return Utils.getBytesFromAddress("00:00:00:00:00:00"); } return Utils.getBytesFromAddress(device.getAddress()); } Loading android/app/src/com/android/bluetooth/a2dp/A2dpService.java +5 −0 Original line number Diff line number Diff line Loading @@ -421,6 +421,11 @@ public class A2dpService extends ProfileService { mAudioManager.setBluetoothA2dpDeviceConnectionState( previousActiveDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.A2DP); // Make sure the Active device in native layer is set to null and audio is off if (!mA2dpNativeInterface.setActiveDevice(null)) { Log.w(TAG, "setActiveDevice(null): Cannot remove active device in native " + "layer"); } } return true; } Loading Loading
android/app/jni/com_android_bluetooth_a2dp.cpp +4 −6 Original line number Diff line number Diff line Loading @@ -399,13 +399,11 @@ static jboolean setActiveDeviceNative(JNIEnv* env, jobject object, } jbyte* addr = env->GetByteArrayElements(address, nullptr); if (!addr) { jniThrowIOException(env, EINVAL); return JNI_FALSE; } RawAddress bd_addr; RawAddress bd_addr = RawAddress::kEmpty; if (addr) { bd_addr.FromOctets(reinterpret_cast<const uint8_t*>(addr)); } bt_status_t status = sBluetoothA2dpInterface->set_active_device(bd_addr); if (status != BT_STATUS_SUCCESS) { ALOGE("%s: Failed A2DP set_active_device, status: %d", __func__, status); Loading
android/app/src/com/android/bluetooth/a2dp/A2dpNativeInterface.java +3 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,9 @@ public class A2dpNativeInterface { } private byte[] getByteAddress(BluetoothDevice device) { if (device == null) { return Utils.getBytesFromAddress("00:00:00:00:00:00"); } return Utils.getBytesFromAddress(device.getAddress()); } Loading
android/app/src/com/android/bluetooth/a2dp/A2dpService.java +5 −0 Original line number Diff line number Diff line Loading @@ -421,6 +421,11 @@ public class A2dpService extends ProfileService { mAudioManager.setBluetoothA2dpDeviceConnectionState( previousActiveDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.A2DP); // Make sure the Active device in native layer is set to null and audio is off if (!mA2dpNativeInterface.setActiveDevice(null)) { Log.w(TAG, "setActiveDevice(null): Cannot remove active device in native " + "layer"); } } return true; } Loading