diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2010-10-11 17:49:42 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-11 17:49:42 -0700 |
commit | 02241ab2929c34aa48acdf4befcc9cacd86c1a6f (patch) | |
tree | d8c5accddfb06cf620d40deb095aee851b118d73 | |
parent | 76f8688e9b9a71cb064119022a3f69c2e17b8b65 (diff) | |
parent | 89fbcd72fbe6ef26ea2703f8e338fd198c958ecc (diff) | |
download | frameworks_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.xml | 11 | ||||
-rw-r--r-- | core/java/android/os/BatteryManager.java | 1 | ||||
-rw-r--r-- | services/jni/com_android_server_BatteryService.cpp | 5 |
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)); } |