resolved conflicts for merge of c2894474
to gingerbread-plus-aosp
Change-Id: Ie00785e37809b677d6e8ab44c47e1f26037793d2
This commit is contained in:
@ -124474,6 +124474,17 @@
|
||||
visibility="public"
|
||||
>
|
||||
</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"
|
||||
type="int"
|
||||
transient="false"
|
||||
|
@ -99,6 +99,7 @@ public class BatteryManager {
|
||||
public static final int BATTERY_HEALTH_DEAD = 4;
|
||||
public static final int BATTERY_HEALTH_OVER_VOLTAGE = 5;
|
||||
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.
|
||||
// These must be powers of 2.
|
||||
|
@ -67,6 +67,7 @@ struct BatteryManagerConstants {
|
||||
jint healthDead;
|
||||
jint healthOverVoltage;
|
||||
jint healthUnspecifiedFailure;
|
||||
jint healthCold;
|
||||
};
|
||||
static BatteryManagerConstants gConstants;
|
||||
|
||||
@ -104,6 +105,7 @@ static jint getBatteryStatus(const char* status)
|
||||
static jint getBatteryHealth(const char* status)
|
||||
{
|
||||
switch (status[0]) {
|
||||
case 'C': return gConstants.healthCold; // Cold
|
||||
case 'D': return gConstants.healthDead; // Dead
|
||||
case 'G': return gConstants.healthGood; // Good
|
||||
case 'O': {
|
||||
@ -390,6 +392,9 @@ int register_android_server_BatteryService(JNIEnv* env)
|
||||
gConstants.healthUnspecifiedFailure = env->GetStaticIntField(clazz,
|
||||
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));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user