[SQUASHED] Lockscreen Notifications [1/2]

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.

Signed-off-by: anerikg <anerikgames@gmail.com>

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

Lockscreen Notifications: Make "wake on notifications" user configurable

and some other small changes that hopefully will improve battery live

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

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

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

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)

Lockscreen Notifications: just scroll down in "showAllNotifications"

Lockscreen Notifications: Copyright

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

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

Lockscreen Notifications: Fix possible NPE

Lockscreen Notifications: make width dynamic (WRAP_CONTENT)

Lockscreen Notifications: make animations a bit faster

Lockscreen Notifications: fix notifications disappearing on orientation change

Lockscreen Notifications: disable dynamic width for devices <= xhdpi

Lockscreen Notification: fix default settings derp

Lockscreen Notifications: fix phone turning on in pocket

[1/2] Base: Lockscreen notifications: Allow apps to be excluded from being displayed

&& respect quiet hours

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

Change-Id: Ie0df1faedb275b1cf131d75d69d9d9cafc828dd9

Conflicts:
	core/java/android/provider/Settings.java
	packages/Keyguard/src/com/android/keyguard/NotificationViewManager.java

Conflicts:
	packages/Keyguard/src/com/android/keyguard/NotificationViewManager.java

Lockscreen Notifications: make dynamic width a device overlay setting

dynamic width is disabled by default, to enable it for a specific device, add
<bool name="config_lnDynamicWidth">true</bool>
to yourdevicetree/overlay/frameworks/base/packages/Keyguard/res/values/config.xml

Lockscreen Notifications: rewrite add notification logic

There were some problems with notifications getting replaced while the user was currently dragging them.
This commit should fix that by always waiting until animations and user input are finished before replacing a notification view.

Conflicts:
	packages/Keyguard/src/com/android/keyguard/NotificationViewManager.java

Lockscreen Notifications: dismiss all button, improve animations, cleanup

Conflicts:
	core/java/com/android/internal/statusbar/IStatusBar.aidl
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	packages/Keyguard/src/com/android/keyguard/NotificationHostView.java
	packages/SystemUI/res/layout/navigation_bar.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardTouchDelegate.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

Lockscreen Notifications: fix show/hide of show all button

& fix endless SystemUI FC when SystemUI is killed

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

Lockscreen Notifications: fix NPE

Lockscreen Notifications: Custom background color [1/2]

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

Lockscreen Notifications: try to fix occasionally SystemUI FC on boot

Lockscreen Notifications: fix FC when an expanded notification gets reposted without bigContentView

Lockscreen notifications: Add "show all notifications" navbar button

Change-Id: I0cd5b13e5644de36d24d4d693838bd7080f55412

Conflicts:
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java
	packages/SystemUI/res/layout/navigation_bar.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardTouchDelegate.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

Lockscreen Notifications: dismiss all button, improve animations, cleanup

Change-Id: I77665e37d823c619680312b73d5ebb1e6e437ffd

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

Conflicts:
	core/java/com/android/internal/statusbar/IStatusBar.aidl
	core/java/com/android/internal/statusbar/IStatusBarService.aidl
	packages/Keyguard/src/com/android/keyguard/NotificationViewManager.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	services/java/com/android/server/StatusBarManagerService.java

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

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

Conflicts:
	core/res/res/values-mcc206-mnc05/config.xml
	packages/Keyguard/src/com/android/keyguard/KeyguardViewManager.java
	packages/SystemUI/res/layout/navigation_bar.xml