resolved conflicts for merge of c2894474 to gingerbread-plus-aosp

Change-Id: Ie00785e37809b677d6e8ab44c47e1f26037793d2
This commit is contained in:
Jean-Baptiste Queru
2010-10-10 17:45:45 -07:00
3 changed files with 17 additions and 0 deletions

View File

@ -124474,6 +124474,17 @@
visibility="public" visibility="public"
> >
</constructor> </constructor>
<field name="BATTERY_HEALTH_COLD"
type="int"
transient="false"
volatile="false"
value="7"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="BATTERY_HEALTH_DEAD" <field name="BATTERY_HEALTH_DEAD"
type="int" type="int"
transient="false" transient="false"

View File

@ -99,6 +99,7 @@ public class BatteryManager {
public static final int BATTERY_HEALTH_DEAD = 4; public static final int BATTERY_HEALTH_DEAD = 4;
public static final int BATTERY_HEALTH_OVER_VOLTAGE = 5; public static final int BATTERY_HEALTH_OVER_VOLTAGE = 5;
public static final int BATTERY_HEALTH_UNSPECIFIED_FAILURE = 6; public static final int BATTERY_HEALTH_UNSPECIFIED_FAILURE = 6;
public static final int BATTERY_HEALTH_COLD = 7;
// values of the "plugged" field in the ACTION_BATTERY_CHANGED intent. // values of the "plugged" field in the ACTION_BATTERY_CHANGED intent.
// These must be powers of 2. // These must be powers of 2.

View File

@ -67,6 +67,7 @@ struct BatteryManagerConstants {
jint healthDead; jint healthDead;
jint healthOverVoltage; jint healthOverVoltage;
jint healthUnspecifiedFailure; jint healthUnspecifiedFailure;
jint healthCold;
}; };
static BatteryManagerConstants gConstants; static BatteryManagerConstants gConstants;
@ -104,6 +105,7 @@ static jint getBatteryStatus(const char* status)
static jint getBatteryHealth(const char* status) static jint getBatteryHealth(const char* status)
{ {
switch (status[0]) { switch (status[0]) {
case 'C': return gConstants.healthCold; // Cold
case 'D': return gConstants.healthDead; // Dead case 'D': return gConstants.healthDead; // Dead
case 'G': return gConstants.healthGood; // Good case 'G': return gConstants.healthGood; // Good
case 'O': { case 'O': {
@ -390,6 +392,9 @@ int register_android_server_BatteryService(JNIEnv* env)
gConstants.healthUnspecifiedFailure = env->GetStaticIntField(clazz, gConstants.healthUnspecifiedFailure = env->GetStaticIntField(clazz,
env->GetStaticFieldID(clazz, "BATTERY_HEALTH_UNSPECIFIED_FAILURE", "I")); env->GetStaticFieldID(clazz, "BATTERY_HEALTH_UNSPECIFIED_FAILURE", "I"));
gConstants.healthCold = env->GetStaticIntField(clazz,
env->GetStaticFieldID(clazz, "BATTERY_HEALTH_COLD", "I"));
return jniRegisterNativeMethods(env, "com/android/server/BatteryService", sMethods, NELEM(sMethods)); return jniRegisterNativeMethods(env, "com/android/server/BatteryService", sMethods, NELEM(sMethods));
} }