Loading android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java +44 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.bluetooth.telephony; import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothHeadset; Loading Loading @@ -1561,5 +1562,48 @@ public class BluetoothInCallService extends InCallService { public void onPlaceCall(int requestId, UUID callId, String uri) { mBluetoothLeCallControl.requestResult(requestId, BluetoothLeCallControl.RESULT_ERROR_APPLICATION); } @Override public void onJoinCalls(int requestId, @NonNull List<UUID> callIds) { synchronized (LOCK) { Log.i(TAG, "TBS - onJoinCalls"); int result = BluetoothLeCallControl.RESULT_SUCCESS; List<UUID> alreadyJoinedCalls = new ArrayList<>(); BluetoothCall baseCallInstance = null; if (callIds.size() < 2) { Log.e(TAG, "TBS - onJoinCalls, join call number is invalid: " + callIds.size()); result = BluetoothLeCallControl.RESULT_ERROR_UNKNOWN_CALL_ID; mBluetoothLeCallControl.requestResult(requestId, result); return; } for (UUID callToJoinUuid : callIds) { BluetoothCall callToJoinInstance = mCallInfo.getCallByCallId(callToJoinUuid); /* Skip invalid and already add device */ if ((callToJoinInstance == null) || (alreadyJoinedCalls.contains(callToJoinUuid))) { continue; } /* Lets make first valid call the base call */ if (baseCallInstance == null) { baseCallInstance = callToJoinInstance; alreadyJoinedCalls.add(callToJoinUuid); continue; } baseCallInstance.conference(callToJoinInstance); alreadyJoinedCalls.add(callToJoinUuid); } if ((baseCallInstance == null) || (alreadyJoinedCalls.size() < 2)) { result = BluetoothLeCallControl.RESULT_ERROR_UNKNOWN_CALL_ID; } mBluetoothLeCallControl.requestResult(requestId, result); } } }; } android/app/tests/unit/src/com/android/bluetooth/telephony/BluetoothInCallServiceTest.java +205 −86 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
android/app/src/com/android/bluetooth/telephony/BluetoothInCallService.java +44 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.bluetooth.telephony; import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothHeadset; Loading Loading @@ -1561,5 +1562,48 @@ public class BluetoothInCallService extends InCallService { public void onPlaceCall(int requestId, UUID callId, String uri) { mBluetoothLeCallControl.requestResult(requestId, BluetoothLeCallControl.RESULT_ERROR_APPLICATION); } @Override public void onJoinCalls(int requestId, @NonNull List<UUID> callIds) { synchronized (LOCK) { Log.i(TAG, "TBS - onJoinCalls"); int result = BluetoothLeCallControl.RESULT_SUCCESS; List<UUID> alreadyJoinedCalls = new ArrayList<>(); BluetoothCall baseCallInstance = null; if (callIds.size() < 2) { Log.e(TAG, "TBS - onJoinCalls, join call number is invalid: " + callIds.size()); result = BluetoothLeCallControl.RESULT_ERROR_UNKNOWN_CALL_ID; mBluetoothLeCallControl.requestResult(requestId, result); return; } for (UUID callToJoinUuid : callIds) { BluetoothCall callToJoinInstance = mCallInfo.getCallByCallId(callToJoinUuid); /* Skip invalid and already add device */ if ((callToJoinInstance == null) || (alreadyJoinedCalls.contains(callToJoinUuid))) { continue; } /* Lets make first valid call the base call */ if (baseCallInstance == null) { baseCallInstance = callToJoinInstance; alreadyJoinedCalls.add(callToJoinUuid); continue; } baseCallInstance.conference(callToJoinInstance); alreadyJoinedCalls.add(callToJoinUuid); } if ((baseCallInstance == null) || (alreadyJoinedCalls.size() < 2)) { result = BluetoothLeCallControl.RESULT_ERROR_UNKNOWN_CALL_ID; } mBluetoothLeCallControl.requestResult(requestId, result); } } }; }
android/app/tests/unit/src/com/android/bluetooth/telephony/BluetoothInCallServiceTest.java +205 −86 File changed.Preview size limit exceeded, changes collapsed. Show changes