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

Commit f6662eba authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Improve behavior of end call from bluetooth headset.

When ending a call from the BT headset, the existing behavior was to
unhold the background call.  Telecom already unholds the background call
which results in multiple unhold requests for the same call.
Further, the disconnected active call would also have been sent a hold
command due to a bug in CallsManager.

Test: Manual with bluetooth headset.
Bug: 117967146
Change-Id: I89d07ac25a6afb40de5c230442acfd15d3ebe140
parent 92f4c353
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -514,8 +514,6 @@ public class BluetoothPhoneServiceImpl {
                mCallsManager.disconnectCall(activeCall);
                if (ringingCall != null) {
                    mCallsManager.answerCall(ringingCall, VideoProfile.STATE_AUDIO_ONLY);
                } else if (heldCall != null) {
                    mCallsManager.unholdCall(heldCall);
                }
                return true;
            }
+1 −1
Original line number Diff line number Diff line
@@ -1714,7 +1714,7 @@ public class CallsManager extends Call.ListenerBase
        } else {
            Call activeCall = (Call) mConnectionSvrFocusMgr.getCurrentFocusCall();
            String activeCallId = null;
            if (activeCall != null) {
            if (activeCall != null && !activeCall.isLocallyDisconnecting()) {
                activeCallId = activeCall.getId();
                if (canHold(activeCall)) {
                    activeCall.hold("Swap to " + call.getId());
+2 −1
Original line number Diff line number Diff line
@@ -681,7 +681,8 @@ public class BluetoothPhoneServiceTest extends TelecomTestCase {
                CHLD_TYPE_RELEASEACTIVE_ACCEPTHELD);

        verify(mMockCallsManager).disconnectCall(eq(activeCall));
        verify(mMockCallsManager).unholdCall(eq(heldCall));
        // Call unhold will occur as part of CallsManager auto-unholding the background call on its
        // own.
        assertEquals(didProcess, true);
    }