Fix setting change observing.

The observer doesn't deal with keyguard related options only.

Change-Id: Ib185662f4f8ca7508be3dce10091b5132aa823e1
(cherry picked from commit 96c8b7cf73df694fc95459e90eec445def737b7d)
fix AudioTrack and AudioRecord JNI

AudioTrack and AudioRecord JNI should not cast
jshortArray to jbyteArray. This appeared to work with Dalvik
but causes data corruption with ART.

(cherry picked from commit 9d02848e902d04417df616354db3a18c03e639b7)

Change-Id: Ie36624d3ea06042373c64edced4b5e30b7b1ee86
(cherry picked from commit 5a4fbad64991377e6113d55c01e426d6ae441d1d)
Fix possible NPE in SyncHandler.onBootCompleted()

If onBootCompleted() was called a second time, it would have throw a
NullPointerException since the queue object would have already been
set to null by the previous call. This commit just makes such an
object behave as an empty queue instead of throwing the exception.

Change-Id: I4472ff89a2a8dc93c3064210d2a49e0063f6efc0
(cherry picked from commit 3b67049d84d9c5a8e8bc665e99574a886d0d67d1)
PackageManagerService: fix StrictMode violation in getFileCrC

E/StrictMode(  915): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
E/StrictMode(  915): java.lang.Throwable: Explicit termination method 'close' not called

Change-Id: I8d68c05f32c0c299e9102ffccfcb4776e21a5b4b
(cherry picked from commit 8f4af3d88041bb5c1867525e9c3ad89699d1f45c)
ActivityManager: reduce reuse recycle

These inner classes are registered as services for each system process to dump information
during certain events like ANRs.  We can combine to reduce memory footprint by eliminating
the redundant inner classes and registered services.

Change-Id: I7c85323fb42ea67503841cc0717ef915ae9c851f
(cherry picked from commit f53cea5aa685ca1ae5f15aa79079b345e8b7f82d)