13 Commits

Author SHA1 Message Date
Mike Lockwood
a21e945502 BatteryService: Don't fail to register native methods if kernel power supply driver is missing
Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-02-10 12:00:32 -08:00
Steve Block
3762c31172 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Steve Block
8564c8da81 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
2012-01-06 10:07:54 +00:00
Dima Zavin
98e044a609 BatteryService(jni): properly handle read's return value
Change-Id: I10f5cf3728424e7f5a0c1b460049102fd00a6246
Signed-off-by: Dima Zavin <dima@android.com>
2011-10-28 23:15:11 -07:00
Mike Lockwood
c1b9bbb21c Remove some #ifdef HAVE_ANDROID_OS that were needed for the simulator build
Change-Id: I13d9f251f86c05ae5405f37adbf6b8e9660935ba
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-13 19:45:44 -04:00
Kenny Root
bb9d394b21 Clean up use of HAVE_ANDROID_OS
HAVE_ANDROID_OS was defined as "1" for targets, but never defined as "0"
for non-targets. Changing them to #ifdef should be safe and matches
all the other uses of HAVE_ANDROID_OS throughout the system.

Change-Id: I82257325a8ae5e4e4371ddfc4dbf51cea8ea0abb
2011-02-16 10:56:32 -08:00
Axel Haslam
49016d6cd7 BatteryService: Set bool to true if sysfs entry is not 0
For the musb to recognized as online, the musbOnline value
has to be set. The battery driver sets the online property
of the sysfs as "3" when the charger type is USB.

The way the current code is, if the value is not 1,
musbOnline would be false and the menu to mount the
sdcard on the pc would not pop-up.

Since the linux driver returns 0 if the cable is not
connected, and 3 if the cable is connected, we should
set the boolean variable to 0 only if the sysfs value
is 0, otherwise we set it to true.

Change-Id: I538d8de446e7ea4f620ffcce156a57cf56b5a4e5
Signed-off-by: Axel Haslam <axelhaslam@ti.com>
2010-10-12 17:32:26 -05:00
Imre Sunyi
9239612870 Support showing "Cold" battery health.
The Linux kernel supports reporting "cold" battery health to sysfs.
Android framework has not implemented this and it defaults to "unknown"
This adds handling the cold battery health.

Change-Id: Idcc156aae6aabce73391081143f79d052edf332e
2010-10-10 17:20:24 -07:00
Mike Lockwood
f24d13a28f BatteryService: Add support for new standard battery voltage and temperature attributes.
Plus some cleanup from the previous commit.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-17 19:58:32 -04:00
Mike Lockwood
304928fb7e BatteryService: Remove hard coded power supply names.
Search all subdirectories of /sys/class/power_supply and match on
the power supply type instead.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-17 17:20:40 -04:00
Mathias Agopian
25ba5b6564 checkpoint: split libutils into libutils + libbinder 2009-05-20 12:55:02 -07:00
Rebecca Schultz Zavin
e7e6fa3fbf If no battery stats are found, return status_unknown
If the battery files can't be found return status_unkown instead of an
error.  On systems where we haven't brought up battery stats yet they
assume the battery is dead and turn off as soon as the runtime starts

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2009-05-05 16:15:36 -07:00
The Android Open Source Project
b2a3dd88a5 auto import from //branches/cupcake/...@137197 2009-03-09 11:52:12 -07:00