Skip to content

Commit

Permalink
ability to force disable hardwarekeyboard taken from cyanogenmod
Browse files Browse the repository at this point in the history
Conflicts:

	core/res/res/values/config.xml
  • Loading branch information
Faryaab committed Apr 7, 2012
1 parent 5278643 commit fbfbdcd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/res/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -767,4 +767,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">true</bool>

</resources>
10 changes: 9 additions & 1 deletion services/java/com/android/server/wm/WindowManagerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,8 @@ public void onReceive(Context context, Intent intent) {

final InputManager mInputManager;

private boolean mForceDisableHardwareKeyboard = false;

// Who is holding the screen on.
Session mHoldingScreenOn;
PowerManager.WakeLock mHoldingScreenWakeLock;
Expand Down Expand Up @@ -781,6 +783,9 @@ private WindowManagerService(Context context, PowerManagerService pm,

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();

Expand Down Expand Up @@ -6091,7 +6096,10 @@ boolean computeNewConfigurationLocked(Configuration config) {
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;
Expand Down

0 comments on commit fbfbdcd

Please sign in to comment.