keyboard: add code to detect lid state

This is from the cm-11 merge. Without this, a change in lid state
isn't generated to light up the keyboard backlight

Change-Id: Ief35cebcb62da13afe1ae7531d69ab58e196be9e
Keyboard light: Fix the physical keyboard not light when it's visible.

Conflicts:

	core/java/android/os/IPowerManager.aidl
	services/java/com/android/server/power/PowerManagerService.java
	tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java

Change-Id: I595afd3cb6b422a17ae0f6ec20aa51979db13810
PowerManagerService: Implement setButtonBrightnessOverrideFromWindowManager method

Differs from Android 4.1 (and earlier) implementation in that the
overridden button light still turns off after BUTTON_ON_DURATION instead of
staying on until screen off.  However, button lights are annoying, and
really the purpose of this is to allow apps (e.g., Screen Filter) to
_disable_ the button lights altogether.

Conflicts:

	services/java/com/android/server/power/PowerManagerService.java

Change-Id: I85632af1391b535aebe1b327ffee3766178c0852
keyboard: adding functional alt/shift lights

This is useful for devices that has QWERTY keyboard
and leds for the Alt/Shift (Fn/Caps) keys, like
htc doubleshot.

PS2: Fix whitespace & bracket issues

Change-Id: I66ebc2d881438f5b51db77eaa885421e65a7da0d
Keep keyboard lit until the screen is dimmed

Do not use button timeout for keyboard (which is intrusive on QWERTY
sliders). Keep it lit until the screen dims instead of turning it off
like the buttons after 5 seconds. Also consider setting keyboard
visibility as a user activity.

Change-Id: I864a330df6b2d075d0aa8ec6f7178061c06ee598
Merge commit 'refs/changes/44/2244/2' of https://gerrit.slimroms.net/SlimRoms/frameworks_base into kk4.4-caf