Skip to content

Commit

Permalink
input: Add workaround for broken hardware keyboard support
Browse files Browse the repository at this point in the history
 * Add workaround var for devices with broken kernels

Change-Id: I5bcda9c0464f75cc080c224382eaecbf48613bf0

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/public.xml
	services/java/com/android/server/wm/WindowManagerService.java
  • Loading branch information
hyperb1iss authored and imnuts committed Nov 21, 2012
1 parent 6742892 commit 57b013d
Show file tree
Hide file tree
Showing 3 changed files with 15 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 @@ -1002,4 +1002,7 @@
provisioning on some carriers, working around a bug (7305641)
where if the preferred is used we don't try the others. -->
<bool name="config_dontPreferApn">false</bool>

<!-- Workaround for devices with broken keyboards -->
<bool name="config_forceDisableHardwareKeyboard">false</bool>
</resources>
3 changes: 3 additions & 0 deletions core/res/res/values/symbols.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1825,4 +1825,7 @@

<!-- Screenshot -->
<java-symbol type="string" name="global_action_screenshot" />

<!-- Keyboard Workaround -->
<java-symbol type="bool" name="config_forceDisableHardwareKeyboard" />
</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 @@ -576,6 +576,8 @@ public void onReceive(Context context, Intent intent) {
final DisplayManagerService mDisplayManagerService;
final DisplayManager mDisplayManager;

private boolean mForceDisableHardwareKeyboard = false;

// Who is holding the screen on.
Session mHoldingScreenOn;
PowerManager.WakeLock mHoldingScreenWakeLock;
Expand Down Expand Up @@ -836,6 +838,9 @@ private WindowManagerService(Context context, PowerManagerService pm,
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.
Expand Down Expand Up @@ -6966,7 +6971,10 @@ boolean computeScreenConfigurationLocked(Configuration config) {
}

// 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;
Expand Down

0 comments on commit 57b013d

Please sign in to comment.