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

Commit 99c99e6a 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 am: bd0b4024

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

Change-Id: I65e9bf71bcb28579c4870224e669ae310316edee
parents 581c1cf2 bd0b4024
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) {