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

Commit 01e83913 authored by Martin Brabham's avatar Martin Brabham
Browse files

Add capability to disable CLCC polling

Bug: 70660604
Change-Id: I9de50ffbcbad9f9d9cf05bdaf97a0bb445f2f461
(cherry picked from commit e8f53c02c4f809fbcf6d06842fc5ae6a6373b135)
parent 1d557b64
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -100,4 +100,7 @@
          - BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL to cancel access requests -->
    <string name="pairing_ui_package">com.android.settings</string>

    <!-- 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>

</resources>
+9 −1
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import android.os.SystemClock;
import android.support.annotation.VisibleForTesting;
import android.util.Log;
import android.util.Pair;
import com.android.bluetooth.R;

import com.android.bluetooth.Utils;
import com.android.bluetooth.btservice.AdapterService;
@@ -389,7 +390,14 @@ 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);
            } else {
                if (getCall(BluetoothHeadsetClientCall.CALL_STATE_INCOMING) != null) {
                    Log.d(TAG, "Still have incoming call; polling");
                    sendMessageDelayed(QUERY_CURRENT_CALLS, QUERY_CURRENT_CALLS_WAIT_MILLIS);
                }
            }
        }

        mCallsUpdate.clear();