Lockscreen Notifications: Fix NPE

E/AndroidRuntime( 3778): java.lang.NullPointerException
E/AndroidRuntime( 3778): 	at com.android.keyguard.NotificationViewManager.onScreenTurnedOn(NotificationViewManager.java:286)
E/AndroidRuntime( 3778): 	at com.android.keyguard.KeyguardViewManager.onScreenTurnedOn(KeyguardViewManager.java:825)
E/AndroidRuntime( 3778): 	at com.android.keyguard.KeyguardViewMediator.handleNotifyScreenOn(KeyguardViewMediator.java:1416)
E/AndroidRuntime( 3778): 	at com.android.keyguard.KeyguardViewMediator.access$2300(KeyguardViewMediator.java:104)
E/AndroidRuntime( 3778): 	at com.android.keyguard.KeyguardViewMediator$4.handleMessage(KeyguardViewMediator.java:1131)
E/AndroidRuntime( 3778): 	at android.os.Handler.dispatchMessage(Handler.java:102)

Fix NPE on first boot

Change-Id: I6aa4f62ffbc00be15aa98ee3a137bb0d6add6610
Don't rely on gcc extensions

Variable-length arrays of non-POD data types are a gcc extension
not currently supported by clang.

Change-Id: I9cd1aed742ac70e642771ff455582727fbafaec2
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Add explicit close of Scanner input

The UsbDeviceManager is using a Scanner to identify
the ALSA card/device numbers to use for USB Gadget
audio, with a FileInputStream as its input.

Since FileInputStream implements the Closeable interface
it provides a close() method that should be explictly
called in order to close the stream source and release
any system resources that it might hold.

Change-Id: Ia0ff86d1f3cdf8916becec9c8603915dcbf4d2c8
Fix a JNI local reference leak in MediaDrm

A reference leak was found in the subtitle usecase that also
applies to android_media_MediaDrm.cpp
(Code taken from the similar fix in android_media_MediaPlayer.cpp)

Change-Id: Icc4b25e4adc9a600ff4ac99a7a8478bb55a6e348
Add NULL check in updateProxyConfig

If the exclusionList was null in updateProxyConfig the VM would
crash when converting it to a UTF8 string. Avoid this by adding a
null check.

Change-Id: I0d8106fd54385bd9ae9c652a6c67d459a119cf2b
Before requerying a cursor, check if it is closed.

Before updating a cursor,
it needs to be checked if it is valid.
Currently a defence code only checks
if it is not null.
But in case of "Cursor", it is not valid,
if it is closed.
So just like in CursorAdapter.onContentChanged(),
add the additional defence code to check validation.

Change-Id: I1302f1b6d009897815d4bdb2f20f625688cf9901
Fix NPE in ConnectivityService

Could occur when requestRouteToHostAddress is called on a network
with no associated tracker.  Code later in the method handles
this case gracefully but code introduced in JB throws an exception.

Change-Id: I6c8a0e313ecbcca120aeb5dd0802a72114749aa1
Fix a JNI local reference leak in JNIMediaPlayerListener::notify.

Bug: https://code.google.com/p/android/issues/detail?id=62137
Change-Id: I776cd83a66de37fdbbe8af367bf1b26e5e0c7247
Fix preference puts with "null" values.

Null values were being written out as <null /> elements in the
XML prefs file (as expected). This allowed the getFoo() functions
to work correctly because they treated null values as missing mappings
but containsKey would fail.

bug: https://code.google.com/p/android/issues/detail?id=64563
Change-Id: I1f466d01db96bf26e208d4fed3a6f257228bea5d
Lockscreen Notifications: make dynamic width a device overlay setting

dynamic width is disabled by default, to enable it for a specific device, add
<bool name="config_lnDynamicWidth">true</bool>
to yourdevicetree/overlay/frameworks/base/packages/Keyguard/res/values/config.xml
Lockscreen Notifications: rewrite add notification logic

There were some problems with notifications getting replaced while the user was currently dragging them.
This commit should fix that by always waiting until animations and user input are finished before replacing a notification view.

Change-Id: I53d5da164e9189a2ea12c02e7d24fd603985a2d1
ActivityManager: Donot take launcher screenshot.

Currently ActivityManger takes screenshot for all activities
on an activity switch, for maintaining the screenshots in recent
app list. This can be skipped for launcher, as launcher is not
present in the recent app list.

Change-Id: I22f7cda2c63483ab50e0df4428151503892b7d9b
Fliptile animation - Fix derps

Change-Id: I7c22b9f36de9900cb55cd74c57d588b9ad1809cc
SystemUI: Pimp-up Media Tile

Allow double-click to start a sleep timer
	for the currently playing media.

PS:
- clearer button descriptions on different states
- if timer is in progress restore and show the time the
  user had set up and notify that he is in timer progress

modified to work with flip tile animation.

Change-Id: I7848523e7bc3d9577361ff55f010a9909d46e665
Only send storage intents after boot complete

It is not possible to send a broadcast before the system
boot is completed. If you do it anyway you will get an
IllegalStateException: Cannot broadcast before boot completed.

If a memory card is inserted or removed while the phone is
booting up, there is a risk that the MountService will try to
broadcast a storage intent too early, and cause the device
to crash.

Use FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT to avoid
problems with too early broadcasts.

Change-Id: Ied36a13d235df37c9788e45a35de40d919ae0cd0
Remove unused field from AssetManager.

This field was introduced in commit 4bdd33b81a17 but wasn't
used there (or since).

Change-Id: I0615e98b8990d42da6b85f8094ab19eb0465fd9e
Add "show all notifications" navbar button

Change-Id: Id591aa98d462b0aa6d6e146d35d6be06608e7ac1
Lockscreen Notifications: dismiss all button, improve animations, cleanup

Change-Id: I408b69a39d9551d00ebc8aa54fb4ef7377fe818b
Lockscreen Notifications: fix show/hide of show all button

& fix endless SystemUI FC when SystemUI is killed

Change-Id: Ie46ef525f72b7ce575dacfb1f05e46a140c87cc5
Lockscreen Notifications: fix NPE