[2/2] Settings: Slims Hardware Key Rebinding

First thanks to CM team for the 2 years where we used their approach for our
custom hw key rebinding. This hardware key rebinding
patches did in the past a good job and we extended it prior 4.3 with a lot
Slim custom stuff.

But it is time to go new way and to do the complete
hardware key rebinding more flexible and more centralized. Especially due
that we have now all possible shorcutactions centralized in 4.4

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 fb commit.

Cheers HCP and kufi

Changes to prior patchsets:
- reflect fb changes
- simplify code
- code cleanup
- instance handling of error dialog
- some minor tweaks

PS:
- complete reworked....using now like on navbar etc custom dialogs to be
  consistent and pretty :D
- reset to default is not implemented yet...no idea if we want that or not. Any opinions on it?

PS:
- implement fb changes and use central HwKeyHelper class

PS:
- added reset button

PS:
- added double tap to all bindable keys

Change-Id: Ie4794073236f0b6fe308b931d7d6e9d02a1ddf02

Conflicts:

	res/values/config.xml
	res/values/cr_strings.xml
	src/com/android/settings/temasek/NavigationSettings.java

(cherry picked from commit 0fa6ec2126a259b6bb8613c9af98126dd8731e57)
Remove CM Hardware key rebinding options

(cherry picked from commit dd7f8f6e6946498147cb7cc6900077583f2c9631)

Conflicts:
	res/xml/button_settings.xml
	src/com/android/settings/cyanogenmod/ButtonSettings.java
don't disable lockscreen widgets on low memory devices (2/2)

Change-Id: Iec97a60097075fde973b6928e1f21f3827e0325b
(cherry picked from commit 2c916e6fc33635cf155685c2cb1dfd8de34685fd)

Conflicts:
	src/com/android/settings/cyanogenmod/LockscreenInterface.java
Fix one NPE in tethering setting

Once we not declare BT feature, go Setting->more->tethering
will trigger this NPE.
Cherry-picked from AOSP: https://android-review.googlesource.com/#/c/63695/

Change-Id: I4736e7bade261475acda74e26250a81452018ffa
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>
(cherry picked from commit 82ca10613abf37d25e2c65f9e637b4f04cc5b4b2)
Settings: fix typo

KEY_SENORS_MOTORS_CATEGORY should be KEY_SENSORS_MOTORS_CATEGORY

Change-Id: Id09c2c8c2f8427b59648e34d8883a7b9b691989d
(cherry picked from commit 1ab6682080c966a21f4920ae03fd0e74a0ee2507)
Show memory full text only for internal storage

When the internal memory is full, a warning text is shown
in Settings/Storage. This warning was displayed for all
types of memory (internal/primary, sd card and usb storage)
even though it was only referring to the primary memory.
With this fix, it is only shown for the primary memory.

Change-Id: I35ad4b0b45c6752ddc9d7166495435b27fd4a170
(cherry picked from commit 3d63847ef4fc3e2307d1bf9d32f377722eae1a48)
Bleed keyguard widget picker list into translucent bars

Change-Id: Ie929845fd8b822dcf858b9b56cb5758379d55c59
(cherry picked from commit 8932d44096e98c4ad9d66195d97f8b0debfd781f)
Remove empty App Security preference group

Change-Id: Ia36eeed8b0d38c826ed499b5fd2b8264f45a459f
(cherry picked from commit 9332252cc2fce685a375dc5f09ddc5cc4efcd380)
Performance: Allow enabling KSM by default

Allow device maintainers to enable KSM by default.
Set ro.ksm.default=1 to enable.

Change-Id: Ib432be4937dff63891e641b2f14ab223c2d245df
(cherry picked from commit 4770a0643419974fc481386832b335511351ece0)
Drop Lockscreen vibrate option [2/2]

It doesn't make sense to keep haptic feedback on, but
disable it only for that little unlock icon.
This option didn't do anything more than that.
Let's drop it and don't confuse users.

Change-Id: I0211deea61b2d5b048deb118c30fc1397a56d3ee

Conflicts:

	src/com/android/settings/SecuritySettings.java

(cherry picked from commit 4cbbd198f19b9f5a52d02e71fdc0e22269d42159)

Conflicts:
	res/values/cm_strings.xml
[1/2] Settings AppOps: Forward port wifi/bluetooth/mobile/wakeup ops

    Squash of:

    Author: Shashank Mittal <mittals@codeaurora.org>
    Date:   Thu Sep 5 19:01:47 2013 -0700
    AppOps: Add more operations in app ops settings.
    Add following operations in app ops settings.
    -- Wifi enable/disable
    -- Bluetooth enable/disable
    -- Mobile data enable/disable
    Change-Id: I32183d77b88c326168557444a445765b5a69de6f

    Author: Sam Mortimer <sam@mortimer.me.uk>
    Date:   Mon Sep 30 23:10:35 2013 -0700
    [1/2] AppOps: Add alarm wakeup op
    Change-Id: Ic739519cb9df9d2c67d65e3572a119b4d55145f0

Change-Id: Iacfbf6abccdda65afc3b7b83bfc03b30d94afd77

Conflicts:

	res/values/cm_strings.xml

(cherry picked from commit cd5141e43e0a53c800c40b424898f793f15c0a1c)

Conflicts:
	res/values/cm_strings.xml
[1/2] Settings AppOps: show/hide app type and allow/deny counters

    Squash of:

    Author: Sam Mortimer <sam@mortimer.me.uk>
    Date:   Thu Oct 3 13:51:31 2013 -0700
    AppOps: menu options to show/hide user and system apps
    Change-Id: Ia55364c361db949a891e4b53a757ee4dff519eb6

    Author: Sam Mortimer <sam@mortimer.me.uk>
    Date:   Wed Oct 2 22:24:14 2013 -0700
    [1/2] AppOps: Show allowed/ignored counts
    Change-Id: Ia27737155c33e934df9a2a1fcff88379240fd096

    Author: Sam Mortimer <sam@mortimer.me.uk>
    Date:   Sun Dec 1 21:39:07 2013 -0800
    AppOps: only apply app type filters to summary screen
      *) If buildState() is called for a single package, do
         not apply hide user/system app filters.
      *) Fixes show detail display when called via
         long press in privacyguard and an AppOp hide
         filter is ticked.
    Change-Id: If31d094fb989836ab6829daeefe820695032c0ed

Change-Id: Ia55364c361db949a891e4b53a757ee4dff519eb6
(cherry picked from commit 847e3344b72500a38582e1c4023686fe6c635098)
[1/2] Settings: AppOps: Add bootup template

This template lists all the sevices and apps that auto start on bootup.

User can use this template to control list of auto start applications.

Change-Id: Ibf03d7df0037c87eb2ef3ca48a34ef46a103b4d7
(cherry picked from commit 0e962983699f3a460d2145846824513227ed778b)