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

Commit b5941a2b authored by Sunny Kapdi's avatar Sunny Kapdi Committed by Matthew Xie
Browse files

MHF: Start DIALING_OUT_TIMEOUT for correct device

When processing Dial request, start DIALING_OUT_TIMEOUT
timer for correct matching device.
Also add null check for device retrieved from
getDeviceForMessage()

Change-Id: Id9946c6b91ca1b23a24dfe408a81db25b9dfb86a
CRs-Fixed: 612278
parent a9e8c612
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -2522,7 +2522,7 @@ final class HeadsetStateMachine extends StateMachine {
        //          Get call started indication from bluetooth phone
        //          Get call started indication from bluetooth phone
        mDialingOut = true;
        mDialingOut = true;
        Message m = obtainMessage(DIALING_OUT_TIMEOUT);
        Message m = obtainMessage(DIALING_OUT_TIMEOUT);
        m.obj = device;
        m.obj = getMatchingDevice(device);
        sendMessageDelayed(m, DIALING_OUT_TIMEOUT_VALUE);
        sendMessageDelayed(m, DIALING_OUT_TIMEOUT_VALUE);
    }
    }


@@ -2573,6 +2573,9 @@ final class HeadsetStateMachine extends StateMachine {
            if (callState.mCallState ==
            if (callState.mCallState ==
                HeadsetHalConstants.CALL_STATE_DIALING) {
                HeadsetHalConstants.CALL_STATE_DIALING) {
                BluetoothDevice device = getDeviceForMessage(DIALING_OUT_TIMEOUT);
                BluetoothDevice device = getDeviceForMessage(DIALING_OUT_TIMEOUT);
                if (device == null) {
                    return;
                }
                atResponseCodeNative(HeadsetHalConstants.AT_RESPONSE_OK,
                atResponseCodeNative(HeadsetHalConstants.AT_RESPONSE_OK,
                                                       0, getByteAddress(device));
                                                       0, getByteAddress(device));
                removeMessages(DIALING_OUT_TIMEOUT);
                removeMessages(DIALING_OUT_TIMEOUT);
@@ -3061,6 +3064,9 @@ final class HeadsetStateMachine extends StateMachine {


    private void processSendClccResponse(HeadsetClccResponse clcc) {
    private void processSendClccResponse(HeadsetClccResponse clcc) {
        BluetoothDevice device = getDeviceForMessage(CLCC_RSP_TIMEOUT);
        BluetoothDevice device = getDeviceForMessage(CLCC_RSP_TIMEOUT);
        if (device == null) {
            return;
        }
        if (clcc.mIndex == 0) {
        if (clcc.mIndex == 0) {
            removeMessages(CLCC_RSP_TIMEOUT);
            removeMessages(CLCC_RSP_TIMEOUT);
        }
        }