Bugfix: Dock events can have state greater than 1

On Samsung devices the USB audio is being routed for every dock event
It is ignoring the checkbox (in advanced settings) to not route audio

This bug was introduced with this patch
http://review.cyanogenmod.com/#/c/24830/

The state of an event can be 2 or 4 depending on the dock type

This patch switches for looking for state > 0 rather than  state ==1

Change-Id: I978d18ec36e74e821a6d300136377158901cdf50
Allow airplane and silent power toggle (2/2)

Based upon the system already in place by DvTonder

Change-Id: Ibf2587da48679c039f335085fe9b78d493eac158
Merge "Bugfix: Dock events can have state greater than 1" into jellybean
Call to equals() comparing different types

I have found the bug with the FindBugs tool (http://findbugs.sourceforge.net)

Call to String.equals(android.content.ComponentName)
at ActivityManagerService.java [line 8874]
in method dumpActivitesLocked(..)

Change-Id: I99851de024b55b53f1b206f0645b6fe29f865784
NullPointerException in UsbStorageActivity and SQLiteSession

FindBugs description:

Null pointer dereference
A null pointer is dereferenced here. 
This will lead to a NullPointerException when the code is executed.

Bug kind and pattern: NP - NP_ALWAYS_NULL

Change-Id: I292a29058de1828f376564188a2e00c61ea194b0
Merge changes I292a2905,I99851de0 into jellybean

* changes:
  NullPointerException in UsbStorageActivity and SQLiteSession
  Call to equals() comparing different types
Add SET_ALARM permission for SystemUI

If one or more third-party alarm clock app is installed, clicking clock should open an app chooser for the alarm clock. However, permission for com.android.alarm.permission.SET_ALARM is required to make this behaviour work properly.

See http://forum.xda-developers.com/showpost.php?p=33155463&postcount=2749 for symptom if this permission is not assigned.

Change-Id: Iaf8cb9aba6e53da021da5373493b1419096e91fa
amlogic: add ro.vout.dualdisplay3 support
Merge remote-tracking branch 'cm/jellybean' into jellybean-aml
fix a misspelling / typo.

Change-Id: I24f206fe6e8077387112b9ea420752ede1ed4ec4
framework/base: add translation for Recovery

Change-Id: Ib26af528cc7c2fb3edbbd6abc163795ea8f5efc6
Merge "Add SET_ALARM permission for SystemUI" into jellybean
frameworks: add dock battery drawables for HDPI devices

Change-Id: I8cc2cfc74548693ffbdd48447d7fa414fd451f59
CircleBattery: Revamped charging animation

Youtube Video: https://www.youtube.com/watch?v=nztroKnBDPs

Patchset 2: removed obsolete mPaintAnim

Change-Id: I629614497fc47d96eda03912d5dac4d6dd2ed0df
Possible NPE in ChooseAccountTypeActivity

Change-Id: I8d36717cc9b74f62ac90eae22225424f57fb9d05
Possible NPE in ActivityManagerService

Change-Id: Ib3effa9b2dc371b0678b9cf645d4c927684c01d1
Possible NPE in RuimRecords

Change-Id: I3ac7754ce18b540325e09e0bdcfff926239c8240
Copy-Paste bug in IconUtilities

Change-Id: I9c48d9e4682e1322d22b13be02d9214755685274
LocationManagerService: The "value" was used as a Map.remove(key) method parameter.

Change-Id: I83679d41576c609a7f7e0556c36df796666c1f59
SQLiteSession: Use hasNestedException() method instead of direct check

See: https://android-review.googlesource.com/#/c/45433/

Change-Id: I2e025b249cc1c487116fc4abadaf9326b1f98563