SystemUI: Bring some Swagger Back

Was missed during the toggle rewrite.
Sundays == SwaggerSunday

PS2:
Alphabetize imports.
Change-Id: I4a6e436dc1a90cea282b4dd5a1daff7c6df892bd
Fix race condition in backlight adjustment.

When configuring the automatic backlight levels, there's a race
condition in setting the lux and brightness settings as the settings
provider doesn't allow storing multiple settings atomically. When
deleting rows, there's quite a high chance of DisplayPowerController
picking up a state where the lux values already have the lower number of
rows, but the brightness values do not, effectively leading to an
ArrayIndexOutOfBoundsException.

Fix that by
- waiting a second of cool-down time until applying the settings and
- adding a sanity check for the very unlikely case that the delay
  between writing both values is > 1 second

Change-Id: I44e41530fc5334aaefc4ab7d3a90542f78fabe0c
JIRA:CYAN-755
It helps to catch the right exception.

Bug: 7238149
Change-Id: I7b60ec44d1d1d5ece8a871cb089f811b611f4a4a
Fix potential deadlock between LockScreen and WindowManagerService

If LockScreen is enhanced using SurfaceView/GLSurfaceView,
deadlock problem between LockScreen and WindowManagerService
can occur because of IWindow.resized() callback.
And it must lead to watchdog and reset.

IWindow.resized() callback is one-way function so calling resized()
callback of a remote IWindow object is never blocked.
However, calling resized() callback of a local IWindow object
(LockScreen is running on the same system_server process)
is always blocked until resized() callback returns.
Because resized() callback of SurfaceView/GLSurfaceView can lead to
WindowManagerService.relayoutWindow() call, deadlock can occur
between relayoutWindow() and performLayoutAndPlaceSurfacesLockedInner().
(Both functions need locking mWindowMap)

So this patch simulate one-way call when calling resized() callback
of a local IWindow object.

Change-Id: I2a6a5c74ed22d8e6b7a3bea3424ff2879d227105
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
hwui: This code should only be enabled with QCOM_BSP

 * Crashy crashy!

Change-Id: I1a06ac54a8ce2dccbf4a67424b0cbb6e7dd21e8b
Merge "Fix race condition in backlight adjustment." into jb-mr1
Merge "Fix potential deadlock between LockScreen and WindowManagerService" into jb-mr1
Merge "It helps to catch the right exception." into jb-mr1
SystemUI: Add LongClick to FastCharge Toggle

LongClick takes you to PerformanceControl

Change-Id: I6f4de9bccb99a471ab8cf35144be8cc1235a8e70
Signed-off-by: bmc08gt <bmc08gt.teamb00sted@gmail.com>
services: don't clear wallpaper when SystemUI
disconnects.

When we restart SystemUI (or the user), sometimes
the wallpaper would get cleared. This patch just
captures its originating component and
if that is our SystemUI component, ignore the event.

Change-Id: I3e159dc2c013e7d7e552e3c0cef55e3ab970ca87
Signed-off-by: Roman Birg <romanbirg@gmail.com>
Allow USB notification to show when primary SD allows UMS and MTP

Previously if primary SD is set to allowMassStorage="true" the USB
dialog would never show.  This checks if persist.sys.usb.config is
set to mtp,adb and then allows the USB notification to show. With
this you can then have the option to select from MTP, PTP and Mass
storage when clicking the pull down notification. When Mass Storage
is selected it activates the USB connected dialog to turn on USB
storage. When set back to MTP the USB connected notification disappears.

Change-Id: I2287075ec93cae75f19e8fb59965d9dddb234aca
Merge "Allow USB notification to show when primary SD allows UMS and MTP" into jb-mr1
Merge "SystemUI: Add LongClick to FastCharge Toggle" into jb-mr1
Merge "SystemUI: Bring some Swagger Back" into jb-mr1
Merge remote-tracking branch 'm/jb-mr1' into jb-mr1-2

Change-Id: I948c5d2569a057a0fdb4fee0ad346210baa99da3