GlobalActions: Fix possible race condition when showing dialog.

Depending on the presence of a previous dialog, the newly generated one
gets either immediately displayed (no old dialog) or shortly delayed
(after dismissal of the existing one).
If a new show event happens (by rapid fire of the power key, for instance,
using a keyboard with fast-repeating events) during that delay, a new
dialog will be immediately displayed, and when the delayed show triggers
it'll conflict with it (and bring everything down).

This moves the creation of the new Dialog object to _before_ showing
it (delayed or not), instead of the show method itself, to ensure the
object isn't clobbered by competing/sequential calls to handleShow()

Change-Id: Ie4d9a8507ebaf59da31869c38b98c3c98a74468e
Launch music player on headset connect

Launches the default music player when a headset is connected

Change-Id: Ib97077191c52b14e552265456312162b6ad3fdcd

Conflicts:
	core/java/android/provider/Settings.java
GlobalActions: Fix dialog dismissal

The themeability of the global actions dialog introduced by
change I644e2e8d7d4abf07bae639b606197d691f16adac broke the
hook that prevented multiple instances of that dialog, and
multiple instances of it will cause framework crashes due to
mismatches variable references (besides looking weird).

Fix it by restoring the original dismissal condition and forcing
a recreation of the theme context if necessary.

Change-Id: Ic6e06bef18fa9e09c84c774fa273f1b7e3bf9630
Navbar : Fix left over glow

Invalidate all buttons, to avoid nearby glow interference

Change-Id: I83ab05b91bd5db70390a5c9480513768864a2be7
Framework: Make Safe headset volume user configurable (1 of 2)

Patch set 1  : Initial commit
Patch set 2  : Alternative approach using content observer to
               listen for settings changes and react dynamically
Patch set 3  : Rebase

Change-Id: I0bd57334ca1307786eaed6578b216323e442f00e

Conflicts:
	media/java/android/media/AudioService.java
Option to use volume keys to control media volume anytime (2/2)

See Settings part for description

Change-Id: I78d26b0bd41f5b58514ae9c68208a8c950396823

Conflicts:
	media/java/android/media/AudioService.java
bootanimation: performance/speedup enhancements (squashed from CM10)

bootanim: Don't cache textures if they're expected to use a lot of VRAM (rmcc)
https://github.com/CyanogenMod/android_frameworks_base/commit/14f9eecd3f543a25c4a2053d6155a9396a777a3a#cmds/bootanimation

bootanimation: performance enhancements (turl)
https://github.com/CyanogenMod/android_frameworks_base/commit/e6b54405aa70d7503a114d9c90ef7518abdd7133#cmds/bootanimation

bootanimation: fix usage of LOGW (intervigilium)
https://github.com/CyanogenMod/android_frameworks_base/commit/e45cf7d232490f44aecf8f2447220a8b5ace4c10#cmds/bootanimation

bootanimation: allow using RGB565 instead of ARGB8888 (tpruvot)
https://github.com/CyanogenMod/android_frameworks_base/commit/204282870a9c69b04ad5ddecd73fafbd7996cbc0#cmds/bootanimation

Change-Id: I203fa23f77d1349fb822a7662e2cd3998ba4c814

bootanim: Don't cache textures if they're expected to use a lot of VRAM

bootanimation cached all the textures generated until the animation
was completed.
For Hi-res animations with lots of frames (like the new CM9 anim on
xhdpi devices), this implied using large amounts of video RAM, more
than most devices actually have available, causing the animation to
stall (and in some cases, gralloc to lock up); so if an animation is
expected to use a lot of RAM (rough estimation based on frame size
and number of frames), disable cache entirely and generate the textures
on demand

Change-Id: I157e5cdde2aab1d82d980d77cbedd9f127c83a1d

Conflicts:

	cmds/bootanimation/BootAnimation.cpp

bootanimation: performance enhancements

This patch implements two simple performance enhancements, which
might benefit devices. They are completely opt-in by setting
the following variables.

  * TARGET_BOOTANIMATION_PRELOAD: will preload the bootanimation
    zip to memory; this is handy on devices where the storage
    might be slow. By preloading it, we get quick access to the
    zip file, and the animation doesn't stutter.

  * TARGET_BOOTANIMATION_TEXTURE_CACHE: allows maintainers to
    force texture cache on/off.

Also fixes the sign warnings related to int / size_t comparison

Change-Id: Ie92d1b0aa90b43ba39c368a2a33657a60c3a64b5

Conflicts:

	cmds/bootanimation/BootAnimation.cpp

bootanimation: fix usage of LOGW

Change-Id: I1d59df9f44f414d80058a532644cbbb40e22c701

bootanimation: allow using RGB565 instead of ARGB8888

RGB565 uses considerably less memory, and together with texture
cache, it allows us to offer a really smooth bootanimation on
not so powerful devices.

Change-Id: I9da8fd7e6a587b5895519dd0983ec9b8f676771b

Conflicts:
	cmds/bootanimation/Android.mk
	cmds/bootanimation/BootAnimation.cpp