services: fix memory leak in ColorFade

original patch from
   https://code.google.com/p/android/issues/detail?id=79729#c177

i can not get the email to add proper authorship, but all credits belong
to this person

Change-Id: Ica9a4ae02cd3c8435f46dd9c3bfdb52317f9a7ef
Systemui: Recents - do not add search widget on recents if widget is lost.

We have reports that sometimes under special circumstances the widget gets lost
and the view is added nevertheless

Ensure that if the widget loading fails that the id is set back to -1 to remove
the view.

Change-Id: I62f8dcea19817a243a001c80b6a4ab7b1e31a990
Revert "SystemUI: change back button to hide ime buttom with rotate animation."

This reverts commit 6c41953dfe241abdafa4d7839817458a61eac35b.
Clear Recent Apps (From NavBar)

Original author: TheMrcool212

this is not using cm's clear recents way, cm uses a button to clear recents but mrcool coded like pa's way at kk based pa roms so navbar recents button turns to clear all button when you open recents menu.

Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
	packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
	packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Change-Id: I4e44e827854b3b5be5e338b25935fe66ef11caa1

Conflicts:
	packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
Framework: Add enabler for Navbar Recents

Conflicts:
	core/java/android/provider/Settings.java

Conflicts:
	core/java/android/provider/Settings.java

Change-Id: I9ea455a4d67c55fc7a7b648121379a7ea3e1e1ce
Fix recents clear all

Change-Id: Ica9a4ae02cd3c8435f46dd9c3bfdb52317f9a7ef
Signed-off-by: iceandfire <arhamjamal@gmail.com>
SystemUI: Materialize volume panel in/out animation

* Thanks to @David96 that had the original idea, material
  oriented, already during kitkat times.

Signed-off-by: BigBrother1984 <carlosavignano@aospa.co>
Change-Id: Ic79d404c4a0d5bc0a83d20cd4e0d7d5ad7b7c90f
Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
ColorFade: Finish underping this before i get mad

* Don't release it twice, since we moved it to the finally {} body.
* See https://gerrit.paranoidandroid.co/#/c/109

Thanks @Evisceration for pointing that out, this has been a long day
going to underp things here and there.

Signed-off-by: @BigBrother1984 <carlosavignano@aospa.co>
ColorFade: Cleanup changes for memory leak patch

* Looks way better

Signed-off-by: @BigBrother1984 <carlosavignano@aospa.co>
Signed-off-by: @Evisceration <eviscerationls@gmail.com>
Change-Id: I116c474b999084e051a6815b17ed737f8128a750
Recents: Port "Development shortcut" (2/2)

This patch includes the equivalent of our Development Shortcuts in
CM11 recents. Recents is very different now and this is mostly a rewrite.

The semantics changed a bit as well. The current code already has special
developer behavior when long-pressing the app icon and that is also where
the developer shortcuts are hooked. If the app icon is long-pressed and
developer shortcuts are active, a menu will be shown with the several available
options.

Fixes CML-61

Change-Id: I391a360b3dd88e179c2315503d18125f8d0b3792
Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java
systemui: Forward-port notification counters

 * Port from CM11

Change-Id: Id9d0954acffd00bdb470b9eccbdb3b45fbd995c1
perf: Per-app performance profiles

 * Performance Profiles is going to grow into a much more powerful
   feature which can apply advanced optimizations or power saving
   techniques depending on both the state of the hardware as well
   as the current applications in use.
 * Refactor the original code and move it into PowerManager so
   that it's managed from the same place.
 * Implement "automatic performance profiles". This feature will
   automatically select a profile when specific activities are
   running. Currently this list is static and engages performance
   mode for several benchmarks (trollface).
 * Added support for a new power hint, POWER_HINT_SET_PROFILE.
   Currently, these profiles are fired using a property trigger
   in init. This is easy, but the PowerHAL can do more.
 * Moved the setting to Settings.Secure and also wrapped calls
   to the service in the DEVICE_POWER permission. Nobody should
   mess with this stuff except the system.
 * Powersave profile will automatically activate Android's built-in
   low power mode.
 * Original patch by Jorge Ruesga

TODO:
 * Implement API for per-app configuration by user
 * Quicksettings tile

Change-Id: I140ebc0648c4cf05900e005923247c3180be8c93
Signed-off-by: iceandfire <arhamjamal@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java
	core/res/res/values/cm_strings.xml
	core/res/res/values/symbols.xml