am 0e772b22: Merge "Unhide setPin, setPin, setPairingConfirmation, and relevant intent fields" into klp-dev
* commit '0e772b226801ca03292abad04677b1f7f29fade4': Unhide setPin, setPin, setPairingConfirmation, and relevant intent fields
This commit is contained in:
@@ -219,7 +219,7 @@ public final class BluetoothDevice implements Parcelable {
|
||||
* {@link #BOND_NONE},
|
||||
* {@link #BOND_BONDING},
|
||||
* {@link #BOND_BONDED}.
|
||||
*/
|
||||
*/
|
||||
public static final String EXTRA_BOND_STATE = "android.bluetooth.device.extra.BOND_STATE";
|
||||
/**
|
||||
* Used as an int extra field in {@link #ACTION_BOND_STATE_CHANGED} intents.
|
||||
@@ -228,7 +228,7 @@ public final class BluetoothDevice implements Parcelable {
|
||||
* {@link #BOND_NONE},
|
||||
* {@link #BOND_BONDING},
|
||||
* {@link #BOND_BONDED}.
|
||||
*/
|
||||
*/
|
||||
public static final String EXTRA_PREVIOUS_BOND_STATE =
|
||||
"android.bluetooth.device.extra.PREVIOUS_BOND_STATE";
|
||||
/**
|
||||
@@ -253,12 +253,26 @@ public final class BluetoothDevice implements Parcelable {
|
||||
*/
|
||||
public static final int BOND_BONDED = 12;
|
||||
|
||||
/** @hide */
|
||||
/**
|
||||
* Used as an int extra field in {@link #ACTION_PAIRING_REQUEST}
|
||||
* intents for unbond reason.
|
||||
* @hide
|
||||
*/
|
||||
public static final String EXTRA_REASON = "android.bluetooth.device.extra.REASON";
|
||||
/** @hide */
|
||||
|
||||
/**
|
||||
* Used as an int extra field in {@link #ACTION_PAIRING_REQUEST}
|
||||
* intents to indicate pairing method used. Possible values are:
|
||||
* {@link #PAIRING_VARIANT_PIN},
|
||||
* {@link #PAIRING_VARIANT_PASSKEY_CONFIRMATION},
|
||||
*/
|
||||
public static final String EXTRA_PAIRING_VARIANT =
|
||||
"android.bluetooth.device.extra.PAIRING_VARIANT";
|
||||
/** @hide */
|
||||
|
||||
/**
|
||||
* Used as an int extra field in {@link #ACTION_PAIRING_REQUEST}
|
||||
* intents as the value of passkey.
|
||||
*/
|
||||
public static final String EXTRA_PAIRING_KEY = "android.bluetooth.device.extra.PAIRING_KEY";
|
||||
|
||||
/**
|
||||
@@ -306,7 +320,10 @@ public final class BluetoothDevice implements Parcelable {
|
||||
public static final String ACTION_NAME_FAILED =
|
||||
"android.bluetooth.device.action.NAME_FAILED";
|
||||
|
||||
/** @hide */
|
||||
/**
|
||||
* Broadcast Action: This intent is used to broadcast PAIRING REQUEST
|
||||
* <p>Requires {@link android.Manifest.permission#BLUETOOTH} to receive.
|
||||
*/
|
||||
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
||||
public static final String ACTION_PAIRING_REQUEST =
|
||||
"android.bluetooth.device.action.PAIRING_REQUEST";
|
||||
@@ -446,8 +463,8 @@ public final class BluetoothDevice implements Parcelable {
|
||||
public static final int UNBOND_REASON_REMOVED = 9;
|
||||
|
||||
/**
|
||||
* The user will be prompted to enter a pin
|
||||
* @hide
|
||||
* The user will be prompted to enter a pin or
|
||||
* a privileged app will enter a pin for user.
|
||||
*/
|
||||
public static final int PAIRING_VARIANT_PIN = 0;
|
||||
|
||||
@@ -458,8 +475,8 @@ public final class BluetoothDevice implements Parcelable {
|
||||
public static final int PAIRING_VARIANT_PASSKEY = 1;
|
||||
|
||||
/**
|
||||
* The user will be prompted to confirm the passkey displayed on the screen
|
||||
* @hide
|
||||
* The user will be prompted to confirm the passkey displayed on the screen or
|
||||
* a privileged app will confirm the passkey for the user.
|
||||
*/
|
||||
public static final int PAIRING_VARIANT_PASSKEY_CONFIRMATION = 2;
|
||||
|
||||
@@ -707,10 +724,9 @@ public final class BluetoothDevice implements Parcelable {
|
||||
* the bonding process completes, and its result.
|
||||
* <p>Android system services will handle the necessary user interactions
|
||||
* to confirm and complete the bonding process.
|
||||
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_ADMIN}.
|
||||
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}.
|
||||
*
|
||||
* @return false on immediate error, true if bonding will begin
|
||||
* @hide
|
||||
*/
|
||||
public boolean createBond() {
|
||||
if (sService == null) {
|
||||
@@ -946,7 +962,13 @@ public final class BluetoothDevice implements Parcelable {
|
||||
return BluetoothDevice.ERROR;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
/**
|
||||
* Set the pin during pairing when the pairing method is {@link #PAIRING_VARIANT_PIN}
|
||||
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}.
|
||||
*
|
||||
* @return true pin has been set
|
||||
* false for error
|
||||
*/
|
||||
public boolean setPin(byte[] pin) {
|
||||
if (sService == null) {
|
||||
Log.e(TAG, "BT not enabled. Cannot set Remote Device pin");
|
||||
@@ -968,7 +990,13 @@ public final class BluetoothDevice implements Parcelable {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
/**
|
||||
* Confirm passkey for {@link #PAIRING_VARIANT_PASSKEY_CONFIRMATION} pairing.
|
||||
* <p>Requires {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}.
|
||||
*
|
||||
* @return true confirmation has been sent out
|
||||
* false for error
|
||||
*/
|
||||
public boolean setPairingConfirmation(boolean confirm) {
|
||||
if (sService == null) {
|
||||
Log.e(TAG, "BT not enabled. Cannot set pairing confirmation");
|
||||
|
||||
Reference in New Issue
Block a user