Comment 34 for bug 971061

Revision history for this message
Marcello (pogliamarci) wrote :

Regarding post #30.
In the attachment you'll find my patch to upowerd (file to be patched is src/linux/up-device-supply.c). I applied the patch to upstream upowerd, recompiled, and disabled via apt updates to upowerd.

Basically, this detects battery status basing on the AC adapter status (if the status is not consistent, in the sense that the battery reports discharging and the AC is plugged in, I set the status to UNKNOWN so that the following code treat the status as discharging basing on AC status, and so on).

Moreover, I had to enable polling for AC adapter (I don't know why uevents are not reported nor how to enable them for AC status, I'm not a kernel\low leven stuff expert..). The drawback of this is that status changes are not recognized immediately, but at least are recognized...