From d4a13f56d8d466585f73f45feb15375db5c88ee8 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Mon, 8 Jun 2020 15:02:34 -0700 Subject: [PATCH] Bluetooth: Add pairing initiator extra Remember if the pairing app was in the foreground. Bug: 150156492 Test: pair two devices, unpair on one device, try to reconnect Change-Id: I6f564857974146e0c18134648eb1e297e8afbc6f --- .../android/bluetooth/BluetoothDevice.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index dc7d05300d456..fb9746830d4ee 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -326,6 +326,26 @@ public final class BluetoothDevice implements Parcelable { */ public static final String EXTRA_PAIRING_KEY = "android.bluetooth.device.extra.PAIRING_KEY"; + /** + * Used as an int extra field in {@link #ACTION_PAIRING_REQUEST} + * intents as the value of passkey. + * @hide + */ + public static final String EXTRA_PAIRING_INITIATOR = + "android.bluetooth.device.extra.PAIRING_INITIATOR"; + + /** + * Bluetooth pairing initiator, Foreground App + * @hide + */ + public static final int EXTRA_PAIRING_INITIATOR_FOREGROUND = 1; + + /** + * Bluetooth pairing initiator, Background + * @hide + */ + public static final int EXTRA_PAIRING_INITIATOR_BACKGROUND = 2; + /** * Bluetooth device type, Unknown */