[1/2] Lockscreen Notifications fixes
core: Update to new settings icons

From PA: https://github.com/AOSPA/android_frameworks_base/commit/f56b8507eeb9bdb141af4c06e7d4f967f42ca9e9

check link for preview

Change-Id: If8cec874264715d286476b41d2e26717cdd86588
[1/2] LS Notification dinamic width & blacklist options

- Lockscreen Notifications: disable dynamic width for devices <= xhdpi

- [1/2] Base: Lockscreen notifications: Option to disable dynamic width
from: https://github.com/OmniKang/android_frameworks_base/commit/87d6598b63a1b83e93631b0fcb0822365cf7563b

-  [1/2] Base: Lockscreen notifications: Allow apps to be excluded from being displayed
from: https://github.com/OmniKang/android_frameworks_base/commit/8631349b965f507eeff4b5616c1f581bc4e6e615

 Credits to 0xD34D / ChameleonOS for the original implementation for Active Display

PS3/4: fixes

Change-Id: I796b08cb94185ea17139bd74f1b41d287ba65155
Lockscreen Notification: fix default settings derp

Change-Id: Ief7344359059d72b6498d9d9ce61dfd11b43f404
Lockscreen Notifications: fix phone turning on in pocket

Change-Id: Ia0385280510f1d684c5dcf537dd2049c6916ddec
System bar color WIP

Both status and navigation

Ps3: fixes for 4.4.1

Change-Id: Iea59a7550925bcaf85e4faf86811562d039668cc
Signed-off-by: scott <scott@ubuntu>

Conflicts:

	core/java/android/provider/Settings.java

Conflicts:
	core/java/android/provider/Settings.java
[1/2] SystemUI: Add time-context headers to the notification header
add necessary lines for breathing icons
SystemUI: Fix notification header disappearing on tablets

For some reason, the notification panel header has weird dimensions
when it has anything else than its original ColorDrawable as
background, and only on tablets.

We workaround this by not changing the drawable until requested.

Change-Id: Id76a5dcacf59c35b2e49681d6eeb4e828f7cbc58
[1/4] base: Audio Themes Support

Change-Id: Id80dc7f0bcbd39b5305d6ea0fb8bd9fa516f3634
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	core/java/android/provider/Settings.java
	media/java/android/media/AudioService.java
	media/java/android/media/MediaActionSound.java
fb: handle for our navigation bar recentspreload in the button

Recents screen is since some time wonky. With new hardwarekey rebinding
it showed now only more how wonky it is due that home button does not
cancel the preload always to keep the hwkey button logic alive.
As well a problem is that if you bind recents to whatever other navbar
button the preload takes no effect at all (is only binded from google to
the recent tagged view)

Whatever to solve this let the buttons itself decide dependend on the
action if a preload or cancelpreload is needed an peform the action.

This solves all the weird recent screen behaviours and we will need it for
the new recents screen which is in development as well

It looks a bit weird to aquire the statusbar service here for this but in the
button itself there are not much other alternatives. In theory we could set listeners
like google but instead to all buttons and fetch the action from there to decide but
this gives a problem to get if it was a longpress recents or a normal press recents.

So this way seems to be ok.

Change-Id: I9b3b08356f72840399eaabd0be8b0c3fdf09a4bd
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
fb: handle globalmenu in SlimActions not over Powerbutton anymore

We used till now a hacky workaround to show up the Power menu which worked
but is indeed not the best way. Last tweek on it broke 3rd party root application
which use similar hackish workaround.

Whatever make global menu over wm service available and call it from
SlimActions directly. This respects of course the usual security checks
if the device is provisioned etc

PS
- derp
PS
- puh I just should go sleeping :(

Change-Id: Ia12ce467cee0d60741079b3fa2c78449d707a09f
Signed-off-by: scott <scott@ubuntu>

Conflicts:
	core/java/android/view/IWindowManager.aidl
	core/java/android/view/WindowManagerPolicy.java
	core/java/com/android/internal/util/beanstalk/SlimActions.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
fb: unbreak recents animations on thumbnail click or dismiss recents screen

We load now correctly the recents screen and preload the first task on press
down off any key to get always recents without issues up. We cancel only
if any other key was pressed. I discovered during I am working on new recents
that this solves all issues but has one downside that if he user dismiss he recents
screen or click on one of the thumbnails to bring the choosen app to forground
that of course the last thumbnail is not cleared. Due that the entry animation
and some other things depent on what is currently preloaded we need to cancel
first task to have always in all cases the right animation.

Fix it with just calling cancelPreloadingFirstTask() if the user either
clicked on one of the thumbnails or dismissed the recents screen.

PS
- do the same when all thubmnails are swiped away
PS
- derp

Change-Id: I786c05d929f6a02b6d4928fc4a96aeb9a8e2d03e
Fix dest == src bugs in Matrix.cpp.

The main bug was that the AutoJavaFloatArray autoSrc was not passing in
read only. This meant that the destructor overwrote the data which
the autoDst AutoJavaFloatArray had written in it's destructor.
This case only happened if src == dest and the arrays were copies.
Also improved performance by passing in read only a few other places.

Bug: 12570144

Change-Id: Idc8764087dc165433c584b87a0f9d4ed0ec795e8
[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager

Symptom:
When press Home key to home screen, user is able to see the activity's window shown on top of wallpaper and below launcher(widgets).

Root Cause:
The ensureActivitiesVisibleLocked() is called pretty often (for example when a new process bound).
If the top activity "B" was finishing, then the previous activity "A" should be visible.
Therefore, the activity "A" window will be set to visible and then launched activity "A", but it does not updates the visible state in ActivityRecord for "A".
There has a timing issue that if a new activity "C" is started, "C" becomes the new top activity and be resumed.
In that case, Activity "A" window will remain visible even if it is behind a full screen activity "C" because the ActivityRecord.visble of "A" is still false, so the window visibility won't be update.
So when user press home key and back to launcher, the surface of activity "A" will be composed on top of wallpaper.

Solution:
Updates ActivityRecord.visible to true for "A". After "C" is started, the "A" will be called WindowManagerService.setAppVisibility() to set invisible, then called onStop() when execute ensureActivitiesVisibleLocked() again.

Change-Id: I536ba04b95d8d274fea6d679a6493e620bc981e2