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

Commit 2e6b2ad9 authored by Chen Chen's avatar Chen Chen
Browse files

BluetoothInCallService: check PROPERTY_GENERIC_CONFERENCE before PROPERTY_GENERIC_CONFERENCE

Bug: 187386219
Test: atest BluetoothInstrumentationTests
Phone call experience maually tested by testers
Change-Id: If50f874076df9da9c7ca1cb3e58ccc1a54097b58
parent 3691df5c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -305,4 +305,8 @@ public class BluetoothCall {
        }
        return result;
    }

    public boolean hasProperty(int property) {
        return getDetails().hasProperty(property);
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -592,7 +592,8 @@ public class BluetoothInCallService extends InCallService {
        }

        BluetoothCall conferenceCall = getBluetoothCallById(call.getParentId());
        if (!mCallInfo.isNullCall(conferenceCall)) {
        if (!mCallInfo.isNullCall(conferenceCall)
                && conferenceCall.hasProperty(Call.Details.PROPERTY_GENERIC_CONFERENCE)) {
            isPartOfConference = true;

            // Run some alternative states for Conference-level merge/swap support.
+3 −0
Original line number Diff line number Diff line
@@ -379,6 +379,7 @@ public class BluetoothInCallServiceTest {
        Integer parentId = parentCall.getId();
        when(foregroundCall.getParentId()).thenReturn(parentId);
        when(heldCall.getParentId()).thenReturn(parentId);
        when(parentCall.hasProperty(Call.Details.PROPERTY_GENERIC_CONFERENCE)).thenReturn(true);

        clearInvocations(mMockBluetoothHeadset);
        mBluetoothInCallService.listCurrentCalls();
@@ -425,6 +426,7 @@ public class BluetoothInCallServiceTest {
        Integer parentId = parentCall.getId();
        when(confCall1.getParentId()).thenReturn(parentId);
        when(confCall2.getParentId()).thenReturn(parentId);
        when(parentCall.hasProperty(Call.Details.PROPERTY_GENERIC_CONFERENCE)).thenReturn(true);

        clearInvocations(mMockBluetoothHeadset);
        mBluetoothInCallService.listCurrentCalls();
@@ -642,6 +644,7 @@ public class BluetoothInCallServiceTest {
        when(parentCall.getState()).thenReturn(Call.STATE_HOLDING);
        when(childCall1.getState()).thenReturn(Call.STATE_ACTIVE);
        when(childCall2.getState()).thenReturn(Call.STATE_ACTIVE);
        when(parentCall.hasProperty(Call.Details.PROPERTY_GENERIC_CONFERENCE)).thenReturn(true);

        when(parentCall.isIncoming()).thenReturn(true);
        when(mMockCallInfo.getBluetoothCalls()).thenReturn(calls);