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

Commit 8cc316e4 authored by Jaikumar Ganesh's avatar Jaikumar Ganesh
Browse files

Add temporary hack for keyboards not following spec.

Change-Id: Ic206d45e54f0dc2ccf8124adb08df0c768d7e130
parent c88b0c62
Loading
Loading
Loading
Loading
+19 −8
Original line number Original line Diff line number Diff line
@@ -548,6 +548,15 @@ class BluetoothEventLoop {
           }
           }
        }
        }


        // STOPSHIP: Hack for MOT keyboards
        boolean motKeyboard = false;
        String name = mBluetoothService.getRemoteName(address);
        if (name == null && address.startsWith("00:0F:F6") ||
            (name != null && name.startsWith("Motorola"))) {
                motKeyboard = true;
        }

        if (!motKeyboard) {
            if (btDeviceClass == BluetoothClass.Device.PERIPHERAL_KEYBOARD ||
            if (btDeviceClass == BluetoothClass.Device.PERIPHERAL_KEYBOARD ||
                btDeviceClass == BluetoothClass.Device.PERIPHERAL_KEYBOARD_POINTING) {
                btDeviceClass == BluetoothClass.Device.PERIPHERAL_KEYBOARD_POINTING) {
                // Its a keyboard. Follow the HID spec recommendation of creating the
                // Its a keyboard. Follow the HID spec recommendation of creating the
@@ -557,6 +566,8 @@ class BluetoothEventLoop {
                sendDisplayPinIntent(address, pin);
                sendDisplayPinIntent(address, pin);
                return;
                return;
            }
            }
        }

        // Acquire wakelock during PIN code request to bring up LCD display
        // Acquire wakelock during PIN code request to bring up LCD display
        mWakeLock.acquire();
        mWakeLock.acquire();
        Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
        Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);