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

Commit b9a36edf authored by Md Shahriar Hossain Sajib's avatar Md Shahriar Hossain Sajib Committed by Gerrit Code Review
Browse files

Merge "Add new resource for time delay of CLCC polling"

parents b21e8dec be2ab20f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -125,6 +125,9 @@
    <!-- Flag whether or not to keep polling AG with CLCC for call information every 2 seconds -->
    <bool name="hfp_clcc_poll_during_call">true</bool>

    <!-- Time delay in milliseconds between consecutive polling AG with CLCC for call info -->
    <integer name="hfp_clcc_poll_interval_during_call">2000</integer>

    <!-- Package that is providing the exposure notification service -->
    <string name="exposure_notification_package">com.google.android.gms</string>

+13 −4
Original line number Diff line number Diff line
@@ -483,7 +483,9 @@ public class HeadsetClientStateMachine extends StateMachine {

        if (mCalls.size() > 0) {
            if (mService.getResources().getBoolean(R.bool.hfp_clcc_poll_during_call)) {
                sendMessageDelayed(QUERY_CURRENT_CALLS, QUERY_CURRENT_CALLS_WAIT_MILLIS);
                sendMessageDelayed(QUERY_CURRENT_CALLS,
                        mService.getResources().getInteger(
                        R.integer.hfp_clcc_poll_interval_during_call));
            } else {
                if (getCall(BluetoothHeadsetClientCall.CALL_STATE_INCOMING) != null) {
                    logD("Still have incoming call; polling");
@@ -1330,9 +1332,16 @@ public class HeadsetClientStateMachine extends StateMachine {
                    break;
                case QUERY_CURRENT_CALLS:
                    removeMessages(QUERY_CURRENT_CALLS);
                    if (mCalls.size() > 0) {
                    // If there are ongoing calls periodically check their status.
                        sendMessageDelayed(QUERY_CURRENT_CALLS, QUERY_CURRENT_CALLS_WAIT_MILLIS);
                    if (mCalls.size() > 1
                            && mService.getResources().getBoolean(
                            R.bool.hfp_clcc_poll_during_call)) {
                        sendMessageDelayed(QUERY_CURRENT_CALLS,
                                mService.getResources().getInteger(
                                R.integer.hfp_clcc_poll_interval_during_call));
                    } else if (mCalls.size() > 0) {
                        sendMessageDelayed(QUERY_CURRENT_CALLS,
                                QUERY_CURRENT_CALLS_WAIT_MILLIS);
                    }
                    queryCallsStart();
                    break;
+2 −0
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ public class HeadsetClientStateMachineTest {
                mAudioManager);
        when(mHeadsetClientService.getResources()).thenReturn(mMockHfpResources);
        when(mMockHfpResources.getBoolean(R.bool.hfp_clcc_poll_during_call)).thenReturn(true);
        when(mMockHfpResources.getInteger(R.integer.hfp_clcc_poll_interval_during_call))
                .thenReturn(2000);
        mNativeInterface = spy(NativeInterface.getInstance());

        // This line must be called to make sure relevant objects are initialized properly