Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df7627db authored by Adam Powell's avatar Adam Powell
Browse files

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
parent fedffeed
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
        }
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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() {