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

Commit fb0b1a4b authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Merge "Send proper call state in CLCC in an IMS conference"

am: fca12b76

Change-Id: I14fb5aa1949ea4d76ddaf69292de996966fd0991
parents e4ecf59c fca12b76
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();