NotificationManagerService: fix typo on led off time variable

Change-Id: Iade96474c26dbeb3a5a671170f563220562d9b3c
Finally fix incorrect flipping to quick settings.

Commit f6685c5ca84a42f5a47bf40827d6229dd998dee4 fixed this for the
two-finger pulldown. It reverted commit
c5e8dca7f11d3c085dd1e98692fcc21f1bcc0f6f in the process, which was
incorrect, but fixed another condition of this problem occuring
nevertheless. The actual problem the latter fix tried to fix was that
the flip decision was dependant on the timing of the view layout:
getMeasuredHeight() returned whatever was set in the last layout, which
might not have happened when hiding the view, so at the time of the next
ACTION_DOWN getMeasuredHeight() returned the height from the time the
panel was last visible.
Fix that problem by using the height scheduled for the next layout, so
we're always up-to-date.

Change-Id: Ib97f34f9aa0a6f28d48b4ec3e16c82a814cda0d0
Add long press on clear recents leads to clearing cache on device.
Put clear recents on bottom for easier reach on smaller devices.
Fix incorrect fragment animation used for hiding fragments

Mirror of support lib patch
https://android-review.googlesource.com/#/c/60032/ into
frameworks/base.

AOSP Commit: https://android-review.googlesource.com/#/c/60167/

Change-Id: I8d1cb2e217721336674b8e3e2ef8722a8d9baefd
Fixing crash in PhoneNumberUtils getNumberFromIntent

Handling intent with no data when trying to retrieve number from
intent.

AOSP commit: https://android-review.googlesource.com/#/c/57890/

Change-Id: If7c5930e7048aec732fb7a3fbeb3391e1408b071
Fix theme provider crashing for non-primary user.

PackageManagerService's context is for user 0, so if the theme provider
for other users was invoking the getInstalledThemePackages() method, the
themes provider crashed as it doesn't have the INTERACT_ACROSS_USERS
permission.
Fix that (and simplify code) by making getInstalledThemePackages()
return the installed themes for the current user, which was probably the
intent anyway.

Change-Id: I02002cee005b74128f3b2f7cc7a93b9b8514f1f3
Fix a number of multi-user bugs.

Signed-off-by: Paul Beeler <sparksco@gmail.com>
Navigation button color option (1/2)
Navigation button glow time and color (1/2)

Signed-off-by: Paul Beeler <sparksco@gmail.com>
User defined colours for pie controls (1/2)

Although SaberMod's colour scheme is normally fixed and only
changed by themes, this commit allows the user to change some of
the colours of the pie.

The rationale behind this is as follows:
Normally UI controls both - foreground and background colour of
each UI element. In case of the pie controls this is not possible,
pie controls are possibly overlayed in all screens of the UI and
all custom installed applications. This makes it hard to come up
with a universal colour scheme for pie controls.
In other words the user perceived "average" background
colour *) varies from user to user and thus universal colours
for pie controls are hard to pick.

*) It showed, that the background of the home
screen is major factor to this. Due to the fact that the
background is user settable, the colour range here is almost
infinte.

This commit adds:
* A user can change the following colours from within the Settings
  application:
  Normal button background, Selected button background,
  Long pressed button background, Icon colour
* Each colour can be reseted to the system default colour.

There is a seperate commit for the Settings application.

Signed-off-by: Paul Beeler <sparksco@gmail.com>
Revert "Add location (GPS) tile"

This reverts commit c9eb510f0a4c04bad15f384a120212919464dfbb.

Signed-off-by: Paul Beeler <sparksco@gmail.com>
HALO (1/2)

HALO is Androids one and only multitasking solution.

We explicitly do not go the Samsung/Cornerstone route. This solution is basically an extension of
the regular notificationshade, which is an aggregator for notifications that can be checked out when
time permits. HALO completes it by allowing you to respond to tasks on the spot, trying to be as
unintrusive as possible and flexible in regards to policies (white/black lists).

Features:

- Apps open up in floating state, apps underneath do not pause
- complete SystemUI & Core integration, making HALO feel like a native feature, source/SDK and UI/UX
- HALO has white and blacklists, which for now allow fine control for apps pinging through HALO
- multiple gestures to navigate HALO:
  - double-tap-move: move
  - tap-drag-left/right: task through notifications, finger up launches
  - tap-drag-up: dismiss notification
  - tap-drag-down: put HALO into semi-hidden state
  - swipe while HALO is hidden wakes it up
  - drag-to-X to remove HALO altogether
- comes with as few settings as possible, everything should be self explanatory and intutive,
  users must be informed about the double-tap gestures which is the only catch.

Known issues:

- Integration has been finished for PhoneUI. TabletUI and PIE must be integrated still.
- Packageinstaller must allow HALO through its overlay check or it will disable the install-app button.
- The low level has a few remaining issues:
  - Some apps still go up fullscale (they trick us with services, circumventing the intent flagging)
  - Some 3D games still pause
  - There is one known app that refuses to end on back or touch-outside, that is WeChat
  - The activitystack pause implementation works but is makeshift

To-Do:

- On-screen tutorial at first start up to teach users the gestures
- Fixing all known issues, full integration in the remaining UI's
- Perhaps hybrid engine integration for running floating apps in a decreased size

Signed-off-by: Paul Beeler <sparksco@gmail.com>

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