Bring the baby back: longpress back button to kill the app [1/2]

this old CM baby (made by @rascarlo) is still useful till
kufi does his magic on the navbar :D

Change-Id: Ic8a94679226cc5f575bd670251db978797af96d0

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Fix memory leak in system_server when screen on/off

Change-Id: I3ed7be519fc9301dd45d162773a6d0d62de12d76
Battery icon: enable in-icon percentage indicator

with the default behavior (so don't show it when fully charged
at 100%)

Change-Id: I57c447b4a0de615c478416ecc9626734860093d3
SystemUI: fix MediaProjection cast crash

Clicking on the "cast" icon of an app using the MediaProjection API will
crash as the code assume that it is a device.

java.lang.ClassCastException: android.media.projection.MediaProjectionInfo cannot be cast to android.media.MediaRouter$RouteInfo
	at com.android.systemui.statusbar.policy.CastControllerImpl.startCasting(CastControllerImpl.java:177)
	at com.android.systemui.qs.tiles.CastTile$CastDetailAdapter.onDetailItemClick(CastTile.java:237)
	at com.android.systemui.qs.QSDetailItems$1.onClick(QSDetailItems.java:177)
	at android.view.View.performClick(View.java:4756)
	at android.view.View$PerformClick.run(View.java:19749)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5221)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)

Change-Id: Icfdf745c03da7bd1bbb228e06005f55324c1b8fa
Prevent AudioService dead lock issue.

Dead lock sequence:
 1. called onSetA2dpConnectionState()
  1-1. synchronized(mConnectedDevices)
 2. called onServiceDisconnected()
  2-1. synchronized(mA2DPAvrcpLock)
 3. waiting to lock(mConnectedDevices) in onServiceDisconnected()
 4. waiting to lock(mA2DPAvrcpLock) in onSetA2dpConnectionState()

========================================================================================
- watchdog issue
----- pid 3306 at 2014-10-14 16:15:12 -----
Cmd line: system_server

"main" prio=5 tid=1 MONITOR
  - waiting to lock <0x4343e9b0> (a java.util.HashMap) held by tid=46 (AudioService)
      at android.bluetooth.BluetoothA2dp$2.onServiceDisconnected(BluetoothA2dp.java:529)

"AudioService" prio=5 tid=46 MONITOR
      - waiting to lock <0x42ab7a58> (a java.lang.Object) held by tid=1 (main)
========================================================================================

Signed-off-by: Seunghwan Hong <seunghwan.hong@lge.com>

Change-Id: I99e061c07be01aabcd26786ef2ebb71f46717b93
Fix NullPointerException in BluetoothPan

Check mPanService value to avoid NullPointerException.

Change-Id: I9ca373e292b3e33360b505100222065c47195f60