summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothDevice.java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-03-19 06:36:59 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-03-19 06:36:59 +0000
commitc47e6b5bebabc1668b80b54a589f9125b3684b53 (patch)
tree2e1d254e1614291aff6d79a9fe8804d346ddd6ce /framework/java/android/bluetooth/BluetoothDevice.java
parent53c034b848b53c68ba69a5b6342c8ecdb31b567d (diff)
parente0328dfcda4ca933f0c8d8fad16ddebd29d6387b (diff)
Merge "API Review: add `UNBOND` in `EXTRA_REASON` name" into tm-dev
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevice.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothDevice.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java
index 698e409723..5b197763c6 100644
--- a/framework/java/android/bluetooth/BluetoothDevice.java
+++ b/framework/java/android/bluetooth/BluetoothDevice.java
@@ -217,7 +217,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
* #EXTRA_BOND_STATE} and {@link #EXTRA_PREVIOUS_BOND_STATE}.
*/
// Note: When EXTRA_BOND_STATE is BOND_NONE then this will also
- // contain a hidden extra field EXTRA_REASON with the result code.
+ // contain a hidden extra field EXTRA_UNBOND_REASON with the result code.
@RequiresLegacyBluetoothPermission
@RequiresBluetoothConnectPermission
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
@@ -380,8 +380,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
public static final int BOND_BONDED = 12;
/**
- * Used as an int extra field in {@link #ACTION_PAIRING_REQUEST}
- * intents for unbond reason.
+ * Used as an int extra field in {@link #ACTION_PAIRING_REQUEST} intents for unbond reason.
* Possible value are :
* - {@link #UNBOND_REASON_AUTH_FAILED}
* - {@link #UNBOND_REASON_AUTH_REJECTED}
@@ -393,11 +392,22 @@ public final class BluetoothDevice implements Parcelable, Attributable {
* - {@link #UNBOND_REASON_REMOTE_AUTH_CANCELED}
* - {@link #UNBOND_REASON_REMOVED}
*
- * {@hide}
+ * Note: Can be added as a hidden extra field for {@link #ACTION_BOND_STATE_CHANGED} when the
+ * {@link #EXTRA_BOND_STATE} is {@link #BOND_NONE}
+ *
+ * @hide
*/
@SystemApi
@SuppressLint("ActionValue")
- public static final String EXTRA_REASON = "android.bluetooth.device.extra.REASON";
+ public static final String EXTRA_UNBOND_REASON = "android.bluetooth.device.extra.REASON";
+
+ /**
+ * Use {@link EXTRA_UNBOND_REASON} instead
+ * @hide
+ */
+ @UnsupportedAppUsage
+ public static final String EXTRA_REASON = EXTRA_UNBOND_REASON;
+
/**
* Used as an int extra field in {@link #ACTION_PAIRING_REQUEST}