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

Commit d61d29c2 authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "Add system properties to config headsetclient behaviors" am: 754e2be8...

Merge "Add system properties to config headsetclient behaviors" am: 754e2be8 am: d75df3f0 am: 4225abfc am: 05b17779

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2444899



Change-Id: I9cb68c0d124cd4a53b69e3daa2af5cd3f5a19923
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d67de27c 05b17779
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -186,6 +186,8 @@ public class HeadsetClientStateMachine extends StateMachine {
    // Indicates whether audio can be routed to the device
    private boolean mAudioRouteAllowed;

    private final boolean mClccPollDuringCall;

    private static final int CALL_AUDIO_POLICY_FEATURE_ID = 1;

    public int mAudioPolicyRemoteSupported;
@@ -552,7 +554,7 @@ public class HeadsetClientStateMachine extends StateMachine {
            // a valid call on the phone. The polling would at most continue until
            // OUTGOING_TIMEOUT_MILLI. This handles the potential scenario where the phone creates
            // and terminates a call before the first QUERY_CURRENT_CALLS completes.
            if (mService.getResources().getBoolean(R.bool.hfp_clcc_poll_during_call)
            if (mClccPollDuringCall
                    || (mCalls.containsKey(HF_ORIGINATED_CALL_ID))) {
                sendMessageDelayed(QUERY_CURRENT_CALLS,
                        mService.getResources().getInteger(
@@ -886,6 +888,13 @@ public class HeadsetClientStateMachine extends StateMachine {
        mAudioRouteAllowed = context.getResources().getBoolean(
            R.bool.headset_client_initial_audio_route_allowed);

        mAudioRouteAllowed = SystemProperties.getBoolean(
            "bluetooth.headset_client.initial_audio_route.enabled", mAudioRouteAllowed);

        mClccPollDuringCall = SystemProperties.getBoolean(
            "bluetooth.hfp.clcc_poll_during_call.enabled",
            mService.getResources().getBoolean(R.bool.hfp_clcc_poll_during_call));

        mHsClientAudioPolicy = new BluetoothSinkAudioPolicy.Builder().build();
        mConnectingTimePolicyProperty = getAudioPolicySystemProp(
            "bluetooth.headset_client.audio_policy.connecting_time.config");
@@ -1510,10 +1519,12 @@ public class HeadsetClientStateMachine extends StateMachine {
                    break;
                case QUERY_CURRENT_CALLS:
                    removeMessages(QUERY_CURRENT_CALLS);
                    if (DBG) {
                        Log.d(TAG, "mClccPollDuringCall=" + mClccPollDuringCall);
                    }
                    // If there are ongoing calls periodically check their status.
                    if (mCalls.size() > 1
                            && mService.getResources().getBoolean(
                            R.bool.hfp_clcc_poll_during_call)) {
                            && mClccPollDuringCall) {
                        sendMessageDelayed(QUERY_CURRENT_CALLS,
                                mService.getResources().getInteger(
                                R.integer.hfp_clcc_poll_interval_during_call));