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

Commit ab74e3e0 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski
Browse files

hap: Fix missing null device checks

Bug: 150670922
Tag: #feature
Test: atest BluetoothHapClientTest
Sponsor: jpawlowski@
Change-Id: Ia0e0d7b8892f202a8b3bef01dab0f64ff09a0c51
parent c1a968aa
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -644,6 +644,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
    public boolean setConnectionPolicy(@NonNull BluetoothDevice device,
            @ConnectionPolicy int connectionPolicy) {
        if (DBG) log("setConnectionPolicy(" + device + ", " + connectionPolicy + ")");
        Objects.requireNonNull(device, "BluetoothDevice cannot be null");
        final IBluetoothHapClient service = getService();
        final boolean defaultValue = false;
        if (service == null) {
@@ -673,7 +674,8 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
     * {@link #CONNECTION_POLICY_UNKNOWN}
     *
     * @param device Bluetooth device
     * @return connection policy of the device
     * @return connection policy of the device or {@link #CONNECTION_POLICY_FORBIDDEN} if device is
     *         null
     * @hide
     */
    @SystemApi