ac-power: check battery existence and status
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Nov 2022 04:54:03 +0000 (13:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 13 Nov 2022 08:35:27 +0000 (17:35 +0900)
commit1c03f7f4ba419aa65997e90accc0d935ae1cfbc5
treed1112bb3f18dd5208eda9760ae494fbf16e23767
parent0d217f634958ec15fa062ad182ff851284119579
ac-power: check battery existence and status

If a battery is not present or its status is not discharging, then
the battery should not be used as a power source.
Let's count batteries currently discharging.

Fixes #25316.
src/shared/udev-util.c