diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-19 03:09:17 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-19 03:09:17 +0000 |
commit | d9423c9ef8395df5effd3d4656546b70461b41d8 (patch) | |
tree | 33cd612f98167351102d54ca77d5a70f626d21ab /framework/java/android/bluetooth/BluetoothHeadset.java | |
parent | 9b52556d5cd7842ebfb13f13f3dc9ca68ae018c3 (diff) | |
parent | 1792ff8d0259a5ab5e22aba63bae2ad95db0e69f (diff) |
Snap for 8323531 from 1792ff8d0259a5ab5e22aba63bae2ad95db0e69f to tm-release
Change-Id: I09ba33f25d6f13b86f04f3a2b7019513c164cec4
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothHeadset.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothHeadset.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHeadset.java b/framework/java/android/bluetooth/BluetoothHeadset.java index c8d0a50eee..a430a0235d 100644 --- a/framework/java/android/bluetooth/BluetoothHeadset.java +++ b/framework/java/android/bluetooth/BluetoothHeadset.java @@ -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) { |