diff options
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothHapClient.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothHapClient.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHapClient.java b/framework/java/android/bluetooth/BluetoothHapClient.java index 5416d73610..1d51670ffe 100644 --- a/framework/java/android/bluetooth/BluetoothHapClient.java +++ b/framework/java/android/bluetooth/BluetoothHapClient.java @@ -644,6 +644,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable public boolean setConnectionPolicy(@NonNull BluetoothDevice device, @ConnectionPolicy int connectionPolicy) { if (DBG) log("setConnectionPolicy(" + device + ", " + connectionPolicy + ")"); + Objects.requireNonNull(device, "BluetoothDevice cannot be null"); final IBluetoothHapClient service = getService(); final boolean defaultValue = false; if (service == null) { @@ -673,7 +674,8 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable * {@link #CONNECTION_POLICY_UNKNOWN} * * @param device Bluetooth device - * @return connection policy of the device + * @return connection policy of the device or {@link #CONNECTION_POLICY_FORBIDDEN} if device is + * null * @hide */ @SystemApi |