Allow creating custom dialogs in DialogPreference.

This allows creating non-AlertDialogs while still using the click and
state handling of DialogPreference.

Change-Id: I54fd7d6d6b9f6a49fef1ae95e0178838b3edfa56
Fix Photosphere/Camera FCs

Photosphere is setting a few parameters "blindly"
while the API says it should check the device capabilities first.

On TF101 (and probably other devices) the camera HAL doesn't handle
FLASH_MODE & SCENE_MODE and so it sends the required RuntimeException
for these, which makes Photosphere FC the Camera app.

=> Fix: check device capabilities & ignore these 2 parameters if the device doesn't support them.

Fix based on following Team EOS patch: https://review.teameos.org/#/c/1598/

Change-Id: Idd80299802e9213a3c40414ace3d516d39f47783
camera: Add support for sending raw commands

 * Certain camera drivers need magic commands to select special modes
   such as ZSL or HDR. Add support for sending raw commands from
   applications.

Change-Id: I512a765c7a67ffd2877e465cf6493ffc2b3b54ac
hwui: Don't discard framebuffer on exynos4

The layers gets empty/not cleaned and redrawn on top of the preview,
causing beautiful glitch on homescreen, and drawing black instead
of transparency.

Change-Id: I633b104224c73c625f1193ee3dde41823cddc5bf

Conflicts:
	libs/hwui/LayerRenderer.cpp
Wipe and re-create database on downgrade.

Not a very common situation but should fix some errors that could
 arise from flashing an old ROM over a new one, without wiping data.

Change-Id: I27f2a00396761105987830921bb3f8cb339d2171
Fix certain setting writes being incorrectly skipped.

If a value that previously had a very long value (over the 500 char
threshold) is now set to null, isRedundantSetValue would incorrectly
return true even though the value was changed.

Change-Id: Ia5304743024ec01024be98aa51ed260d38caf93c
Allow adjusting progress on touch events.

Change-Id: Ide0a7ae057a62f3631a32eeaa63f3e04dec5bf54

Conflicts:
	core/java/android/widget/AbsSeekBar.java
Frameworks: apple can do...we can do as well

incredible apple engineers speeded up the overall UI and reduced per default slightly
the animation scales. Well we do as well and reduce it from 1 to 0.75...smooth, looks well
and does not break anything

Change-Id: I336b95bf198f15edaa4d058db435a2e46c6d8923
BatteryService: fix FC on boot until battery stat is present

updateLightsLocked() can be called from CM's added SettingsObserver
when battery stat is not present, causing an FC and a loop until
battery stat is present.

I/SystemServer(  502): Battery Service
E/System  (  502): ******************************************
E/System  (  502): ************ Failure starting core service
E/System  (  502): java.lang.NullPointerException
E/System  (  502): 	at com.android.server.BatteryService$Led.updateLightsLocked(BatteryService.java:735)
E/System  (  502): 	at com.android.server.BatteryService.updateLedPulse(BatteryService.java:709)
E/System  (  502): 	at com.android.server.BatteryService.access$1600(BatteryService.java:86)
E/System  (  502): 	at com.android.server.BatteryService$SettingsObserver.update(BatteryService.java:860)
E/System  (  502): 	at com.android.server.BatteryService$SettingsObserver.observe(BatteryService.java:822)
E/System  (  502): 	at com.android.server.BatteryService.<init>(BatteryService.java:187)
E/System  (  502): 	at com.android.server.ServerThread.initAndLoop(SystemServer.java:328)
E/System  (  502): 	at com.android.server.SystemServer.main(SystemServer.java:1309)
E/System  (  502): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/System  (  502): 	at java.lang.reflect.Method.invoke(Method.java:515)
E/System  (  502): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
E/System  (  502): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/System  (  502): 	at dalvik.system.NativeStart.main(Native Method)

Change-Id: Ic4438fe50e98f1aa05ae1d0d26240bf9410fd92f
Properly handle null URIs.

Change-Id: Ib81044686f40284bacf6ee645c671679f62be843
fix for screenshot animation glitch in portrait

edits by Stefano Semeraro aka Suxsem.

Change-Id: I7a03a24c5b1bfdfe616f940b2bd7be42091f45a6
Make ImageView drawable update more efficient in some cases.

When updating the view's drawable via setImageResource or setImageURI,
make sure to skip the layout pass if the old and new drawable have equal
sizes. This follows what is already done for setDrawable().

Change-Id: If73d225e38d0a2f7c616c4aeb33f67bdaed390f1
base: fix external sdcard mountpoint

It needs to add that line on init.xxxx.rc on rootdir folders.

"chown root root /mnt/media_rw"

Needed for devices that has some troubles mounting storages.

Credits: http://forum.xda-developers.com/showthread.php?t=2537793

Change-Id: I0c9e2ae5439c8d8a762904e2760eb6590ce77a62
Make "SD Card removed" notification dismissible if the removed SD Card is not the primary storage

The Galaxy S uses the "external SD Card" as the extended storage
and it the notification should be dismissible as it's okay not
to have it.

Additionally, this patch also not hide the USB storage mount dialog
if the removed storage is not the primary storage

Adapted for CM 11

Change-Id: Ic752a3da917e0d7736a619fb68f07905106987fb
SystemUI: Add missing recycle calls

Change-Id: I6e5346d9f423350e643d696299136799b78cdd28
Screenshot Delete thanks to DvTonder and

PA where I saw this patch. Changes to original:

minor cleanup + added all needed drawables (xxhpdi and mpdi)

Change-Id: Id458312cd6a66d12caa6ceffba3ba13547caa939
Signed-off-by: Andre Saddler <dresadd09691@gmail.com>
AudioService: fix safe volume enforced even when disabled

On onConfigureSafeVolume, the proper API was not used, leading
to the setting not being respected. Sometimes after boot, the
heaadset volume will be set back to the safe volume.

Change-Id: I5ba8bb1a18ce97ed64646663c7e75cb277356778
AudioService: Show safe volume panel for non-interactive volume adjustments

If safe volume is active, apps calling mp.setVolume() to adjust the
headset to a value higher than the threshold will have the operation
fail silently because no volume dialog is active to pop up the
"do you wish to override" question.
This is particularly bad for peripherals that use the audio jack
(Square readers, Jawbone bands), since they usually require levels
close to maximum for proper communication and the app isn't prepared
to deal with a silent rejection of the requested volume.

Change-Id: I2047d199506106a87841b8b680007c5ab45b527b
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
ServiceState: add support for DCHSPAP

Change-Id: Ib0a328652c14580718400b00146b770481be5458