diff options
author | William Escande <wescande@google.com> | 2022-03-15 11:10:39 +0100 |
---|---|---|
committer | William Escande <wescande@google.com> | 2022-03-18 11:50:30 +0100 |
commit | e0328dfcda4ca933f0c8d8fad16ddebd29d6387b (patch) | |
tree | 2a7fc2598d5bef988079ccade95cf33590d0aae9 /framework/java/android/bluetooth/BluetoothDevice.java | |
parent | 9dbe2df3a95ec15f8385b82ba34a04ebff72de08 (diff) |
API Review: add `UNBOND` in `EXTRA_REASON` name
> Can you make EXTRA_REASON an 'unsupported app usage' alias for
> EXTRA_UNBOUND_REASON (which is in the public API)?
> And add a max target SDK to the @UnsupportedAppUsage annotation.
Bug: 221851154
Test: Build + TH
Tag: #refactor
Ignore-AOSP-First: Merge conflict
Change-Id: I7aa94fc5cf78f275e8e3da665e1ec8b6f1611dcc
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevice.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothDevice.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java index 978c8ed4ac..f6c0c56035 100644 --- a/framework/java/android/bluetooth/BluetoothDevice.java +++ b/framework/java/android/bluetooth/BluetoothDevice.java @@ -216,7 +216,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) @@ -379,8 +379,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} @@ -392,11 +391,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} |