diff options
| author | 2022-10-04 03:43:26 +0000 | |
|---|---|---|
| committer | 2022-10-04 03:43:26 +0000 | |
| commit | 3c30656e87c22c6dc572826820b3ebab2dc0c56e (patch) | |
| tree | 0fbd3787a03069db42024e812fbc4582db5b9ace | |
| parent | cedbfe772c0f476ce08d3810a72311a0d4df66ad (diff) | |
| parent | 877759fdfaa2960f4b5db4acc158c6b154cd77ae (diff) | |
Merge "Must cancel bt discovery before calling cdm.assoicate()"
| -rw-r--r-- | core/java/android/companion/CompanionDeviceManager.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/companion/CompanionDeviceManager.java b/core/java/android/companion/CompanionDeviceManager.java index bf7043c8e41e..4142bceb2c45 100644 --- a/core/java/android/companion/CompanionDeviceManager.java +++ b/core/java/android/companion/CompanionDeviceManager.java @@ -30,6 +30,7 @@ import android.annotation.UserHandleAware; import android.app.Activity; import android.app.NotificationManager; import android.app.PendingIntent; +import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.content.ComponentName; import android.content.Context; @@ -367,6 +368,10 @@ public final class CompanionDeviceManager { * recommended to do when an association is no longer relevant to avoid unnecessary battery * and/or data drain resulting from special privileges that the association provides</p> * + * <p>Note that if you use this api to associate with a Bluetooth device, please make sure + * to cancel your own Bluetooth discovery before calling this api, otherwise the callback + * may fail to return the desired device.</p> + * * <p>Calling this API requires a uses-feature * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} declaration in the manifest</p> ** @@ -377,6 +382,7 @@ public final class CompanionDeviceManager { * @see AssociationRequest.Builder * @see #getMyAssociations() * @see #disassociate(int) + * @see BluetoothAdapter#cancelDiscovery() */ @UserHandleAware @RequiresPermission(anyOf = { |