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

Commit 8044f0b8 authored by Kyunglyul Hyun's avatar Kyunglyul Hyun Committed by Łukasz Rymanowski
Browse files

Tbs: Fix error handling for the join call

Make sure to exit early from the case, when error occure on callIndex
validation.

Bug: 232902624
Bug: 233006618
Tag: #feature
Test: atest BluetoothInstrumentationTests
Change-Id: I080c7fa0baea529f40c3812c10245fd3dbd14100
parent a5c60051
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -841,6 +841,7 @@ public class TbsGeneric {

                        Map.Entry<UUID, Bearer> firstEntry = null;
                        List<ParcelUuid> parcelUuids = new ArrayList<>();
                        result = TbsGatt.CALL_CONTROL_POINT_RESULT_SUCCESS;
                        for (int callIndex : args) {
                            Map.Entry<UUID, Bearer> entry = getCallIdByIndex(callIndex);
                            if (entry == null) {
@@ -864,6 +865,10 @@ public class TbsGeneric {
                            parcelUuids.add(new ParcelUuid(entry.getKey()));
                        }

                        if (result != TbsGatt.CALL_CONTROL_POINT_RESULT_SUCCESS) {
                            break;
                        }

                        Bearer bearer = firstEntry.getValue();
                        Request request = new Request(device, parcelUuids, opcode, args[0]);
                        int requestId = mLastRequestIdAssigned + 1;