summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothDevice.java
diff options
context:
space:
mode:
authorEtienne Ruffieux <eruffieux@google.com>2022-03-17 11:00:04 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-03-17 11:00:04 +0000
commit4e3e368fde26c3b34a1ccbef6b7aa0ee5b818e4a (patch)
tree0ddd7f997ce3ea2f0c0599e9d6883bb8ef14e1ad /framework/java/android/bluetooth/BluetoothDevice.java
parent238953136bc93d71a7329f81195918de54c0b80e (diff)
parent1775d3764c30e6ca589f6b3aae452f9d42299aa7 (diff)
Merge "Updated documentation for new Bluetooth SystemApis" am: 372da145de am: 1775d3764c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2018895 Change-Id: Ie76d1d2c64a371a020a5514294946f65a7aad2f0
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevice.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothDevice.java30
1 files changed, 27 insertions, 3 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java
index 8aef778b31..ddf2390e53 100644
--- a/framework/java/android/bluetooth/BluetoothDevice.java
+++ b/framework/java/android/bluetooth/BluetoothDevice.java
@@ -19,6 +19,7 @@ package android.bluetooth;
import static android.bluetooth.BluetoothUtils.getSyncTimeout;
import android.annotation.IntDef;
+import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
@@ -793,6 +794,15 @@ public final class BluetoothDevice implements Parcelable, Attributable {
/**
* Broadcast Action: This intent is used to broadcast CONNECTION ACCESS REQUEST
*
+ * This action will trigger a prompt for the user to accept or deny giving the
+ * permission for this device. Permissions can be specified with
+ * {@link #EXTRA_ACCESS_REQUEST_TYPE}.
+ *
+ * The reply will be an {@link #ACTION_CONNECTION_ACCESS_REPLY} sent to the specified
+ * {@link #EXTRA_PACKAGE_NAME} and {@link #EXTRA_CLASS_NAME}.
+ *
+ * This action can be cancelled with {@link #ACTION_CONNECTION_ACCESS_CANCEL}.
+ *
* @hide
*/
@SystemApi
@@ -806,6 +816,13 @@ public final class BluetoothDevice implements Parcelable, Attributable {
/**
* Broadcast Action: This intent is used to broadcast CONNECTION ACCESS REPLY
*
+ * This action is the reply from {@link #ACTION_CONNECTION_ACCESS_REQUEST}
+ * that is sent to the specified {@link #EXTRA_PACKAGE_NAME}
+ * and {@link #EXTRA_CLASS_NAME}.
+ *
+ * See the extra fields {@link #EXTRA_CONNECTION_ACCESS_RESULT} and
+ * {@link #EXTRA_ALWAYS_ALLOWED} for possible results.
+ *
* @hide
*/
@SystemApi
@@ -843,7 +860,11 @@ public final class BluetoothDevice implements Parcelable, Attributable {
"android.bluetooth.device.action.SILENCE_MODE_CHANGED";
/**
- * Used as an extra field in {@link #ACTION_CONNECTION_ACCESS_REQUEST} intent.
+ * Used as an extra field in {@link #ACTION_CONNECTION_ACCESS_REQUEST}.
+ *
+ * Possible values are {@link #REQUEST_TYPE_PROFILE_CONNECTION},
+ * {@link #REQUEST_TYPE_PHONEBOOK_ACCESS}, {@link #REQUEST_TYPE_MESSAGE_ACCESS}
+ * and {@link #REQUEST_TYPE_SIM_ACCESS}
*
* @hide
*/
@@ -887,6 +908,8 @@ public final class BluetoothDevice implements Parcelable, Attributable {
/**
* Used as an extra field in {@link #ACTION_CONNECTION_ACCESS_REPLY} intent.
*
+ * Possible values are {@link #CONNECTION_ACCESS_YES} and {@link #CONNECTION_ACCESS_NO}.
+ *
* @hide
*/
@SystemApi
@@ -1043,7 +1066,8 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public static final int PAIRING_VARIANT_DISPLAY_PIN = 5;
/**
- * The user will be prompted to accept or deny the OOB pairing request
+ * The user will be prompted to accept or deny the OOB pairing request.
+ * This is used for Bluetooth 2.1 secure simple pairing.
*
* @hide
*/
@@ -1619,7 +1643,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
@RequiresLegacyBluetoothPermission
@RequiresBluetoothConnectPermission
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
- public int getBatteryLevel() {
+ public @IntRange(from = -100, to = 100) int getBatteryLevel() {
if (DBG) log("getBatteryLevel()");
final IBluetooth service = sService;
final int defaultValue = BATTERY_LEVEL_BLUETOOTH_OFF;