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
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
Frameworks: Fix 0% battery QS tile

when tile is created. Fetch the values from
BatteryController

Change-Id: Id0539016e1c479ac1f75535647d91a26f69a76b5
Frameworks: fix QS shorcut picker icons

drive, direct message and direct dial showed
the wrong description due that the drive icon
was in wrong order

Change-Id: I69073dc409ff7f25135c6dbf0699fa3e406c169d
Frameworks: several fixes for TouchKey light duration

1. allow on all states window manager to overwrite current
   brightness state
2. fix duration calculation problem

Change-Id: I9956b1e6b9cca9d0823cb22749b3d2ec108e3c2b
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
Frameworks: fix typo

causes broken backlight on hardwarekeys
if it is set to always on

sorry for that

cheers

Change-Id: I4747239f681f4714ac1ab767a1be48219e1b620f
Don't assume any ringtone is present on external storage.

If that assumption doesn't hold true, the user will lose his ringtone
and won't know why.

Change-Id: I89409e1351792d020c5458f5104f4bb9f2a040f2
Expand Profiles [1/2]

This commit expands the profiles power menu entry in the to be
- Always hidden
- Hidden only on the lockscreen
- Always show [not applicable to secure lockscreen]

Change-Id: I2e7262abc4043523150e96b330f92c8c042d1d2a
Lockscreen : Fix widgets disabled

Currently, when keyguard widgets are disabled via the DevicePolicyManager,
a default widget if specified via widget_default_package_name/widget_default_class_name
is added on the main screen, and if not successful the default status widget is added.

However in its current state, each cycle of the lockscreen alternates between the two widgets.
Reason is, the default app widget is constantly recycled on screen power cycles, and in such events,
when checkAppWidgetConsistency() fails to add the widget (since the id is no longer valid), it toggles
back to the default status widget, and resets the stored id. Next cycle a new id is allocated and it works
and so on ...

This patchset addresses this issue by not removing the default status widget if not necessary, hence
preserving its id and fixing the toggling issue.

Change-Id: I6b21d18346fed5accc72141097939c92ee9aaa3c
Merge "Lockscreen : Fix widgets disabled" into jb4.2
Add Statusbar Quick Peek [1/2]

Adds the ability to peek at the statusbar when hidden
by swiping down from the top edge of the screen.

PS 1/3 : Fixed Derp!
PS 4   : Added Fullscreen app support!
PS 5   : Added Pie Detection
PS 6   : Derp forgot the TOP Flag!
PS 7/9 : Some fixes

Change-Id: I4beda91e21518cd2fa391ff1b0fe23ea8e24370e
Frameworks: reduce navbar observer footprint (1/2)

time for code cleanup projects. Switch to same
logic we already use in QS/NT shortcuts. Use
only one string for the whole navbar config
This reduces massive the observer footprint.

NavRing and SlimPie will follow with same logic

cheers

Change-Id: Ie484bf72ae6e9cefa5cd979bbb279fa8549b8fdf
Frameworks: reduce navring observer footprint (1/2)

time for code cleanup projects. Switch to same
logic we already use in QS/NT shortcuts. Use
only one string for the whole navring config
This reduces massive the observer footprint.

This commit should as well the manta navring issue
in landscape

SlimPie will follow with same logic

cheers

Change-Id: I72cec6dce054674faf200864473d140581c68fa7
Frameworks: reduce SlimPie observer footprint (1/2)

time for code cleanup projects. Switch to same
logic we already use in QS/NT shortcuts. Use
only one string for the whole SlimPie config
This reduces massive the observer footprint.

cheers

Change-Id: I884c5d25c682e06d6649a16c2ba6d84460a3776f
[2/2] Permit home button wake to be configurable

To make appear add this to overlay

https://review.slimroms.net:8443/#/c/14077/

Change-Id: Ie52247d5c23c8f840ababc880dd41992049cefd1
ThemeUtils: Retain the original package name in themed UI context

In order for themes to reflect on system elements, we're changing
their context, including the package name.

This breaks anything that tries to identify system elements,
most notably any users of the uiautomator. Trying to do
'UiSelector().packageName("android")' to find, for example,
a force-close dialog will fail.

Fixes com.android.cts.uiautomatortest.CtsUiAutomatorTest#testUiWatcher

Change-Id: Ic05c3024b20ac3772ed5597846fbfa4a184ebb0d
Fix ringer mode being unneededly changed by setting ringer mode volume
to 0.

When having set the ringer mode to silent on a device with vibrator and
calling setStreamVolume() for the ringer stream again (e.g. in one of
the volume control dialogs in the settings app), the ringer mode is set
to vibrate, although there's no reason to do so.

Fix that by remembering the last non-normal (that is, either silent or
vibrate) ringer mode and using that when setting the stream volume to 0.

Change-Id: I27f1c75a0fef52bd63ac20f4101042808ce2c458
JIRA: CYAN-1403
Merge "Fix ringer mode being unneededly changed by setting ringer mode volume to 0." into jb4.2