Loading android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +1 −1 Original line number Diff line number Diff line Loading @@ -426,7 +426,7 @@ final class BondStateMachine extends StateMachine { intent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, newState); intent.putExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, oldState); if (newState == BluetoothDevice.BOND_NONE) { intent.putExtra(BluetoothDevice.EXTRA_REASON, reason); intent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, reason); } mAdapterService.sendBroadcastAsUser(intent, UserHandle.ALL, BLUETOOTH_CONNECT, Utils.getTempAllowlistBroadcastOptions()); Loading android/app/tests/unit/src/com/android/bluetooth/btservice/BondStateMachineTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -361,10 +361,10 @@ public class BondStateMachineTest { Assert.assertEquals(oldState, intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, -1)); if (newState == BOND_NONE) { Assert.assertEquals(TEST_BOND_REASON, intent.getIntExtra(BluetoothDevice.EXTRA_REASON, -1)); Assert.assertEquals(TEST_BOND_REASON, intent.getIntExtra(BluetoothDevice.EXTRA_UNBOND_REASON, -1)); } else { Assert.assertEquals(-1, intent.getIntExtra(BluetoothDevice.EXTRA_REASON, -1)); Assert.assertEquals(-1, intent.getIntExtra(BluetoothDevice.EXTRA_UNBOND_REASON, -1)); } } } framework/api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,7 @@ package android.bluetooth { field public static final String EXTRA_PAIRING_INITIATOR = "android.bluetooth.device.extra.PAIRING_INITIATOR"; field public static final int EXTRA_PAIRING_INITIATOR_BACKGROUND = 2; // 0x2 field public static final int EXTRA_PAIRING_INITIATOR_FOREGROUND = 1; // 0x1 field public static final String EXTRA_REASON = "android.bluetooth.device.extra.REASON"; field public static final String EXTRA_UNBOND_REASON = "android.bluetooth.device.extra.REASON"; field public static final int METADATA_COMPANION_APP = 4; // 0x4 field public static final int METADATA_DEVICE_TYPE = 17; // 0x11 field public static final int METADATA_ENHANCED_SETTINGS_UI_URI = 16; // 0x10 Loading framework/java/android/bluetooth/BluetoothDevice.java +15 −5 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -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} Loading @@ -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} Loading Loading
android/app/src/com/android/bluetooth/btservice/BondStateMachine.java +1 −1 Original line number Diff line number Diff line Loading @@ -426,7 +426,7 @@ final class BondStateMachine extends StateMachine { intent.putExtra(BluetoothDevice.EXTRA_BOND_STATE, newState); intent.putExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, oldState); if (newState == BluetoothDevice.BOND_NONE) { intent.putExtra(BluetoothDevice.EXTRA_REASON, reason); intent.putExtra(BluetoothDevice.EXTRA_UNBOND_REASON, reason); } mAdapterService.sendBroadcastAsUser(intent, UserHandle.ALL, BLUETOOTH_CONNECT, Utils.getTempAllowlistBroadcastOptions()); Loading
android/app/tests/unit/src/com/android/bluetooth/btservice/BondStateMachineTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -361,10 +361,10 @@ public class BondStateMachineTest { Assert.assertEquals(oldState, intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, -1)); if (newState == BOND_NONE) { Assert.assertEquals(TEST_BOND_REASON, intent.getIntExtra(BluetoothDevice.EXTRA_REASON, -1)); Assert.assertEquals(TEST_BOND_REASON, intent.getIntExtra(BluetoothDevice.EXTRA_UNBOND_REASON, -1)); } else { Assert.assertEquals(-1, intent.getIntExtra(BluetoothDevice.EXTRA_REASON, -1)); Assert.assertEquals(-1, intent.getIntExtra(BluetoothDevice.EXTRA_UNBOND_REASON, -1)); } } }
framework/api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,7 @@ package android.bluetooth { field public static final String EXTRA_PAIRING_INITIATOR = "android.bluetooth.device.extra.PAIRING_INITIATOR"; field public static final int EXTRA_PAIRING_INITIATOR_BACKGROUND = 2; // 0x2 field public static final int EXTRA_PAIRING_INITIATOR_FOREGROUND = 1; // 0x1 field public static final String EXTRA_REASON = "android.bluetooth.device.extra.REASON"; field public static final String EXTRA_UNBOND_REASON = "android.bluetooth.device.extra.REASON"; field public static final int METADATA_COMPANION_APP = 4; // 0x4 field public static final int METADATA_DEVICE_TYPE = 17; // 0x11 field public static final int METADATA_ENHANCED_SETTINGS_UI_URI = 16; // 0x10 Loading
framework/java/android/bluetooth/BluetoothDevice.java +15 −5 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -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} Loading @@ -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} Loading