Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 845fef7a authored by Jakub Tyszkowski's avatar Jakub Tyszkowski Committed by Automerger Merge Worker
Browse files

leaudio/testapp: Fix crash on registering callbacks am: 397f0dc8

parents 76f87ad6 397f0dc8
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -669,18 +669,30 @@ public class BluetoothProxy {
                        break;
                    case BluetoothProfile.HAP_CLIENT:
                        bluetoothHapClient = (BluetoothHapClient) bluetoothProfile;
                        try {
                            bluetoothHapClient.registerCallback(mExecutor, hapCallback);
                        } catch (IllegalArgumentException e) {
                            Log.e("HAP", "Application callback already registered.");
                        }
                        break;
                    case BluetoothProfile.LE_AUDIO_BROADCAST:
                        mBluetoothLeBroadcast = (BluetoothLeBroadcast) bluetoothProfile;
                        try {
                            mBluetoothLeBroadcast.registerCallback(mExecutor, mBroadcasterCallback);
                        } catch (IllegalArgumentException e) {
                            Log.e("Broadcast", "Application callback already registered.");
                        }
                        break;
                    case BluetoothProfile.LE_AUDIO_BROADCAST_ASSISTANT:
                        Log.d("BluetoothProxy", "LE_AUDIO_BROADCAST_ASSISTANT Service connected");
                        mBluetoothLeBroadcastAssistant = (BluetoothLeBroadcastAssistant)
                                bluetoothProfile;
                        try {
                            mBluetoothLeBroadcastAssistant.registerCallback(mExecutor,
                                mBroadcastAssistantCallback);
                        } catch (IllegalArgumentException e) {
                            Log.e("BASS", "Application callback already registered.");
                        }
                        break;
                }
                queryLeAudioDevices();