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

Commit b143b491 authored by Joseph Pirozzo's avatar Joseph Pirozzo Committed by Gerrit Code Review
Browse files

Merge "Support call waiting/call swap on single phone."

parents 1a7c0434 2cc339ea
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -650,7 +650,7 @@ public class HeadsetClientService extends ProfileService {
        synchronized (this) {
            for (Map.Entry<BluetoothDevice, HeadsetClientStateMachine> entry :
                    mStateMachineMap.entrySet()) {
                if (entry.getValue() == null) {
                if (entry.getValue() == null || entry.getKey().equals(device)) {
                    continue;
                }
                int connectionState = entry.getValue().getConnectionState(entry.getKey());
@@ -658,12 +658,13 @@ public class HeadsetClientService extends ProfileService {
                    Log.d(TAG, "Accepting a call on device " + device
                                    + ". Possibly disconnecting on " + entry.getValue());
                }
                if (connectionState == BluetoothProfile.STATE_CONNECTED)
                if (connectionState == BluetoothProfile.STATE_CONNECTED) {
                    entry.getValue()
                            .obtainMessage(HeadsetClientStateMachine.TERMINATE_CALL)
                            .sendToTarget();
                }
            }
        }
        HeadsetClientStateMachine sm = getStateMachine(device);
        if (sm == null) {
            Log.e(TAG, "Cannot allocate SM for device " + device);
+0 −5
Original line number Diff line number Diff line
@@ -559,11 +559,6 @@ public class HeadsetClientStateMachine extends StateMachine {
            action = HeadsetClientHalConstants.CALL_ACTION_CHLD_2;
        }

        // Set HFP enable to false in case the call is being held to accept a cellular call. This
        // allows the cellular call's audio to be correctly routed.
        Log.d(TAG,"hfp_enable=false");
        mAudioManager.setParameters("hfp_enable=false");

        if (NativeInterface.handleCallActionNative(getByteAddress(mCurrentDevice), action, 0)) {
            addQueuedAction(HOLD_CALL, action);
        } else {