Fix Derp
Make notification_header_bg a .9.png for better theming

Change-Id: I477872ac49b1bbb77e44b9aa9bedd4d27643ea4f

Conflicts:
	packages/SystemUI/res/values/colors.xml

Signed-off-by: dragon <dragon7780@hotmail.nl>

Conflicts:
	core/res/res/values-mcc272-mnc05/config.xml
lvs: transitioned volume steps volume normalization.

-This calculates an equivalent volume ratio for the new
volume steps.

-example: Volume steps are set at 60. Volume is set at 5. That is
very low volume. Then volume steps are switched to 5. Now you
are instantly in a state were your volume steps are 5 and your
volume is 5. That's full volume! This fixes that issue.

-So it basically keeps the volume from jumping around while your
changing volume steps. It may be a little lower but should be
very close.

Change-Id: I5151938997cde9932ee492615dc9bf68c80ca895
Volumes in Settings/Sound is slow to start

There is a delay after pressing volume menu item
there is a delay until the Volume popup is shown.

The reason for this is that the initialization of
the different seekbars is slow and run in the main
thread. More specifically the call to get the
ringtone from the RingtoneManager is causing this
delay.

Moving the call to the ringtone manager to the
handler thread used to play ringtones to make
the launch of the volume dialog a bit snappier.

Change-Id: I76da0226592468debd542d67164b37b2b59897c7
Solve three memory leaks related to PatchCache

A Patch can be fairly large, holding bitmap data, but
is also frequently leaked which adds to the severity.
The feature is used in many important processes such
as Home, SystemUI and Chrome.

The following leaks are solved:

1. The Patch itself was not always freed.
PatchCache::removeDeferred() can mark patches to be
cared for by PatchCache::clearGarbage(). But
mCache.remove() would only destroy the container
and the pointer, not the Patch object itself.

2. The vertices stored in the Patch at Patch::createMesh()
would always leak. The empty/default destructor in Patch
would not properly destroy "vertices" since it's just a
pointer.

3. A BufferBlock that's added to the mFreeBlocks
in PatchCache could leak. The leak happened when a
patch later needed the entire free block, because the
object was removed from the list but never deleted
in PatchCache::setupMesh().

Change-Id: I41e60824479230b67426fc546d3dbff294c8891f
frameworks/base: Fix the random UI corruption

On low memory device, when a view goes to background. Its HW layer cache
will be destroyed to release memory. There is a very rare case that the
hardware render is not valid when destroy the layer, so the layer is not
destroyed and reused when the view comes to foreground. But the GL
context has changed, so the view is not rendered correctly due to its
HW layer cache. To fix this issue, destroy the layer in a safelyRun. Make
sure the layer is destroyed correctly.

Change-Id: I1c714e1d53db7353d5169e874a7cd0f527c3f67b
CRs-Fixed: 623239
Parallel shutdown

Decrease shutdown time by doing some shutdown tasks in parallel.

There are two threads executing during the shut down: the ShutdownThread
and a separate thread for the radio shutdown. However, the execution is
done in serial, as the ShutdownThread immediately joins on the radio
thread.

This commit will move the shutdown of the radio to the beginning of
shutdown and execute it in parallel to the shutdown of the rest of the
system.

The flow of the two threads during shutdown is now:

Radio Thread
  * Start shutdown of the radio
  * Wait for radio off or time out
  * Notify that the radio is done
ShutdownThread
  * Broadcast ACTION_SHUTDOWN as a parallel broadcast. (The receivers
    will get as much time to handle onReceive as it takes execute the
    rest of the tasks in the shut down flow. If they are not done in
    that time, we don't care.)
  * Shutdown ActivityManager
  * Shutdown MountService
  * Wait for MountService and radio to notify done
  * Vibrate
  * Low level shutdown

PS
- fix derp

Change-Id: Ifdd8a9c75337fd9d00148a0d2b9917e10fa60634
Flip preferences
[1/2] SystemUI: Add brightness slider to notification drawer

adds a brightness slider below the expanded statusbar header and
(if enabled) quick settings ribbons

also wrap an if around gesture recorder in the fling methods, only
call them if DEBUG is enabled.

Change-Id: I65077f5ddb20aa9f13813eedfaa0cb09a667eb88

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

Signed-off-by: dragon <dragon7780@hotmail.nl>

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
Squashed On-The-Go mode (1/2)

On-The-Go turns on the camera of your phone and streams it to an overlay,
which is drawn over everything.
this makes you feel like your display is transparent, as you see the content
behind it.

its really useful when you are using your phone while walking, thats why
we called it "On-The-Go"

allows to change transparency of the overlay via the notification.

Modified parts of the code to make working for FusionSP
Enable/disable with QS tile, longpress on tile for options.

Credits: NamelessRom

Signed-off-by: dragon <dragon7780@hotmail.nl>

Conflicts:
	core/java/android/provider/Settings.java
	core/res/res/values/fusion_symbols.xml
	packages/SystemUI/res/values/slim_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java
	policy/src/com/android/internal/policy/impl/GlobalActions.java
Attempt fix
On-The-Go Fixes and additions

1. Toggle flashlight when shaking
2. Turn stop and start service if screen turns off and on

Credits NamelessRom

Signed-off-by: dragon <dragon7780@hotmail.nl>

Conflicts:
	packages/SystemUI/src/com/android/systemui/limpio/onthego/OnTheGoService.java