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

Commit 6f80b3c3 authored by Hall Liu's avatar Hall Liu
Browse files

Send updateHeadsetPhoneState when child calls change

In BluetoothPhoneService, don't debounce the notification of the state
change if the number of child calls change. It might take a while before
children are added to a conference, so we should inform the headset that
something changed so that it'll actually pick up on the child calls.

Change-Id: Ia7d458556cf8ec96293a677076c58dcaab0d7387
Test: manual
Fixes: 64041266
parent bc7f1814
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ public class BluetoothPhoneServiceImpl {

    private int mNumActiveCalls = 0;
    private int mNumHeldCalls = 0;
    private int mNumChildrenOfActiveCall = 0;
    private int mBluetoothCallState = CALL_STATE_IDLE;
    private String mRingingAddress = null;
    private int mRingingAddressType = 0;
@@ -710,6 +711,8 @@ public class BluetoothPhoneServiceImpl {

        int numActiveCalls = activeCall == null ? 0 : 1;
        int numHeldCalls = mCallsManager.getNumHeldCalls();
        int numChildrenOfActiveCall = activeCall == null ? 0 : activeCall.getChildCalls().size();

        // 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?
@@ -744,6 +747,7 @@ public class BluetoothPhoneServiceImpl {
                (force ||
                        (!callsPendingSwitch &&
                                (numActiveCalls != mNumActiveCalls ||
                                        numChildrenOfActiveCall != mNumChildrenOfActiveCall ||
                                        numHeldCalls != mNumHeldCalls ||
                                        bluetoothCallState != mBluetoothCallState ||
                                        !TextUtils.equals(ringingAddress, mRingingAddress) ||
@@ -758,6 +762,7 @@ public class BluetoothPhoneServiceImpl {

            mOldHeldCall = heldCall;
            mNumActiveCalls = numActiveCalls;
            mNumChildrenOfActiveCall = numChildrenOfActiveCall;
            mNumHeldCalls = numHeldCalls;
            mBluetoothCallState = bluetoothCallState;
            mRingingAddress = ringingAddress;