LockScreen: allow long-press actions from hardware keys (1/2)

Allow following actions with button long-presses on lockscreen:
- toggle flashlight (if available)
- play/pause/next/previous track selection
- toggle silent mode

Allow customizing of back, menu, and home buttons. Search
button events are completely ignored on the lockscreen.

Auto-detect hardware keys, only show appropriate menu
options based on the actual hardware keys available on the
device (or completely hide if there are no hardware keys).

Based largely on Danny Baumann's work from gingerbread.

Ported from CM10

Change-Id: Iff32736d00ca5d4122f64a6a861bbb0a1de9cca9

Conflicts:
	core/java/android/provider/Settings.java
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
Fix home/menu unlock with long press hardware key

- Forward port of commit 2a572ee7587cb0b686871e95567313aa8bc8bfd5

Change-Id: Ic2eb85542f8052fe1662244fe5e72ba12a98608b

Conflicts:
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java
Keyguard: Fix for home wake/unlock sometimes waking and unlocking during the same keypress.

Change-Id: I72ea7611d39aac0cd03dfd5aa7036aeef7600140
Fix Home/Menu/Back keys' unlock

Change-Id: Ibd3842b6ad8e037a2a9f8eb581e7c55900017b0f