Squash CM hardware key rebinding commits

Hardware key custom rebinding (1/2)

Framework changes to allow rebinding of the actions performed on the following
key press events: Home long-press, menu press, menu long-press, search press,
search long-press, app-switch press and app-switch long-press.

The available actions are: Nothing, open/close menu, recent apps switcher,
search assistant, voice search and in-app search.

Patch Set 1: Initial port from ICS [done by Konstantin Koslowski]
Patch Set 2: Added 'assist' (search) key customisation
             Option for ICS-style in-app search, in addition to jellybean-style
             search assistant.
             Fixed double haptic feedback on virtual key press.
Patch Set 3: Checkbox to enable/disable all custom bindings.
             Home long-press defaults to no action on devices with
             an app-switch key.
Patch Set 4: The recent apps list will be preloaded on the initial down press
             of whichever key to which it is bound.
Patch Set 5: Fixed menu virtual key press sometimes performing the custom
             action bound to the menu key instead of just opening or closing
             the menu as it should.

Conflicts:
	core/res/res/values/public.xml
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Change-Id: I72c0d220a09d79230bfa299e0521ed693e5c25f1

Conflicts:
	core/res/res/values/config.xml
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Conflicts:
	core/java/android/view/ViewConfiguration.java
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

android.policy: Fix launching home when waking the device with the home button again

Was removed in b055725d0b1df2f23ecfa95bff940aa8b57f97df

Change-Id: I19b5db8e64d7e547f4013ab8df7ff879d1a51167

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

bugfix: allow recent apps dialog to work with menu long-press

With the original patch, using the recent app dialog from a
menu button long-press would cause the dialog to be preloaded
and then dismissed on key-up. Check long-press behavior settings
as well as short-press to prevent the dismissal.

Change-Id: Idf1d27aa725547e0ddc44905e27da6c1b4540fab

Reimplement AOSP's home-key behavior configuration

Add support for resource-based long-press and double-tap behaviors,
bringing back the functionality introduced by Google at change
I4564d9e4d127f782ed5bd8eb613ef8f2255176cc on top of our own
hardware key rebinding code

commit caca88150cc22a9324b6fed89ecdf394e68cf6f8
Author: Jeff Brown <jeffbrown@google.com>
Date:   Thu May 9 13:34:33 2013 -0700

    Support double-tap home to go to recents.

    Add config resources to enable the following behavior for
    certain devices:

    * press home - go home
    * long-press home - launch assist intent
    * double-tap home - open recents

    Bug: 8891502
    Change-Id: I4564d9e4d127f782ed5bd8eb613ef8f2255176cc
    (cherry picked from commit b7805698035622a633b2d76f7ca60169aaa9f0ca)

Change-Id: I578700abf8c51e613a4227cdf9f6c3bff90feec9

Fix ordering of home keypress handling

* Home keypress handling was done out of order, causing an extra go home
  action to be executed.

Change-Id: Ieb2f6ffbf6d1e18a5d4602975f48717089e5c9dc

Detect whether overflow button should be shown based on menu key state

Some devices may have hardware keys but not contain a hardware menu key.
Hardware keys are also able to remapped. The overflow button detection logic
currently does not take that into account. This change allows detects
whether any key is capable of emitting the MENU_ACTION keystroke in
order to determine whether the overflow button should be shown or not.

Change-Id: I8699bd0242560314f8eadc54b187c69c992cf875

Conflicts:
	services/java/com/android/server/wm/WindowManagerService.java

Conflicts:
	core/java/android/view/ViewConfiguration.java

policy: fix menu key for devices with no physical menu key

Initialize key behaviour correctly for the case where the respective key
isn't present in hardware.

Change-Id: I424f879dcf5e09c0897d7ebf7646efe36661d108

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Fix virtual key press detection.

Virtual key events can be injected from anywhere, not just
PhoneWindowManager.

Change-Id: Ia9529c6534a208bf713912fc63f81a016754c6a6

Fix hardware home key behavior on wake-up

Change-Id: Ib489e4b8bb1d10591afc96c680c7865d61c959a0

Fix home key long press to work when assigned to recent app switcher.

Change-Id: Ibd16ff07b9910605c95180b54040f3e2b78939cb

Build fixes for hardware keys

Change-Id: I070435090c9d32c9ee4d1518f2ab3c08e2a08b69
Merge "Squash CM hardware key rebinding commits" into jb-mr2