summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2010-10-11 17:49:42 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-11 17:49:42 -0700
commit02241ab2929c34aa48acdf4befcc9cacd86c1a6f (patch)
treed8c5accddfb06cf620d40deb095aee851b118d73
parent76f8688e9b9a71cb064119022a3f69c2e17b8b65 (diff)
parent89fbcd72fbe6ef26ea2703f8e338fd198c958ecc (diff)
downloadframeworks_base-02241ab2929c34aa48acdf4befcc9cacd86c1a6f.zip
frameworks_base-02241ab2929c34aa48acdf4befcc9cacd86c1a6f.tar.gz
frameworks_base-02241ab2929c34aa48acdf4befcc9cacd86c1a6f.tar.bz2
am 89fbcd72: resolved conflicts for merge of c2894474 to gingerbread-plus-aosp
Merge commit '89fbcd72fbe6ef26ea2703f8e338fd198c958ecc' * commit '89fbcd72fbe6ef26ea2703f8e338fd198c958ecc': Support showing "Cold" battery health.
-rw-r--r--api/current.xml11
-rw-r--r--core/java/android/os/BatteryManager.java1
-rw-r--r--services/jni/com_android_server_BatteryService.cpp5
3 files changed, 17 insertions, 0 deletions
diff --git a/api/current.xml b/api/current.xml
index 375448c..423f726 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -134225,6 +134225,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"
diff --git a/core/java/android/os/BatteryManager.java b/core/java/android/os/BatteryManager.java
index 5fd2246..247b281 100644
--- a/core/java/android/os/BatteryManager.java
+++ b/core/java/android/os/BatteryManager.java
@@ -107,6 +107,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.
diff --git a/services/jni/com_android_server_BatteryService.cpp b/services/jni/com_android_server_BatteryService.cpp
index 8e7cadc..397a84a 100644
--- a/services/jni/com_android_server_BatteryService.cpp
+++ b/services/jni/com_android_server_BatteryService.cpp
@@ -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));
}