Fix a variety of small publicly-reported bugs.

Possible NULL dereference in cmds/bootanimation/BootAnimation.cpp.
https://code.google.com/p/android/issues/detail?id=61556

Missing fclose in core/jni/android_os_Debug.cpp.
https://code.google.com/p/android/issues/detail?id=61546

Bad loop guards in core/jni/android_util_Process.cpp.
https://code.google.com/p/android/issues/detail?id=61557

Assignment to wrong variable in libs/androidfw/AssetManager.cpp.
https://code.google.com/p/android/issues/detail?id=61560

Missing delete[]s in libs/androidfw/ObbFile.cpp.
https://code.google.com/p/android/issues/detail?id=61549

Leaks on error in tools/aapt/Images.cpp.
https://code.google.com/p/android/issues/detail?id=61552

Two missing fclose calls in tools/aapt/Resource.cpp.
https://code.google.com/p/android/issues/detail?id=61553

Missing fclose in tools/aidl/aidl.cpp.
https://code.google.com/p/android/issues/detail?id=61554

Change-Id: I5820f3824e72d07a9acb776cf0af3e7443f5694a
Prevent MediaScanner infinite loop with invalid path

including double slash  "/storage/sdcard0/xx//xxx/xxxx"

Change-Id: I112a70c88b5ec662482b79c3151310b9b9b52e40
Memory leak: parseObbFile.footer

Change-Id: Ia9e005e63fad7ab364f6c2c80cb98ec98f89b470
Signed-off-by: You Kim <you.kim72@gmail.com>
fix possible buffer overrun and memory leak

Use snprintf instead of sprintf and fclose() before return.

Change-Id: I3ed193464cc0dc90e9935ae19162667ad367628b
telephony: Add same named operator configuration for some operators

Add same named operator configuration for 404, 405, and 520.
That is, show roaming icon though same named operators.

Bug: 12121959
Change-Id: I9148bab727170f670fd2679db69b123b0526bb32
CompoundButton: Let text can be changed by config

Because CompoundButton freezes text inside onSaveInstanceState, the text
can't be changed automatically after locale of device changed.
Bug from such a case reported via url below:
https://code.google.com/p/android/issues/detail?id=24013

It would be better to don't freeze text for default case and let users
to freeze text if they need manually.

Change-Id: I2d6a192b6ff05a95b21487c2362cbc14691c68cf
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Re-initialize error after attach

If flag for error after attach is not reinitialized, it may cause
NullPointerException on subsequent onAttachedWindow if error text
was reset to null.

Change-Id: I8976c28a6ca71017e5c4b3f29d4eeeb2eda48c38
StatusBarWindow: Fix collapse using Back button

Implements the missing dispatchWindowFocusChanged method to allow the StatusBarWindow (Notification/QuickSettings) to collapse when the user presses the back hardware key.

Change-Id: Id77955d6286d83ddf5e0e05779446c2e978ff4de
UsbDebuggingManager: Fix multiple NPEs toggling USB debugging

Change-Id: I7ac039fe51a32d35ef00eaa71accb85cd57d4d8a
Signed-off-by: atl4ntis <atl4ntis@gmail.com>
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>
Fix memory leak in PatchCache

Patch object should be deleted when removing its corresponding
cache entry from PatchCache.

Change-Id: I8dfd7f557f6e5c6e9a9c04ba915372790e6f34f5
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
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