Sorry I forgot about this!
The problem is that BatteryController isn't aware of state changes that happen while asleep; it connects to signals to get state changes while awake, and it checks manually on startup, but it doesn't re-check after waking from sleep.
Thus, m_acAdapterState in BatteryController can be wrong after waking from sleep.
I decided to put the re-check after waking from sleep in PowerdevilCore because it already has logic for what to do when entering sleep (onAboutToSuspend()), so it felt logical to put the new logic for what to do when exiting sleep in the same place.
I can move the logic into BatteryController, but if feels right to have it in PowerdevilCore because there might eventually be more things that need a refresh after waking from sleep, and not just the battery stuff.
Does that make sense?