Revert "Fix a bootloop problem when /data/system/usagestats/usage-history.xml is empty."

This reverts commit 286cba172e026515da98c08c93967a9c679ebba2.
Fix broken XML parsing idiom.

Code that expected a single top level element in an XML file
was doing something like :

while (type != START_TAG) { next(); }

This would loop forever when the XML being parsed was empty,
where each call to XmlPullParser.next() would return END_DOCUMENT.

bug: https://code.google.com/p/android/issues/detail?id=64173
Change-Id: I7543203e976a8999ae471a6c2d629249a87011bb
XmlUtils#readThisMapXml should handle null keys.

Both readThisValueXml & writeThisValueXml have been
implemented to handle values with "null" names.

Change readThisMapXml to allow such names as well, and
map them to the null key in the resulting HashMap.
readThisListXml and readThisSetXml already support
null names.

bug: https://code.google.com/p/android/issues/detail?id=63463

Change-Id: I1c93976656e45e7733113eb67d29b6bad5d25f1f
fb: fix possible NPE on power key handling

fixes reported NPE which can cause SoD

E/InputManager-JNI(  805): An exception was thrown by callback 'interceptKeyBeforeQueueing'.
E/InputManager-JNI(  805): java.lang.NullPointerException
E/InputManager-JNI(  805):      at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeQueueing(PhoneWindowManager.java:4185)
E/InputManager-JNI(  805):      at com.android.server.wm.InputMonitor.interceptKeyBeforeQueueing(InputMonitor.java:357)
E/InputManager-JNI(  805):      at com.android.server.input.InputManagerService.interceptKeyBeforeQueueing(InputManagerService.java:1351)
E/InputManager-JNI(  805):      at dalvik.system.NativeStart.run(Native Method)
E/InputManager-JNI(  805): An exception was thrown by callback 'interceptKeyBeforeQueueing'.
E/InputManager-JNI(  805): java.lang.NullPointerException
E/InputManager-JNI(  805):      at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeQueueing(PhoneWindowManager.java:4185)

Change-Id: Ia0aa32c5472d0381d629a83492b42dec419b840e
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>
UsbDebuggingManager: Fix multiple NPEs toggling USB debugging

Change-Id: I7ac039fe51a32d35ef00eaa71accb85cd57d4d8a
Signed-off-by: atl4ntis <atl4ntis@gmail.com>