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

Commit 6fccadb9 authored by Hall Liu's avatar Hall Liu
Browse files

Send proper call state in CLCC in an IMS conference

When sending the calls that are part of a held IMS conference with CEP
enabled, send the state of the calls as held rather than active.

Change-Id: Icea894670e4c74754c72e0677dcb781904bad878
Fixes: 33819217
Test: manual, added unit test
parent 115c06ee
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -615,6 +615,12 @@ public class BluetoothPhoneServiceImpl {
                    }
                }
            }
            if (conferenceCall.getState() == CallState.ON_HOLD &&
                    conferenceCall.can(Connection.CAPABILITY_MANAGE_CONFERENCE)) {
                // If the parent IMS CEP conference call is on hold, we should mark this call as
                // being on hold regardless of what the other children are doing.
                state = CALL_STATE_HELD;
            }
        } else if (isConferenceWithNoChildren) {
            // Handle the special case of an IMS conference call without conference event package
            // support.  The call will be marked as a conference, but the conference will not have
+30 −0
Original line number Diff line number Diff line
@@ -540,6 +540,36 @@ public class BluetoothPhoneServiceTest extends TelecomTestCase {
        verify(mMockBluetoothHeadset).clccResponse(0, 0, 0, 0, false, null, 0);
    }

    @MediumTest
    public void testListCurrentCallsHeldImsCepConference() throws Exception {
        ArrayList<Call> calls = new ArrayList<>();
        Call parentCall = createHeldCall();
        Call childCall1 = createActiveCall();
        Call childCall2 = createActiveCall();
        calls.add(parentCall);
        calls.add(childCall1);
        calls.add(childCall2);
        addCallCapability(parentCall, Connection.CAPABILITY_MANAGE_CONFERENCE);
        when(childCall1.getParentCall()).thenReturn(parentCall);
        when(childCall2.getParentCall()).thenReturn(parentCall);

        when(parentCall.isConference()).thenReturn(true);
        when(parentCall.getState()).thenReturn(CallState.ON_HOLD);
        when(childCall1.getState()).thenReturn(CallState.ACTIVE);
        when(childCall2.getState()).thenReturn(CallState.ACTIVE);

        when(parentCall.isIncoming()).thenReturn(true);
        when(mMockCallsManager.getCalls()).thenReturn(calls);

        mBluetoothPhoneService.mBinder.listCurrentCalls();

        verify(mMockBluetoothHeadset).clccResponse(eq(1), eq(0), eq(CALL_STATE_HELD), eq(0),
                eq(true), (String) isNull(), eq(-1));
        verify(mMockBluetoothHeadset).clccResponse(eq(2), eq(0), eq(CALL_STATE_HELD), eq(0),
                eq(true), (String) isNull(), eq(-1));
        verify(mMockBluetoothHeadset).clccResponse(0, 0, 0, 0, false, null, 0);
    }

    @MediumTest
    public void testQueryPhoneState() throws Exception {
        Call ringingCall = createRingingCall();