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

Commit bd0b4024 authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Automerger Merge Worker
Browse files

Merge "BluetoothHeadset#getAudioState now throws a NullPointerException if the...

Merge "BluetoothHeadset#getAudioState now throws a NullPointerException if the device param is null." am: d2ef8d7c am: 802f6def am: 43c5b15e

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2030694

Change-Id: I71761f63d211838f09f30c043431d63083f3a3f8
parents 2465e1d7 43c5b15e
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;

/**
@@ -904,7 +905,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
     */
@@ -916,9 +917,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) {