[1/2] Base: add support Tinted System bar

thanks to ChameleonOs and Thinking Bridge for the base code
also thanks to @MuhammadAG for Actionbar implementation (Xposed-Tinted-Status-Bar)

this allow statusbar an navigationbar background to follow color from Top and Bottom of application

see https://plus.google.com/107971916147063794392/posts/Eaqn5UAvKDt

as bonus, we can call blurbackground from here too :)

PS.6 :
   performance increase
   fix stability
   fix tinted statusbar cant turn off
   fix activity loading

PS.7 :
   improve performance
   smooth color change
   add more option xD

PS.8 :
   more stability
   improve color animation

PS.9 :
   fix FC some apps

PS.10 :
   stay away from broadcast
   make new API for communication with statusbar
   make color extractor more faster
   fix some bugs if disabled

PS.11 :
   remove gradient option this not working always
   fix where color not change if parent view has actionbar

PS.12 :
   fix white space xD

Change-Id: I40f533dd404a02e10a85fed78123c60ffd51f387

Conflicts:
	core/java/android/provider/Settings.java
base: fix init handling of tinted system bar

force same behaviour like after changing setting

PS. 2 :
   fix initial background color

PS. 3 :
   make sure initial gradient is 0

Change-Id: I87eddcaa5223c1af15fa8c089f22ed9cb4774f7b
Base: fix logic tinted system bar

1. fix action bar make statusbar icon changes with same color action bar text
       if current action bar background is null
2. move log into each bartransition so we can track what is changes
3. make process not changing system bar color
      if current screen color is same with before (less draw)
4. always reset system bar color when launching new apps
5. fix color changes using 3rd party app keyboard

Change-Id: If53178e24caae7dff30636eda440d0e618702e3e
Base: improve color fetch calculation

this also fix calculation for device without navigation bar

Change-Id: I5ea3fb5dd18dadf1ced0255b3bf6554a7b50079c
Base: respect layout changes before sending color broadcast

currently tinted system bar process is smart enough to determine
   when system bar need to change the background color
   now this patch improve how this process is done when when there is
   layout or window changes

example:
   open app, press home button
   open other app, press home button
   open recent or Omniswitch, open one of apps in there
   open again recent or Omniswitch, open other apps
   now system bar will take responsibility to changes the background color

another example:
   open app that has many activities like G+
   open notifications menu or input a message to post
   see system bar will take this layout transition to changes background color

for a scroll view, currently still need a touch to take process, because
   "View" is not a layout transition, so there is no way to take this to call tinted
   system bar process

fix notifications icon color not update after added
cleanup unused function

Change-Id: I0c69ad963d1589d6aad7c0135ed1007cbd2b4bba
Base: fix and improve tinted system bar

this also fix :
navigation bar button color not update
action bar color extractor
network activity color not update
color progress not apply to current configuration (on rotation)
some apps FCs e.g Google Earth and Plumbers

Change-Id: I748a24ab5467a9936cbd8decb37295edaeb93f64
Base: allow to determine dominant color for notifications icon

this also fix current color after screen off

Change-Id: I7af3210a67219cf6af85852a108081aa784681e9
PhoneWindowManager: fix derps
Tinted system bars: add color switching ability for battery
Tinted system bars: add color switching ability to carrier label
Tinted system bars: Fix Themes FC and reboots
Tinted system bars: fix coloring some more navbar icons
Tinted: Speed up with compromise

Change-Id: I64776d4a9cb36a84a2637fab2a61a0eb4cd1862e
Tinted bars: fix battery percentage and frame color for icon style

-clean up CarrierLabel.java
-fix landscape navbar/buttons color thanks to @LorDClockaN
Notification count: update backgrounds & text color to match kitkat ui

-also add duplicates in inverted folders to keep inline with trds themeing
Themes: Force recompiling common resources when scanning theme

If a theme is re-installed multiple times and in less time than
the 3 minute timout for common resources, it is possible for the
installation to fail because it does not compile the common resources.
This is not something an average user would encounter normally but
theme designers that are working on there theme and constantly
installing updates have a better chance of encountering this situation.
We simply remove the theme from mAvailableCommonResources which will
allow them to be recompiled.

Change-Id: I04b64645157dbb1d0c26fab95c851b34bfff3f42
Only start one WifiClientScanner

*) Fixes unexpected soft reboots.
E/AndroidRuntime(18586): *** FATAL EXCEPTION IN SYSTEM PROCESS: WifiClientScanner
E/AndroidRuntime(18586): java.lang.IllegalStateException: Cannot execute task: the task is already running.
E/AndroidRuntime(18586):     at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:576)
E/AndroidRuntime(18586):     at android.os.AsyncTask.execute(AsyncTask.java:535)
E/AndroidRuntime(18586):     at com.android.server.connectivity.Tethering$WifiClientScanner.handleMessage(Tethering.java:596)
E/AndroidRuntime(18586):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(18586):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(18586):     at android.os.HandlerThread.run(HandlerThread.java:61)

*) Remove unnecessary mDoScan class member variable.

Change-Id: I17ab368366b9a3456a625974c461783c428efec2
Fix wrong scaling of QS tiles

Also increase margin with the number of tiles shown
and tweak sizes for better usability

PS2: Whitespace fix

Change-Id: I78a1e0d41d487ac48edc5f8992b7d5c95fbbfa71
Support full size application screenshots

Add optional width and height parameters for
ease of capturing entire application screenshots

Change-Id: I6d154f6b33bfb8ec90e3757a40382c1dc6feaad3
Add Transparent Status Bar for low ram devices

This commit add the possibility to enable transparent statusbar by adding persist.sys.force_highendgfx=true in build.prop on devices with
ro.config.low_ram set to true