mutliwindow: notify split view if layout changed

Change-Id: I793b6d3dd05a5d1bbea178e646a1c6f14dec35c3
mutliwindow: notify split view if layout changed [2/2]

Change-Id: I2bbdd58dcf89cd70aa01a4c2bfc06641508f632c
[1/2] FW: LockScreen Notifications by AOSPAL

THANKS AOSPAL -> David L.-W <david.leppla.weber@gmail.com>

Port from: http://review.carbon-rom.com/#/c/1399/

My try on making notifications easily accessable from lockscreen.
Credits to ChameleonOS, I got the notification listener permission and some small other stuff from their ActiveDisplay implementation.

Lockscreen Notifications allow you to manage all your notifications directly on the lockscreen.

Features:
- Pocket mode turn screen on when phone is pulled out of pocket and turn it off when phone gets back in pocket
- Hide low priority notifications
- Hide non-clearable notifications
- Allow dismissing even non-clearable notifications from lockscreen
- Just turn screen on when there's currently a notification pending
- Toggle between expanded and normal notification view by longpressing

This should still be considered as beta, even if it seems to work very well for me.

Lockscreen Notifications: Make "wake on notifications" user configurable

and some other small changes that hopefully will improve battery live

Lockscreen notifications: make height user configurable [1/2]

Lockscreen Notifications: fix possible NPE

Lockscreen Notifications: try on fixing notifications sometimes not responding

Lockscreen Notifications: always scroll to bottom so one sees the newest notification first

Lockscreen Notificaitons: Fix NPE while on setup wizard on clean flash

Lockscreen Notifications: several fixes

- fix notification not responding when removed and added in a short period of time (e.g. gravity screen start/stop)
- just unlock screen on notification click when there's an activity to start
- fix notification hide animation
- just wake screen on reposted notifications when it's not ongoing (wake on notification before made the device stay awake for ever when a download/countdown or something similiar was running)

PS3: Fixes & New Options (privacy, position)

Lockscreen Notifications: just scroll down in "showAllNotifications"

Lockscreen Notifications: Copyright

Lockscreen Notifications: make offset top user configurable & add privacy mode [1/2]

Lockscreen Notifications: Fix possible NPE

Lockscreen Notifications: make width dynamic (WRAP_CONTENT)

PS4: clean whitespace
PS5: hope this fix the bug
PS6: Off by default
PS7: Fix logic
     Fix IllegalArgumentException

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

Conflicts:
	core/java/android/provider/Settings.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
multiwindow: Fix NullPointerException

Change-Id: I5c423bcde7d191331be53ce180f827e7023dc472
[1/2] Lockscreen Notifications fixes

- Lockscreen Notifications: make animations a bit faster
from: https://github.com/AOSPAL/android_frameworks_base/commit/5b6e143c4edeb9454650dbc05e597fbbae6b5c26

- Fix ongoing notifications reappearing when hidden & some small animation tweaks again.
from: https://github.com/AOSPAL/android_frameworks_base/commit/ac9bf6a36a7275d1e98e2ae6750723b1e006dd4d

-  Lockscreen Notifications: fix notifications disappearing on orientation change
from: https://github.com/AOSPAL/android_frameworks_base/commit/e9dcb99f0bd3e74a45ee7d15ebc19a99db7a09a2

Change-Id: Id72ec7c6c9e61fc7502299e434e0ba0d12957ec7
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

This commit adds image headers to the notification panel header,
based on the date/time. There are pictures for morning, afternoon
and night, as well as special events like Christmas and new
year's eve.
More will be coming, with eventually a way to use an external
(as in, Internet) provider for those pictures.

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

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
add necessary lines for 'breathing' icons

Change-Id: I1ed327de3de9e036583420669f9f4d209bfe07e9
Signed-off-by: scott <scott@ubuntu>
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
fb: Handle navbar heights correct on dpi changes + more (1/2)

Till now we set the height in px in the settings. Which is a problem
especially on multiDPI roms like we are when the user afterwards changes
the dpi due that it isn't calculated correct anymore on the new dpi.

This commit does
- save the dp value in provider and calculate the real px in fb
- clean up the settings stuff for it + do it a bit nicer (only settings part
  where we do not set the value for the listview)
- as well this commit disables movable navbar for tablets (we may will enable
  it in future but it needs a lot more work to have it on tablets correct working)
- add Converter class for common methods we always use....till now only px->dp
  and dp->px method

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

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java