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

Commit e241cd6f authored by Yorke Lee's avatar Yorke Lee
Browse files

Protect against null mBluetoothHeadset

Bug: 17922576
Change-Id: I96a9e3005c4e6ac5c97bc5e4f11527f87d9d5e38
parent fae0efd9
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -581,14 +581,19 @@ public final class BluetoothPhoneService extends Service {
                    index, direction, state, isPartOfConference, Log.piiHandle(address),
                    addressType);
        }

        if (mBluetoothHeadset != null) {
            mBluetoothHeadset.clccResponse(
                    index, direction, state, 0, isPartOfConference, address, addressType);
        }
    }

    private void sendClccEndMarker() {
        // End marker is recognized with an index value of 0. All other parameters are ignored.
        if (mBluetoothHeadset != null) {
            mBluetoothHeadset.clccResponse(0 /* index */, 0, 0, 0, false, null, 0);
        }
    }

    /**
     * Returns the caches index for the specified call.  If no such index exists, then an index is