Comment 28 for bug 467825

Revision history for this message
Mikael Hjelm (j-m-hjelm) wrote :

If i am correct then the issue is that the upower updates the battery status a few times when the AC is disconnected,
this can be seen by running upower --monitor-detail . This seems to be meant to detect that the battery is discharging, if i am interpreting the code correctly.
However the status it reads when being polled is full, and stays so for a while, a few seconds on my computer (Acer aspire one).
So it does not detect that the battery is discharging when that happens.
Upower does not seem to have any periodical check of the status after that so if the first initial polls miss the discharging status then upower never detects that the battery is discharging.
Conceptually i would like to see a change in the logic such that if there are no power supplies connected then the battery state should be discharging rather than relying on the battery to report this. Alternativly a periodical battery poll with 5s intervals could be introduced.
Another option is to look into the driver for the battery and redo the logic for Full vs discharging logic there so that it reacts faster. With upower --monitor-detail i can see that the voltage drops which to me indicates discharge. I have not looked into the battery driver to see what the criterioin for the discharging logic is but i am guessing it is filtered to avoid false triggers.