Version: 4.5 (using KDE 4.5.1) OS: Linux I have set critical level of battery to 5%, when this level is reached, powerdevil hibernate my system - it is ok. But, when I plug charger in and switch notebook on, powedevil hibernate it again after awakening (battery is about 3% at this moment). I have to wait moment before switch on notebook. I can awake my system as far as battery level is higher than 5%. Reproducible: Always Steps to Reproduce: Set action when battery is critical to hibernate, discharge battery (about 5%) and after that set critical level high (about 40%). After hibernate plug charger and awake system. When system is awakening and battery is still lower than 40%, powerdevil hibernate it again. Expected Results: powerdevil never (no automaticaly) hibernate (shut down or suspend) system when charger is pluged in patch with fix should looks like: Index: PowerDevilDaemon.cpp =================================================================== --- PowerDevilDaemon.cpp (revision 1184888) +++ PowerDevilDaemon.cpp (working copy) @@ -501,7 +501,9 @@ return; } - if (charge <= PowerDevilSettings::batteryCriticalLevel()) { + if (charge <= PowerDevilSettings::batteryCriticalLevel() && + isChargerUnpluged() + ) { switch (PowerDevilSettings::batLowAction()) { case Shutdown: if (PowerDevilSettings::waitBeforeSuspending()) {
Ou, I overlook this condition before action call... if (Solid::Control::PowerManager::acAdapterState() == Solid::Control::PowerManager::Plugged) { return; } This code in daemon looks right. But why is called hibernate twice? What happen when charge level is decrease twice before system suspend? Is possible call this function synchronized? ...have C++ something similar like Java's synchronize block?
Should be fixed in 4.6