Fix hardware keys mess (1/2)

Squashed commits from CM

Fix virtual key press detection.
Virtual key events can be injected from anywhere, not just
PhoneWindowManager.

Change-Id: Ia9529c6534a208bf713912fc63f81a016754c6a6

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

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

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 caca881
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 b780569)

Change-Id: I578700abf8c51e613a4227cdf9f6c3bff90feec9

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

Adds ability to answer call with hardware HOME button (preparation to…
… winter time)

Change-Id: Ic11449acf87c6b4d932142b74158af7441658b3d

Patch set 1 : Upload the change
Patch set 2 : Only change the real Author
Patch set 3 : Bugfix:
              Add register for the ContentObserver (Settings.Secure.RING_HOME_BUTTON_BEHAVIOR) in PhoneWindowManager,
              and correcting the logging functions and deleting some unneeded comments

Framework: Forward port Long press back to kill app
Original author: DaneshM

Change-Id: I54f4fb861897fe713cffa15422535c5091a0c095

Port "Bind VolUp+VolDown to toggle the ringer"
Squash of http://review.cyanogenmod.org/#/c/20256/ and
http://review.cyanogenmod.org/#/c/22716/

Change-Id: Ied3767969482a7ea44f7f0e9222a2f78fe8f507c
fix HALO silence bug when notification is dismissed
Allow multiple emulated storages at the same time.

Only do multiuser mapping for primary emulated storage as per google docs.
Allow all non-primary emulated storage to have id other than 0 so that
it could be distinguished from the primary volume.

Change-Id: I7b70b9067fd6211055fb9074710f48107d7b0e8e