handle negative temperature

When the battery temperature drops to below zero, BatteryLevelInit()
fails to show negative temperature. Because the type is unsigned
and the size of bit field is 10 bits.
So to handle negative temperature, change the type of battery temperature
from "char" to "short". And extend the size of temperature bit field
from 10 to 11 bits, which first bit is used for the sign bit.

Before:
31             24                    14                 0
+---------------+---------------------+-----------------+
| Battery Level | Battery temperature | Battery Voltage |
+---------------+---------------------+-----------------+

After:
31           25                      14                 0
+-------------+-----------------------+-----------------+
|Battery Level|  Battery temperature  | Battery Voltage |
+-------------+-----------------------+-----------------+

Bits 31..25: battery level percentage (7 bits unsigned)
Bits 24..14: battery temperature (11 bits signed)
    First bit is used for the sign and others for the temperature
Bits 13..0: battery voltage in 0.001 volt units (14 bits unsigned)

Becuase of changing the format, let the BatteryStatsImpl.VERSION field
increment.

Bug: 8009514
Change-Id: Iaa12f4d3f14e6cf4d73bc1a23d81c60f9677a499
Memory leak in IInputMethodSessionWrapper executeMessage

In some cases the executeMessage is called with
mInputMethodSession == null. For the messages

DO_UPDATE_SELECTION, DO_APP_PRIVATE_COMMAND

memory is leaked. This commit recycles the args freeing
the allocated memory.
Fix SSLCertificateSocketFactory.getDefaultCipherSuites.

The method was returning all supported cipher suites instead of the
default ones only. The default list of cipher suites actually used by
sockets created by this factory is not affected by this issue.

Change-Id: I2e4d7c6547fcb29ff7a0943bc8791706cc8d22bc
Fixed Drag-and-Drop sample code

Fixed some erros in 'Responding to drag events' sample code on
http://developer.android.com/guide/topics/ui/drag-drop.html

Changed View.OnDragEventListener to View.OnDragListener,
deleted brace start('{') after DragEvent.ACTION_DRAG_ENTERED which
does not have matching ends, and removed 'break' on each case in
swich statement which causes 'Unreachable code' error.
Added return statement at the 'default' case, so that onDrag() method
can return value in all case.

Change-Id: I7d2335f5c405626e3f0cff275b52818762c84634
Signed-off-by: Taeho Kim <jyte82@gmail.com>
Merge "Fix SSLCertificateSocketFactory.getDefaultCipherSuites."
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
Merge "Fix a variety of small publicly-reported bugs."
Merge "handle negative temperature"
Merge "Memory leak in IInputMethodSessionWrapper executeMessage"
Merge "Fixed Drag-and-Drop sample code"
Always initialize local boolean variables when possible

It's currently possible to reference deviceModeChanged in InputReader
while it's in an unknown state. Change the style of initialization
here and a few other places to better prevent this type of error.

(cherry-pick of f583d0dcc6e5c1968c472c844f6c8fbbe036ad78.)

Bug: 11433748
Change-Id: Ic450ca4afe50987b022db9d20bb1cb18ccf060cc
Merge "Always initialize local boolean variables when possible"
Remove parentheses around return statement

Removed parentheses around return statement in drag-n-drop sample,
which is not part of the Android style.

Change-Id: I09701829b277f2aa84b1fff1c7a8ea8241bdc578
Signed-off-by: Taeho Kim <jyte82@gmail.com>
Merge "Remove parentheses around return statement"