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

Commit 7b2e2f4d authored by Roshan Pius's avatar Roshan Pius Committed by Android Git Automerger
Browse files

am d989b8ac: am 5847d282: am c23d020a: am 1631929b: am 7d7cf27d: Ensure BT...

am d989b8ac: am 5847d282: am c23d020a: am 1631929b: am 7d7cf27d: Ensure BT headset state updation before connect.

* commit 'd989b8ac':
  Ensure BT headset state updation before connect.
parents f29275e2 d989b8ac
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -642,7 +642,10 @@ public final class BluetoothPhoneServiceImpl {

        int numActiveCalls = activeCall == null ? 0 : 1;
        int numHeldCalls = mCallsManager.getNumHeldCalls();
        boolean callsSwitched = (numHeldCalls == 2);
        // Intermediate state for GSM calls which are in the process of being swapped.
        // TODO: Should we be hardcoding this value to 2 or should we check if all top level calls
        //       are held?
        boolean callsPendingSwitch = (numHeldCalls == 2);

        // For conference calls which support swapping the active call within the conference
        // (namely CDMA calls) we need to expose that as a held call in order for the BT device
@@ -670,13 +673,14 @@ public final class BluetoothPhoneServiceImpl {
        }

        if (mBluetoothHeadset != null &&
                (force ||
                        (!callsPendingSwitch &&
                                (numActiveCalls != mNumActiveCalls ||
                                 numHeldCalls != mNumHeldCalls ||
                                 bluetoothCallState != mBluetoothCallState ||
                                 !TextUtils.equals(ringingAddress, mRingingAddress) ||
                                 ringingAddressType != mRingingAddressType ||
                 (heldCall != mOldHeldCall && !ignoreHeldCallChange) ||
                 force) && !callsSwitched) {
                                 (heldCall != mOldHeldCall && !ignoreHeldCallChange))))) {

            // If the call is transitioning into the alerting state, send DIALING first.
            // Some devices expect to see a DIALING state prior to seeing an ALERTING state
@@ -738,7 +742,7 @@ public final class BluetoothPhoneServiceImpl {
    private int getBluetoothCallStateForUpdate() {
        CallsManager callsManager = mCallsManager;
        Call ringingCall = mCallsManager.getRingingCall();
        Call dialingCall = mCallsManager.getDialingCall();
        Call dialingCall = mCallsManager.getOutgoingCall();

        //
        // !! WARNING !!
+4 −0
Original line number Diff line number Diff line
@@ -1128,6 +1128,10 @@ public class CallsManager extends Call.ListenerBase implements VideoProviderProx
        return count;
    }

    Call getOutgoingCall() {
        return getFirstCallWithState(OUTGOING_CALL_STATES);
    }

    Call getFirstCallWithState(int... states) {
        return getFirstCallWithState(null, states);
    }