[apps/apps_container] Switch of LED if low battery if no exam mode

This commit is contained in:
Léa Saviot
2019-05-22 16:26:56 +02:00
parent 680fd5086a
commit 795bf64188

View File

@@ -329,6 +329,12 @@ void AppsContainer::shutdownDueToLowBattery() {
}
while (Ion::Battery::level() == Ion::Battery::Charge::EMPTY) {
Ion::Backlight::setBrightness(0);
if (GlobalPreferences::sharedGlobalPreferences()->examMode() == GlobalPreferences::ExamMode::Deactivate) {
/* Unless the LED is lit up for the exam mode, switch off the LED. IF the
* low battery event happened during the Power-On Self-Test, a LED might
* have stayed lit up. */
Ion::LED::setColor(KDColorBlack);
}
m_emptyBatteryWindow.redraw(true);
Ion::Timing::msleep(3000);
Ion::Power::suspend();