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

Commit 272c4647 authored by Rahul Arya's avatar Rahul Arya
Browse files

Fix CDMA conference active call inference

The special logic here is only needed for CDMA calls, since they don't
let us see what the active call is directly. But the rest of the logic
should be used for all conference calls. So move the CDMA-specific check
to gate just the relevant part.

Bug: 234629992
Test: manual + BluetoothInCallServiceTest
Tag: #stability

Change-Id: I43e50d5e672ec0cb9ab41445f79d60b9e5a567cd
parent 7bb4b030
Loading
Loading
Loading
Loading
+30 −28
Original line number Diff line number Diff line
@@ -713,11 +713,11 @@ public class BluetoothInCallService extends InCallService {
        }

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

            // Run some alternative states for Conference-level merge/swap support.
            if (conferenceCall.hasProperty(Call.Details.PROPERTY_GENERIC_CONFERENCE)) {
                // Run some alternative states for CDMA Conference-level merge/swap support.
                // Basically, if BluetoothCall supports swapping or merging at the conference-level,
                // then we need to expose the calls as having distinct states
                // (ACTIVE vs CAPABILITY_HOLD) or
@@ -726,7 +726,8 @@ public class BluetoothInCallService extends InCallService {
                // Before doing any special logic, ensure that we are dealing with an
                // ACTIVE BluetoothCall and that the conference itself has a notion of
                // the current "active" child call.
            BluetoothCall activeChild = getBluetoothCallById(
                BluetoothCall activeChild =
                        getBluetoothCallById(
                                conferenceCall.getGenericConferenceActiveChildCallId());
                if (state == CALL_STATE_ACTIVE && !mCallInfo.isNullCall(activeChild)) {
                    // Reevaluate state if we can MERGE or if we can SWAP without previously having
@@ -741,12 +742,13 @@ public class BluetoothInCallService extends InCallService {
                        if (call == activeChild) {
                            state = CALL_STATE_ACTIVE;
                        } else {
                        // At this point we know there is an "active" child and we know that it is
                        // not this call, so set it to HELD instead.
                            // At this point we know there is an "active" child and we know that it
                            // is not this call, so set it to HELD instead.
                            state = CALL_STATE_HELD;
                        }
                    }
                }
            }
            if (conferenceCall.getState() == Call.STATE_HOLDING
                    && conferenceCall.can(Connection.CAPABILITY_MANAGE_CONFERENCE)) {
                // If the parent IMS CEP conference BluetoothCall is on hold, we should mark