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

Commit 31865f74 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

input: Add workaround for broken hardware keyboard support

* Add workaround var for devices with broken kernels

Change-Id: Ib6ade70f399067469ba5aece48c6ec4608125d75
parent f88d5699
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1021,4 +1021,7 @@
    <!-- Device has a h/w rotation lock switch -->
    <bool name="config_hasRotationLockSwitch">false</bool>

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

</resources>
+1 −0
Original line number Diff line number Diff line
@@ -2082,4 +2082,5 @@
  <java-symbol type="string" name="second" />
  <java-symbol type="string" name="seconds" />

  <java-symbol type="bool" name="config_forceDisableHardwareKeyboard" />
</resources>
+9 −1
Original line number Diff line number Diff line
@@ -586,6 +586,8 @@ public class WindowManagerService extends IWindowManager.Stub
    final DisplayManagerService mDisplayManagerService;
    final DisplayManager mDisplayManager;

    private boolean mForceDisableHardwareKeyboard = false;

    // Who is holding the screen on.
    Session mHoldingScreenOn;
    PowerManager.WakeLock mHoldingScreenWakeLock;
@@ -846,6 +848,9 @@ public class WindowManagerService extends IWindowManager.Stub
        mFxSession = new SurfaceSession();
        mAnimator = new WindowAnimator(this);

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

        initPolicy(uiHandler);

        // Add ourself to the Watchdog monitors.
@@ -6985,7 +6990,10 @@ public class WindowManagerService extends IWindowManager.Stub
            }

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