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

Commit 8042ee7a authored by Chen Chen's avatar Chen Chen
Browse files

Add warning message when sending clcc response but mBluetoothHeadset is null

Bug: 187494941
Test: Build
Change-Id: Iedadbb92e4c951e3a26a8f68cc6df5dbbd2f4d92
parent 72381471
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import android.text.TextUtils;
import android.util.Log;

import com.android.bluetooth.hfp.BluetoothHeadsetProxy;
import com.android.bluetooth.hfp.HeadsetService;

import androidx.annotation.VisibleForTesting;

@@ -650,7 +651,14 @@ public class BluetoothInCallService extends InCallService {
                            + addressType);
        }

        if (mBluetoothHeadset != null) {
        if (mBluetoothHeadset == null) {
            Log.w(TAG, "mBluetoothHeasdset is null when sending clcc for BluetoothCall "
                    + index + ", "
                    + direction + ", "
                    + state + ", "
                    + isPartOfConference + ", "
                    + addressType);
        } else {
            mBluetoothHeadset.clccResponse(
                    index, direction, state, 0, isPartOfConference, address, addressType);
        }