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

Commit 4338a67e authored by Steve Kondik's avatar Steve Kondik
Browse files

input: Add workaround for broken hardware keyboard support

 * Add workaround var for devices with broken kernels

Change-Id: I5bcda9c0464f75cc080c224382eaecbf48613bf0
parent 59541a82
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -873,4 +873,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>
+1 −0
Original line number Diff line number Diff line
@@ -3658,5 +3658,6 @@
  <eat-comment />

  <java-symbol type="string" name="config_legacyUmsLunFile" />
  <java-symbol type="bool" name="config_forceDisableHardwareKeyboard" />

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

    final InputManagerService mInputManager;

    private boolean mForceDisableHardwareKeyboard = false;

    // Who is holding the screen on.
    Session mHoldingScreenOn;
    PowerManager.WakeLock mHoldingScreenWakeLock;
@@ -912,6 +914,9 @@ public class WindowManagerService extends IWindowManager.Stub
        mInputManager = new InputManagerService(context, mInputMonitor);
        mAnimator = new WindowAnimator(this, context, mPolicy);

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

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

@@ -6559,7 +6564,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;