Update Tentacles QS tile png
CM11 Themes: Take into account ALL res/xml dirs

Only res/xml was being searched for redirection XML files, which
causes themes that use xml-v14, xml-v19, etc to be overlooked and
resources not being mapped.

Change-Id: I8ccad5770250150a95ec3b89be56f8d01025b126
CM11 Themes: Use 32bit hash to decide if idmap should be created

Using the last modified time of the package to determine if an idmap
should be created is not always valid for system packages.  We have
observed some packages having a time stamp of 08/01/2008 even if the
package has changed.  This causes system packages, such as
frameworks-res.apk to not be properly mapped if IDs changed in this
package.

This patch will generate a 32 bit hash code based on the file's
MD5 sum.  This hash code is then provided to idmap for writing these
values into the idmap header for future comparison.

This patch requires the following change found in frameworks/native
http://review.cyanogenmod.org/62566

Change-Id: Ie9e0273aef96217f06b08774623dd5f1b290a3da
Lockscreen wallpaper for themes

Change-Id: If77b97301c5bfebd94b193fe9a54e676e678d3ed
Revert "Implement "real" KitKat color scheme."

This reverts commit ae104bcea61d7e0468a76fc45f34f47bc3a2e103.

Conflicts:
	core/res/res/values/colors.xml
Revert " Implement "real" KitKat color scheme.  pt2 (forgotten values)"

This reverts commit d1de1f1ba59da4ac72d1a2bb5de11932da5b7918.
Revert "Lockscreen wallpaper for themes"

This reverts commit 88521787023b351420a6f060de8394f837bf7a0d.
Tentacles qs tile: Revamp pngs
Cleanup theme assets when done with them

Before this patch if phone was left on long enough it would reboot
when a theme was applied due to files being left open.

Change-Id: I4c242249fcf6e8097789c3dd6690104296485784
Wipe all the ass(ets)

Change-Id: I75735144b97173e6b60cf47b673740a165fcc185
fb: fix qs battery tile on normal icon due of left over
I forgot to commit a change so on icon and icon percentage there
was still a margin set. Remove the magin to fix it

Change-Id: If8848835d2371b44d3dc414a9f30af03f222a895
Themes: Fix handling of overlay packages in AssetManager

The new theme engine did not handle the fact that a legacy
theme contained one package ID that was being used for both
framework and 3rd party apps.  This caused some issues with
styles not bein properly loaded from legacy themes.  Missing
action bars in some apps was the most noticable side effect
of this problem.  This patch takes this into account without
affecting themes using the new format.

Change-Id: I89b3dbf71db925726b949511a7e34a0d2949deab
FWBase: Audio Themes Support [1/3]

Change-Id: I698acc3e7843dcb38ba545219a21e9bee0b2fbe6
Signed-off-by: STELIX <ssspinni@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java
	media/java/android/media/AudioService.java
Revert "FWBase: Audio Themes Support [1/3]"

This reverts commit b1e12d9f9e2648f11f5106132a376940835e4a95.
Revert "Themes: Fix handling of overlay packages in AssetManager"

This reverts commit 284c178deca22c7dc91a5a148dab13e06c7e89b9.
Fix white space
[1/2] 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 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

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

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

Change-Id: Ic5c9b4eb03d2baa3b0ddfb3e9fcaf10d6e45dcd3

Frameworks: Do proper recent preload on hw key rebinding.

Current behaviour is that it is one time preloaded. And after that if again
a recent call is fired it does not preload again....which results eg on new
recents in not opening recent at all or on all recents in sometimes weird list
behaviour.

Ensure that the mPreloadedRecentApps is set back to false when an action
is peformed to give it free for next recent call. We either can assume
that it was cancelled allready (so mPreloadedRecentApps is allready false)
or that a recent action was called so we set it to false to give it free
for next call.

As well this commit removes the code duplication

Change-Id: Ib589356dde661476ee6090c437de7493eedcc10d

Frameworks: hw key rebinding. Allow virtual keys to preload recents

Apps like LMT or similar which send hw key events as virtual key
cannot load new recents right now due of missing proper preload.
Well it was before as well broken the old recents was just not that
strict then the new one....but it should be due that this was one of the
main reasons why the old one was buggy. Bad preloading

whatever fix it and simply allow virtual keys which fire app switchter
key to fire a recents preload.

Change-Id: Ic5c9b4eb03d2baa3b0ddfb3e9fcaf10d6e45dcd3

Conflicts:
	core/java/android/provider/Settings.java
	core/res/res/values/config.xml
	core/res/res/values/cr_strings.xml
	core/res/res/values/cr_symbols.xml
	packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Revert "[1/2] Slims Hardware Key Rebinding"

This reverts commit 7fa48dd3c1a66606639ca647fae2b60515ae42fe.
Style previews [1/3]

Change-Id: Ifed0ef7829eb61492a39395e8140b99f01c5e6a3
CM11 Themes: Put overlays in their own group.

Overlays will now be added to their own group and the
target group will contain a pointer to the overlay
package to be used in getResource and getBagLocked.

Change-Id: Icc6c6eb791f04966e68dbc099eae8e7129546414