[1/2] Slims Hardware Key Rebinding

THANKS @Mahdi-Rom for the initial port!

Possible mapping are:
ACTION_HOME
ACTION_BACK
ACTION_SEARCH (in app search)
ACTION_VOICE_SEARCH
ACTION_MENU_BIG
ACTION_POWER
ACTION_NOTIFICATIONS
ACTION_QS
ACTION_RECENTS
ACTION_SCREENSHOT
ACTION_IME
ACTION_LAST_APP
ACTION_KILL
ACTION_ASSIST
ACTION_VIB
ACTION_SILENT
ACTION_VIB_SILENT
ACTION_POWER_MENU
ACTION_TORCH
ACTION_EXPANDED_DESKTOP
ACTION_THEME_SWITCH

and custom app/shorcut of course

Possible actions on all keys are:
normal tap / longpress / double tap

So to sumarize if it is in settings array enabled user can bind whatever of the above
actions to every hardware key action.

Main changes to prior solutions are:
- do not depend anymore on hardcoded integer values. We use now strings. This has
  the advantage that we can save whatever shorcut or intent URI we have into this
  value. And gives us the possibility in future without changing anything on the hw
  key rebinding code to get more options/or modify the options. Actions are holded
  like on all other of our features in ButtonsConstants.java
- All actions are peformed over our SlimActions like all other features. SlimActions
  takes care about all possible solutions the user can run into and sets the right
  open animation, keyguard handling etc etc. As well it is easier to maintain only
  one code base.
- Only observe and update the values on hardware key devices. On non hw key devices
  the complete code is non operational
- Removed in settings the not needed overlay due that we can use the fb one to
  check if it is a hw key device or not.
- Major cleanup of a lot old code.

This patch add as well one new SlimActions action....VOICE_SEARCH

To configure your device you need to add the device overlay as usual:

overlay/frameworks/base/core/res/res/values/config.xml
<!-- Hardware "softkeys" present on the device, stored as a bit field.
         This integer should equal the sum of the corresponding value for each
         of the following keys present:
            1 - Home
            2 - Back
            4 - Menu
            8 - Assistant (search)
           16 - App switch
        For example, a device with Home, Back and Menu keys would set this
        config to 7. -->
    <integer name="config_deviceHardwareKeys">7</integer>

Also requires Settings commit (https://gerrit.slimroms.net/#/c/2389/)
and overlay to function correctly

cheers HCP and kufi

PS:
- code cleanup and some code comments
PS:
- fix softkey devices
PS:
- fix back button (I think lol)
PS:
- fix wrong null checks lol
PS
- revert back to last ps due of more derp
PS
- added some debbugging lines
PS
- redefine injectInputEvent code and get rid of the handler we used to fix
  exception due that PhoneWindowManager is no UI thread and cannot handle the handler
  and to speed up navbar/navring etc. No need to delay it for 30ms
PS
- reworked the complete interpretation code. To fix up the initial issues we had on first patchsets
  and as well the new ones. Nuked vibrations as well and lets handle it like all other over SlimActions
  cleanup again
PS
- I remember that jeff had similar problem in the past and got the solution. We just check now
  who is really calling home key event. If it is a VIRTUAL key then launch home....for all other
  lauch the saved action on the home event. As well this fixes the wrong launch if DoubleTap
  timed out and launches home (now it launches the saved action for home like it should).
PS
- cleanup
PS
- finally fixed home button
PS
- last major cleanup
- cancel recent preloads only if it is really required
PS
- introduce central HwKeyHelper class to avoid code duplication in PhoneWindowManager and as well
  in Settings
PS
- fix small logical error in home key handling to avoid to go over SlimActions if button is set to default
  home
PS
- fix wrong menu default value
PS
- added double tap to all bindable buttons
- fixed reported missing vibration on longpress
- possible fix menu shows up on longpress menu
PS
- small cleanup
PS
- fix home/assist/appswitch call when it is set on the natural button as longpress or doubletapp.
PS
- attempt to fix the problem mentioned in PatchSet above on the other keys + simplify this fix
  Please test
PS
- fix navbar
PS
- fix double vibration if double tap is pending
- fix deprecated System.SHOW_PROCESS value call and call Global instead
- execute on assist and appswitch default action if no other action was executed before
- HwKeyHelper do not call provider values if not needed
- cleanup
PS
- menu and back button: if normal tap action does not equal natural back action return -1
  to avoid processing back/menu action
PS
- reset the indicating boolean for prevend second vibration when we reset the doubletap
  callback - this fixes the reported issue that vibration is suddenly completly gone
PS
- return on back and menu hardware trigger always the action and let it use the virtual
  key to process the final action
PS
- handle virtual key on back and menu a bit other
- rename vibration var
PS
- fix double vibration if double tap is disabled
PS
- fix back key wrong condition on double tap which caused 2 action calls
PS
- do not assume that double tap has always a pending vibration...check for the action
- respect keyguard on APP_SWITCH key
PS
- remove again the keyguard check lol....I forgot that I was some months ago allready
intelligent enough to check this in SlimActions lol. So no need to check it twice

Change-Id: Ic5c9b4eb03d2baa3b0ddfb3e9fcaf10d6e45dcd3

This commit replaces CM's hardware key rebinding with Slims, the orignal patch is here:

https://github.com/SlimRoms/frameworks_base/commit/2cfd9aa74fe0fc7bc388ce01bc243bbf6ec06790

Conflicts:
	core/java/android/provider/Settings.java
	core/java/com/android/internal/util/mahdi/ButtonsConstants.java
	core/java/com/android/internal/util/mahdi/MahdiActions.java
	core/res/res/values/config.xml
	core/res/res/values/mahdi_config.xml
	core/res/res/values/mahdi_strings.xml
	core/res/res/values/mahdi_symbols.xml
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
BlurManager

* Hello guys, this is my BlurManager implemented as a system service + internal API.
The usage is very simple. At the moment you can retrieve a blurred wallpaper, a blurred screenshot of the running activity or blur your custom bitmap.
I'm also working in another api to blur custom views.

To get a blurred screenshot you have to call the prepare() void.

* An interface void will be called once the bitmap is ready returning the blurred bitmap.

You can check my other upcoming commit for blurring recents panel to understand how it works but im sure you'll get it easyli.

This is a little gift for Sean :)

Change-Id: I1b01a287f9b40520bd11f5c74810d98f3d2d1415
Recents goes blur

Change-Id: I66681bf5228c806ae6bb50832028f198825e3cf7
Revert "Custom actions on navbar recents long press (1/2)"

This reverts commit 696eec6152a260c2812dd9d524feea8b5092f62b.

Conflicts:
	core/java/com/android/internal/statusbar/IStatusBar.aidl
	core/java/com/android/internal/statusbar/IStatusBarService.aidl
	packages/SystemUI/res/values/axxion_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
	services/java/com/android/server/StatusBarManagerService.java
Revert "Navigation bar dimensions (1/2)"

This reverts commit 5f4b5669c4cc116fc967b79f8ae379200a20b490.

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Revert "NavigationBar : Customization"

This reverts commit 61941dd7b5d04af790cbaa4f902bb352a4725783.

Change-Id: I37a22b8a523c03e5e89c3eb6dd3e315edff8aefc

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
SystemUI: add customizable navigation bar

Change-Id: Ibad1ecf52c7db0ac352892aed7529de68476c092
Signed-off-by: Roman Birg <romanbirg@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/layout-sw600dp/navigation_bar.xml
	packages/SystemUI/res/layout/navigation_bar.xml
	packages/SystemUI/res/values/config.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java