ACPI bugfix, we should refresh battery states with an ACAD event.

Richard Hughes hughsient at gmail.com
Wed Nov 30 14:38:02 PST 2005


Small patch to fix a problem with refreshing battery values.

When the ac_adapter is removed, the battery_poll_infrequently() method
is called which updates battery.reporting.last_full. This is correct.

The other states the battery may be in are also going to change at that
instance (for example going from charged to discharging) and so we
should be updating those too.

Without this, we have to wait for the next random acpi_poll() invocation
(which could take as long as 30 seconds) before the charging state is
changed. It's usually much less than this in practise, as any BAT acpi
event causes the batteries to refresh (but this is still quite a few
seconds in reality.)

This small patch fixes a problem a user was experiencing with g-p-m,
where the tooltip took some time to change the battery state. With the
attached patch, it is instant.

Please review, 

Richard.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: refresh_all_batteries_on_acad_event.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20051130/4153e3b1/refresh_all_batteries_on_acad_event.bin


More information about the hal mailing list