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

Commit 397f0dc8 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski Committed by Grzegorz Kołodziejczyk
Browse files

leaudio/testapp: Fix crash on registering callbacks

Bug: 230340466
Tag: #feature
Sponsor: jpawlowski@
Test: atest LeAudioBroadcastServiceTest
Change-Id: I28a371af6b1f6f052bfc03d972c358f5c5427ce0
Merged-In: I28a371af6b1f6f052bfc03d972c358f5c5427ce0
(cherry picked from commit 71ef3f12)
parent 3f4af021
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();