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

Commit e8616aaf authored by Steve Kondik's avatar Steve Kondik
Browse files

input: Fix hardware keyboard support + workaround

 * Revert change that broke HW keyboards
 * Add workaround var for devices with broken kernels

Change-Id: I5bcda9c0464f75cc080c224382eaecbf48613bf0
parent 8a9f3161
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -754,4 +754,7 @@
         legacy USB manager should be started. -->
    <string name="config_legacyUmsLunFile">/sys/devices/platform/usb_mass_storage/lun0/file</string>

    <!-- Workaround for devices with broken keyboards -->
    <bool name="config_forceDisableHardwareKeyboard">false</bool>

</resources>
+9 −1
Original line number Diff line number Diff line
@@ -564,6 +564,8 @@ public class WindowManagerService extends IWindowManager.Stub

    final InputManager mInputManager;

    private boolean mForceDisableHardwareKeyboard = false;

    // Who is holding the screen on.
    Session mHoldingScreenOn;
    PowerManager.WakeLock mHoldingScreenWakeLock;
@@ -781,6 +783,9 @@ public class WindowManagerService extends IWindowManager.Stub

        mInputManager = new InputManager(context, this);

        mForceDisableHardwareKeyboard = context.getResources().getBoolean(
                com.android.internal.R.bool.config_forceDisableHardwareKeyboard);

        PolicyThread thr = new PolicyThread(mPolicy, this, context, pm);
        thr.start();

@@ -6087,7 +6092,10 @@ public class WindowManagerService extends IWindowManager.Stub
        config.compatSmallestScreenWidthDp = computeCompatSmallestWidth(rotated, dm, dw, dh);

        // Determine whether a hard keyboard is available and enabled.
        boolean hardKeyboardAvailable = config.keyboard == Configuration.KEYBOARD_NOKEYS;
        boolean hardKeyboardAvailable = false;
        if (!mForceDisableHardwareKeyboard) {
            hardKeyboardAvailable = config.keyboard != Configuration.KEYBOARD_NOKEYS;
        }
        if (hardKeyboardAvailable != mHardKeyboardAvailable) {
            mHardKeyboardAvailable = hardKeyboardAvailable;
            mHardKeyboardEnabled = hardKeyboardAvailable;