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

Commit e6a9d23b authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Gerrit Code Review
Browse files

Merge "LeAudioTestApp: Add missing try catch"

parents 2c136a8f e91e9d8e
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -1075,7 +1075,11 @@ public class BluetoothProxy {
                if (scanDelegator != null) {
                    mBroadcastScanDelegatorDevices.add(scanDelegator);
                }
                try {
                    mBluetoothLeBroadcastAssistant.startSearchingForSources(new ArrayList<>());
                } catch (IllegalArgumentException e) {
                    Log.e("BluetoothProxy", " Unexpected " + e);
                }
                if (mBassEventListener != null) {
                    mBassEventListener.onScanningStateChanged(true);
                }
@@ -1084,10 +1088,14 @@ public class BluetoothProxy {
                    mBroadcastScanDelegatorDevices.remove(scanDelegator);
                }
                if (mBroadcastScanDelegatorDevices.isEmpty()) {
                    try {
                        mBluetoothLeBroadcastAssistant.stopSearchingForSources();
                        if (mBassEventListener != null) {
                            mBassEventListener.onScanningStateChanged(false);
                        }
                    } catch (IllegalArgumentException e) {
                        Log.e("BluetoothProxy", " Unexpected " + e);
                    }
                }
            }
            return true;
@@ -1098,7 +1106,12 @@ public class BluetoothProxy {
    public boolean stopBroadcastObserving() {
        if (mBluetoothLeBroadcastAssistant != null) {
            mBroadcastScanDelegatorDevices.clear();
            try {
                mBluetoothLeBroadcastAssistant.stopSearchingForSources();
            } catch (IllegalArgumentException e) {
                Log.e("BluetoothProxy", " Unexpected " + e);
            }

            if (mBassEventListener != null) {
                mBassEventListener.onScanningStateChanged(false);
            }