From df7627db715a7a2e7f646f02a07caf2347bb90b8 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Mon, 21 Jun 2010 16:23:42 -0700 Subject: Changes for bluetooth keyboard support. Add device class constant for PROFILE_HID and check for Device.Major.PERIPHERAL when checking for class matches. Change UUID for HID support. Fix bug in BluetoothService. Change-Id: Ie5361257d90fd749249e915824564bc3d79fb95d --- core/java/android/bluetooth/BluetoothClass.java | 4 ++++ core/java/android/bluetooth/BluetoothUuid.java | 2 +- core/java/android/server/BluetoothService.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'core/java') diff --git a/core/java/android/bluetooth/BluetoothClass.java b/core/java/android/bluetooth/BluetoothClass.java index c7fea9e..0c9bab2 100644 --- a/core/java/android/bluetooth/BluetoothClass.java +++ b/core/java/android/bluetooth/BluetoothClass.java @@ -259,6 +259,8 @@ public final class BluetoothClass implements Parcelable { public static final int PROFILE_A2DP = 1; /** @hide */ public static final int PROFILE_OPP = 2; + /** @hide */ + public static final int PROFILE_HID = 3; /** * Check class bits for possible bluetooth profile support. @@ -324,6 +326,8 @@ public final class BluetoothClass implements Parcelable { default: return false; } + } else if (profile == PROFILE_HID) { + return (getDeviceClass() & Device.Major.PERIPHERAL) == Device.Major.PERIPHERAL; } else { return false; } diff --git a/core/java/android/bluetooth/BluetoothUuid.java b/core/java/android/bluetooth/BluetoothUuid.java index 1909e03..f1ee907 100644 --- a/core/java/android/bluetooth/BluetoothUuid.java +++ b/core/java/android/bluetooth/BluetoothUuid.java @@ -50,7 +50,7 @@ public final class BluetoothUuid { public static final ParcelUuid ObexObjectPush = ParcelUuid.fromString("00001105-0000-1000-8000-00805f9b34fb"); public static final ParcelUuid Hid = - ParcelUuid.fromString("00000011-0000-1000-8000-00805f9b34fb"); + ParcelUuid.fromString("00001124-0000-1000-8000-00805f9b34fb"); public static final ParcelUuid[] RESERVED_UUIDS = { AudioSink, AudioSource, AdvAudioDist, HSP, Handsfree, AvrcpController, AvrcpTarget, diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index e68632d..ec99b0d 100644 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -1265,7 +1265,7 @@ public class BluetoothService extends IBluetooth.Stub { if (mInputDevices.get(device) == null) { return BluetoothInputDevice.STATE_DISCONNECTED; } - return mInputDevices.get(device.getAddress()); + return mInputDevices.get(device); } public synchronized BluetoothDevice[] getConnectedInputDevices() { -- cgit v1.1