aboutsummaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothDevice.java
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2009-07-16 18:26:28 -0700
committerJaikumar Ganesh <jaikumar@google.com>2009-07-17 14:00:32 -0700
commitd1a0bd8fd2e21d0cceb55872571edd3b6cc332ad (patch)
treeb7e80d38d9aeb79cb01d2c453bb41d9037d630ff /framework/java/android/bluetooth/BluetoothDevice.java
parent4eb5ccc6539e8b56f24347fd546dc4a052cf6c1f (diff)
Initial support of 2.1 pairing.
Note: Some cases have not been tested yet, as we would need to get proper UI support.
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevice.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothDevice.java27
1 files changed, 25 insertions, 2 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java
index c942a27e8c..a64c6d72d4 100644
--- a/framework/java/android/bluetooth/BluetoothDevice.java
+++ b/framework/java/android/bluetooth/BluetoothDevice.java
@@ -74,6 +74,14 @@ public class BluetoothDevice {
/** An existing bond was explicitly revoked */
public static final int UNBOND_REASON_REMOVED = 6;
+ /* The user will be prompted to enter a pin */
+ public static final int PAIRING_VARIANT_PIN = 0;
+ /* The user will be prompted to enter a passkey */
+ public static final int PAIRING_VARIANT_PASSKEY = 1;
+ /* The user will be prompted to confirm the passkey displayed on the screen */
+ public static final int PAIRING_VARIANT_CONFIRMATION = 2;
+
+
private static final String TAG = "BluetoothDevice";
private final IBluetoothDevice mService;
@@ -358,9 +366,24 @@ public class BluetoothDevice {
} catch (RemoteException e) {Log.e(TAG, "", e);}
return false;
}
- public boolean cancelPin(String address) {
+
+ public boolean setPasskey(String address, int passkey) {
+ try {
+ return mService.setPasskey(address, passkey);
+ } catch (RemoteException e) {Log.e(TAG, "", e);}
+ return false;
+ }
+
+ public boolean setPairingConfirmation(String address, boolean confirm) {
+ try {
+ return mService.setPairingConfirmation(address, confirm);
+ } catch (RemoteException e) {Log.e(TAG, "", e);}
+ return false;
+ }
+
+ public boolean cancelPairingUserInput(String address) {
try {
- return mService.cancelPin(address);
+ return mService.cancelPairingUserInput(address);
} catch (RemoteException e) {Log.e(TAG, "", e);}
return false;
}