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

Commit 9a5e351f authored by Rahul Sabnis's avatar Rahul Sabnis
Browse files

BluetoothHeadset#getAudioState now throws a NullPointerException if the

device param is null.

Tag: #feature
Bug: 222265808
Test: Manual
Change-Id: Ifd4eab1c377c8d465d6b6b3f345873210bd44cb8
parent dc7a3d99
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeoutException;

/**
@@ -930,7 +931,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
     *
     * @param device is the Bluetooth device for which the audio state is being queried
     * @return the audio state of the device or an error code
     * @throws IllegalArgumentException if the device is null
     * @throws NullPointerException if the device is null
     *
     * @hide
     */
@@ -942,9 +943,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
    })
    public @GetAudioStateReturnValues int getAudioState(@NonNull BluetoothDevice device) {
        if (VDBG) log("getAudioState");
        if (device == null) {
            throw new IllegalArgumentException("device cannot be null");
        }
        Objects.requireNonNull(device);
        final IBluetoothHeadset service = mService;
        final int defaultValue = BluetoothHeadset.STATE_AUDIO_DISCONNECTED;
        if (service == null) {