From 5e3a79e1d6e4c323abd6cdd36c9761cb9557d7c4 Mon Sep 17 00:00:00 2001 From: Etienne Ruffieux Date: Thu, 1 Jul 2021 22:39:36 +0000 Subject: [PATCH] Update BluetoothAdapter and BluetoothDevice documentation Update BluetoothAdapter#startDiscovery and BluetoothDevice#fetchUuidsWithSdp documentation to indicate that it queues the request if a device is currently bonding Tag: #feature Bug: 187165224 Test: Manual Merged-In: I3dbcdacff062f6c33c2fdc8d64170bf60b2fbf6f Change-Id: I7e598417ba96a5acc9f13fb6d29a0612740f31b4 --- core/java/android/bluetooth/BluetoothAdapter.java | 7 ++++--- core/java/android/bluetooth/BluetoothDevice.java | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 5b72b76c35786..421b4de9d626a 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -1799,9 +1799,10 @@ public final class BluetoothAdapter { * discoverable (inquiry scan enabled). Many Bluetooth devices are * not discoverable by default, and need to be entered into a special mode. *

If Bluetooth state is not {@link #STATE_ON}, this API - * will return false. After turning on Bluetooth, - * wait for {@link #ACTION_STATE_CHANGED} with {@link #STATE_ON} - * to get the updated value. + * will return false. After turning on Bluetooth, wait for {@link #ACTION_STATE_CHANGED} + * with {@link #STATE_ON} to get the updated value. + *

If a device is currently bonding, this request will be queued and executed once that + * device has finished bonding. If a request is already queued, this request will be ignored. * * @return true on success, false on error */ diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 21ec91865d0a5..bbb550fd6343e 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -1775,7 +1775,8 @@ public final class BluetoothDevice implements Parcelable, Attributable { * in getting the SDP records or if the process takes a long time, or the device is bonding and * we have its UUIDs cached, {@link #ACTION_UUID} intent is sent with the UUIDs that is * currently present in the cache. Clients should use the {@link #getUuids} to get UUIDs - * if service discovery is not to be performed. + * if service discovery is not to be performed. If there is an ongoing bonding process, + * service discovery or device inquiry, the request will be queued. * * @return False if the check fails, True if the process of initiating an ACL connection * to the remote device was started or cached UUIDs will be broadcast.