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

Commit 73510d4d authored by Josh Wu's avatar Josh Wu Committed by William Escande
Browse files

HFPC: Reject dialing when line is busy

Add a systemProperties to disable it only on watch

Test: atest BluetoothInstrumentationTests
Bug: 239755059
Bug: 263323082
Change-Id: Ie32ea5ac5468a7373381212af4d9f6c6ee1ee718
(cherry picked from commit 678b6250a592e960dd7ec57b3b5efdfee8836628)
parent 956fab86
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.os.BatteryManager;
import android.os.Bundle;
import android.os.HandlerThread;
import android.os.Message;
import android.os.SystemProperties;
import android.sysprop.BluetoothProperties;
import android.util.Log;

@@ -1128,6 +1129,14 @@ public class HeadsetClientService extends ProfileService {
            return null;
        }

        // Some platform does not support three way calling (ex: watch)
        final boolean support_three_way_calling = SystemProperties
                .getBoolean("bluetooth.headset_client.three_way_calling.enabled", true);
        if (!support_three_way_calling && !getCurrentCalls(device).isEmpty()) {
            Log.e(TAG, String.format("dial(%s): Line is busy, reject dialing", device));
            return null;
        }

        HfpClientCall call = new HfpClientCall(device,
                HeadsetClientStateMachine.HF_ORIGINATED_CALL_ID,
                HfpClientCall.CALL_STATE_DIALING, number, false  /* multiparty */,