summaryrefslogtreecommitdiff
path: root/framework/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'framework/java/android')
-rw-r--r--framework/java/android/bluetooth/BluetoothHeadset.java7
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) {