PEEK [1/2]
Sensors are fully disabled when screen is on. When you turn the screen off,
it will start polling both gyroscope and proximity sensor values. If it detects
using the gyroscope sensor that device is lying on a table, it disables proximity
polling. If it detects with proximity sensor that it is in your pocket, it disables
gyroscope polling. This way, we save some battery from the beginning. Later, when you
receive a notification, it enables a partial wakelock (CPU on but at low frequency),
and starts listening for movement, either from getting it out your pocket or lifting
off from the table. If it detects those events, it will turn on screen and show the notification.
Wakelock timeouts on 10 secs, so if you receive a notification and there is no movement in that time,
sensors will stop polling after that time, disabling peek interaction until a new notification comes.
Peek doesn't process low and min priority notifications.

https://plus.google.com/+ParanoidAndroidCorner/posts/3wppxakBSVR

Contributors:
@D4rKn3sSyS
@Anu6is
@BigBrother1984

Change-Id: I995d17fde5a256f23fe37f35e43a0ee7e52663fb
Signed-off-by: Jesus David <jesdga95@gmail.com>
Signed-off-by: Curtis Mayers <curtis.mayers@gmail.com>
Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Change-Id: Ida92cb99dc703547c355fe520a25c53438ced1f4

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/values/axxion_dimens.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
PEEK: Beautify bridging layers code

* Save new instances for Peek and PowerManager:
    Create it only in BaseStatusBar when start() method is called. That one
    will be passed throught the sub layers such like new helper class so another
    feature can check Peek state invocking from NotificationHelper class.
* Move phone listener to new helper class.
* Do not show Peek on sim pin lock screen.
* Process new incoming notifications only if screen is off, keep updating notification array separately.
* General cleanup.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I9efde073df35b92e42b9faa9930d2fc39b3a43b9

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

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

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
[1/2] Add support for Peek app

Disable built in peek when Peek app is installed. Enable it again on app's unistall.

Change-Id: I292cfa6ba351ac65fd67d902b5e4df9be29981ac
Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
PEEK: configurable pickup timeout (1/2)

- Allow the user to set different pickup timeout when a notification comes up through PEEK.

Change-Id: Ifcd2f13101dcf6973ebcf016bce5f5314e1ce04c

Conflicts:
	core/java/android/provider/Settings.java
PEEK pick up timeout: ensure stock value on clean install and also show summary of it (1/2)

- This commit fix a derp where Settings.Secure is called and not the right one: Settings.System
- Inlcude a settings observer for futures ideas

Change-Id: Ic449ada65820cb6c73a7867d1d287f837c37c221
Peek wake timeout (1/2)

- Originaly taken from AICP - Thath's why i'm keeping original autorship
- Allow user to set how long peek notification will hold screen on
- Minor changes by me @cristianomatos to match crDroid sources

Diff from original commit:
* Variable declared globaly and moved from inside the private void scheduleTasks() method
* Made multi user

Original commit: https://github.com/AICP/frameworks_base/commit/90b47fc55ec59520d6dd5dd828ff48a3a3dca1d4

Change-Id: I3a3c7e6f99edd9c861566b2d738d31e7657a0322

Conflicts:
	core/java/android/provider/Settings.java
Apps: Add blacklist interface [1/2]
Include peek and floating mode implementations.
Applies to every floating mode launch way.

@cristianomatos: Include Halo in new blacklist button and some code adjustment and clean-up related

Part of this commit is also included: https://github.com/AOSPA/android_frameworks_base/commit/5a2d73e519c001359c4cd139164633ff02ed8658

Change-Id: I8b5f63e1ea3e47d22c1780aa9d29a9e958fbe97e
Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	core/java/android/app/INotificationManager.aidl
	packages/SystemUI/res/values/axxion_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	services/java/com/android/server/NotificationManagerService.java
PEEK: Sensors improvements

- Bring some fixes to the algorithm thanks to @D4rKn3sSyS
- Cleanup

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
NotificationHelper: We shouldn't use logical here, one case is enough no matter the order

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
NotificationHelper: Create broadcast receiver for Peek app

Store showing state.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
NotificationHelper: Define Peek app broadcast intents

Continue this https://gerrit.paranoidandroid.co/#/c/4369/

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
[SQUASHED] Lockscreen Notifications (1/2)

Following commits inside
AOSPAL/android_frameworks_base@3487cda
AOSPAL/android_frameworks_base@5873e99
AOSPAL/android_frameworks_base@7350e91
AOSPAL/android_frameworks_base@8d99eed
AOSPAL/android_frameworks_base@181110c
AOSPAL/android_frameworks_base@ce14cdd
AOSPAL/android_frameworks_base@3914e8d
AOSPAL/android_frameworks_base@32ec14f
AOSPAL/android_frameworks_base@6d2f41d
AOSPAL/android_frameworks_base@b758e16
AOSPAL/android_frameworks_base@6ba6fdb
AOSPAL/android_frameworks_base@b20bdc9
AOSPAL/android_frameworks_base@25f75c6
AOSPAL/android_frameworks_base@a74309e
AOSPAL/android_frameworks_base@5b6e143
AOSPAL/android_frameworks_base@e9dcb99
AOSPAL/android_frameworks_base@4caa49c
AOSPAL/android_frameworks_base@0f2377c
AOSPAL/android_frameworks_base@7e75b49
AOSPAL/android_frameworks_base@bc6c83f Thanks @Der-Schubi
AOSPAL/android_frameworks_base@8fd230d
AOSPAL/android_frameworks_base@e05eba6
AOSPAL/android_frameworks_base@082774a (Partialy ported - Removed codes of clear notifications navbar button)
AOSPAL/android_frameworks_base@a6f92e5
AOSPAL/android_frameworks_base@c3d76f5
AOSPAL/android_frameworks_base@5b1d884
AOSPAL/android_frameworks_base@0c0b133
AOSPAL/android_frameworks_base@73a6b7d

Change-Id: Ib87fe4d11941f7879f4706ad27ff3408311d2c03

Conflicts:
	core/java/android/provider/Settings.java
Remove file created by gedit in PEEK implementation

Change-Id: I00e1e5ad7a72c086a059450c5eeb94d8290892fd
Lockscreen notifications: Add "show all notifications" navbar button

Change-Id: I0cd5b13e5644de36d24d4d693838bd7080f55412

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

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
Lockscreen Notifications: dismiss all button, improve animations, cleanup

Change-Id: I77665e37d823c619680312b73d5ebb1e6e437ffd

Conflicts:
	core/java/com/android/internal/statusbar/IStatusBarService.aidl

Conflicts:
	core/java/com/android/internal/statusbar/IStatusBar.aidl
	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
Lockscreen Notifications: some fixes

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

Change-Id: I9388bcb899080cc023c146a083e554dcf8e57858
Lockscreen Notifications: fix show/hide of show all button

Change-Id: I3f17e91a619467426180813f8fe81d6f4514ab5b