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

Commit cc1caaba authored by William Escande's avatar William Escande Committed by Android (Google) Code Review
Browse files

Merge "HFPC: Reject dialing when line is busy" into tm-qpr-dev

parents a7dc0e46 8ecd4704
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 */,