CC the list.

Hi,

the BatteryService is working like this:

cd /sys/class/power_supply

for each dir:
if have a file named type:
  if type == Battery
     read capicty ...etc
  if type == AC
     read online
  if type == USB
    read online

If you mean it not updated on unplug & plug charger, you should first check
the type of your power_supply driver.

---
Best regards,
Zhang Jiejing


2010/4/12 Arun Raghavendra Murthy <rmurthy.a...@gmail.com>

> 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 <rmurthy.a...@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.
>>>> ---
>>>> Best regards,
>>>> Zhang Jiejing
>>>>
>>>>
>>>> 2010/4/5 Arun R Murthy <rmurthy.a...@gmail.com>
>>>>
>>>>>  Hi All,
>>>>>   I am using andoird eclair and not able to see the battery capacity
>>>>> getting updated while charging/discharging.
>>>>> Wherein when I try to cat the battery capacity from the sysfs I am
>>>>> able to see the change.
>>>>> The only event that updates the battery capacity, voltage, etc in the
>>>>> application is the plug/unplug of the
>>>>> AC/USB charger.
>>>>> Please let me know on this.
>>>>>
>>>>> Thanks and Regards,
>>>>> Arun R Murthy
>>>>> -------------------
>>>>>
>>>>> --
>>>>> unsubscribe: 
>>>>> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@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
>
>
>

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to