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
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>
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
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>