diff options
author | Scott Lobdell <slobdell@google.com> | 2022-03-25 17:35:54 +0000 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2022-03-25 17:47:54 +0000 |
commit | 8d4d459a97c4d14422610cece6b2e57ff8f5b8a8 (patch) | |
tree | 54c9d7e0ca4a5299bb2a7d7e3a24fa296a2ef31a /framework/java/android/bluetooth/BluetoothHeadset.java | |
parent | 716968a4d1de6971c5c569cd8f5f2830b5dba575 (diff) | |
parent | a555ad5019f215e6ac56359a02a6e95713dd0c89 (diff) |
Merge TP1A.220321.002
Change-Id: Ie8206e8b9c11c3fd55b7adddac5c782ad92c9da4
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 3c1208551c..9cbfe2971a 100644 --- a/framework/java/android/bluetooth/BluetoothHeadset.java +++ b/framework/java/android/bluetooth/BluetoothHeadset.java @@ -51,6 +51,7 @@ import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.Objects; import java.util.concurrent.TimeoutException; /** @@ -962,7 +963,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 */ @@ -974,9 +975,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) { |