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

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>

Conflicts:
	packages/SystemUI/res/values/pa_dimens.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	packages/SystemUI/res/values/ras_dimens.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Floating Window: Welcome back

* Port squashed jellybean floating window to kitkat.

Floating window contributors:
@drcmda
@beerbong
@D4rKn3sSyS

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

Merge notification manager service changes.

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

Change-Id: If3d6338f657915754bd6cb9cb987df62c17aa6d0

Conflicts:
	services/java/com/android/server/NotificationManagerService.java
Kill floating activities running in the same thread when tapping outside

This change makes all activities from the same app to be finished when we tap outside the halo window. Other apps running in different threads
(floating or not) won't be finished.

Port from here: https://github.com/ParanoidAndroid/android_frameworks_base/commit/f489f45ab2ba5dd4991c241917f7f4b0fd74b884

Change-Id: Ie6d6f46b2e23be60f991520ed480c2866fb2d0e3
Launch floating notifications from notification panel (long click)

 * Status bar - long click on notification select 'floating mode' option

fix derp in floating notification launch

Notification long press fix

Conflicts:
	packages/SystemUI/res/menu/notification_popup_menu.xml
	packages/SystemUI/res/values/pa_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	packages/SystemUI/res/menu/notification_popup_menu.xml
	packages/SystemUI/res/values/ras_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Recents: Launch as Floating App

Ported from JB 4.3
Based on hybrid (Aaron) and Halo (Jesus) implementation

Signed-off-by: Alexis Rico <sferadev@gmail.com>
Change-Id: I84f4d3928af5c6ddd96a9a173a1c24e85ff606dd
Conflicts:
	packages/SystemUI/res/menu/recent_popup_menu.xml
	packages/SystemUI/res/values-ca/pa_strings.xml
	packages/SystemUI/res/values-es/pa_strings.xml
	packages/SystemUI/res/values/pa_strings.xml
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java

Conflicts:
	packages/SystemUI/res/menu/recent_popup_menu.xml
	packages/SystemUI/res/values/ras_strings.xml
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
Fix for launch app in floating mode from recents

Change-Id: I216b02a60cd46b7fef49e04fe090169c4703bcb6
Keep app when opening floating window from recents panel
Dismiss IME when floating window is dismissed

Previously the IME would be stuck on screen if the
floating window was dismissed while it was showing.

Original id from PA gerrit -> Change-Id: I8ca61b07ed89bae85eabd8db23f87b6f1f0b179f
Signed-off-by: Evan Anderson <evan@thelinuxman.us>

Change-Id: If38e65f61ba309d22306bf4b37c3c55630c006ed

Conflicts:
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
[1/2] Prepare NotificationManagerService for new format

* Needed for blacklisting

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

Conflicts:
	services/java/com/android/server/NotificationManagerService.java

Conflicts:
	services/java/com/android/server/NotificationManagerService.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
Apps: Add blacklist interface [1/2]

Include peek and floating mode implementations.
Applies to every floating mode launch way.

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

Conflicts:
	packages/SystemUI/res/values/ras_strings.xml
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Conflicts:
	packages/SystemUI/res/values/simpleaosp_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
SwipeHelper: Ignore ACTION_OUTSIDE touches

  When using the swiper class within a layout like a notification container
  elsewhere the notification shade, when tapping outside even if the finger will
  not move is easy to detect an ACTION_MOVE event. That will consider it like a
  dragging event and the view swipes to left a bit on its own getting stuck
  until next touch. Break if tapping outside, so it doesn't go mistakely forward
  to ACTION_MOVE event case.

Change-Id: I07e5a3a95b8bbebeadcc97ba2d7d1cf787a37e61
Signed-off-by: BigBrother1984 <stevewatersy@gmail.com>
SystemUI: Expose heads up.

Signed-off-by: Roman Birg <roman@cyngn.com>
Signed-off-by: Adnan Begovic <adnan@cyngn.com>
Change-Id: I276cb1c80d392b7dbac28e5f553207415b558481

Conflicts:
	core/java/android/provider/Settings.java
	packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
HeadsUp: Clean up.

Change-Id: I98f445e7a4c92a34a3d9f63e14135e92416875ff

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
HeadsUp: Add heads up blacklist options. (1/2)

Change-Id: If9e5eed658871400b3c21d9354262e0887bc592e

Conflicts:
	packages/SettingsProvider/res/values/defaults.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

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

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
HeadsUp: Respect system decorations when adding view.

    - FLAG_LAYOUT_IN_SCREEN ignores system decorations, so
    a heads up view in landscape would end up underneath the navbar

    - FLAG_LAYOUT_NO_LIMITS allows the window to exceed the screen
    limits all together

      Removing both these flags makes Heads Up respect both system
    decorations and the screen limits.

Change-Id: I6f111e1c5701d493979be0cb596f11bc1b437fda
SystemUI: Improve HeadsUp expanding performance.

Change-Id: Ifd31caca6d2eb2432772b6a63f6b545f8288f449
HeadsUp: Launch in floating window

Add some part of NotificationHelper
Credits to AOSPA team

Taken from:
https://github.com/lion0738/android_frameworks_base/commit/9e4b4b3bf10ccaee3ff64bb7b74f929210b85d69

Change-Id: I7001cebd69790b46b8dcfe9150c7ef104e5427a2

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

Conflicts:
	packages/SystemUI/res/values/mahdi_arrays.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationHelper.java
HeadsUp: option to launch in floating window [1/2]

Change-Id: Ia8ffb4088f5b48b222a77ef486ba8b14e193c26f
PhoneStatusBar: Readd headsup view when theme change occurs.

Change-Id: I5bbfa56650a1b2f9cd9c4365650f769bed009ab0

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

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