Thanks and Regards,
Arun R Murthy
-------------------
Hi,In that case it is working for me.On the event of power supply changed the battery capacity is getting updated.On plugging the AC charger capacity gets updated and on removal of AC charger capacity gets updated. But in the mean time i.t between charging plug and unplug it is not getting updated though i see a change in the sysfs.
Thanks and Regards,
Arun R Murthy
---------------------On Mon, Apr 12, 2010 at 7:55 AM, ZhangJieJing <kzj...@gmail.com> wrote:
Hi,you don't need send separatedly battery capacity, android framework only monitor POWER_SUPPLY_CHANGED uevent, if it received the uevent, it will read the sys fs under /sys/class/power_supply/* files to get the voltage, current, capacity, etc,you may need see file frameworks/base/services/jni/com_android_server_BatteryService.cpp to see the detail.
---
Best regards,
Zhang Jiejing
2010/4/12 Arun Raghavendra Murthy <rmurth...@gmail.com>
Hi,
The power_supply_changed() will handle if there is any change in power supply i.e plug/unplug of AC/USB.
I have a work which keeps monitoring my battery parameters i.e battery voltage, current, capacity.
Also I notice that all POWER_SUPPLY_PROP_* are registered as uevents in the power supply core driver.
So is it necessary for me to send an uevent separately for battery capacity.?
Thanks and Regards,
Arun R Murthy
--------------------On Thu, Apr 8, 2010 at 8:36 PM, ZhangJieJing <kzj...@gmail.com> wrote:
Hi,you need check your battery driver, the update of battery capacity is drive by uevent send by driver(via power_supply_changed() func), your driver may need have a delayed work or timer function to send this event every timeout, such as 1 minute.you can reference file: drivers/power/tosa_battery.c about this.
----
--
unsubscribe: android-porti...@googlegroups.com
website: http://groups.google.com/group/android-porting
To unsubscribe, reply using "remove me" as the subject.
Arun R Murthy
Arun R Murthy
Hi,The battery capacity is getting updated while plug/unplug of charger.But not getting updated while discharging.The BatteryService class is very much able to read the battery capacity, ac - online, usb - online, etc.The problem that I am facing is the battery capacity is getting updated only on plug/unplug of charger.In the mean time its not updated. But if I read the capacity through the sysfs I see the updated capacity.What I guess is in android only there should be some application that should read the battery capacityfrom sysfs at time intervals "t" and update the same.
Please let me know on this.Thanks and Regards,Arun R Murthy--------------------
Thanks and Regards,Arun R Murthy--------------------