[PATCH] reduce useless changes on APM battery.remaining_time

Danny Kukawka danny.kukawka at web.de
Fri May 5 08:29:23 PDT 2006


Hi,

this patch reduce change battery.remaining_time on APM every 2 seconds if the 
machine is discharging. The problem with /proc/apm is: nearly every poll 
return a new value for the remaining time. 

If there is a application using hal and listen to the change (of the property) 
ever two seconds, followed by do something via dbus (e.g. ask hal or 
powersaved for some information) this can result in a high load of dbus (see 
e.g. https://bugzilla.novell.com/show_bug.cgi?id=157905).

I changed the intervall to update the value of battery.remaining_time to 60 
seconds. This should avoid the problem, but should also be short enough to 
have always actual information in HAL.

Please review.

Cheers,

Danny

 ChangeLog         |   10 ++++++++++
 hald/linux2/apm.c |   23 +++++++++++++++++++----
 2 files changed, 29 insertions(+), 4 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-fix-apm-poll_battery_reduce_events.diff
Type: text/x-diff
Size: 2647 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20060505/7e9964a3/hal-fix-apm-poll_battery_reduce_events.bin


More information about the hal mailing list