[apps] Stopped battery warning when plugged

Change-Id: Id4f0d5d730c6045bf69cfadd724dc8ad819494d5
This commit is contained in:
Gabriel Ozouf
2020-06-12 16:54:07 +02:00
committed by Émilie Feral
parent 735fc6e1bb
commit 41cf0aaac6
2 changed files with 2 additions and 2 deletions

View File

@@ -290,7 +290,7 @@ void AppsContainer::shutdownDueToLowBattery() {
* case. */
return;
}
while (Ion::Battery::level() == Ion::Battery::Charge::EMPTY) {
while (Ion::Battery::level() == Ion::Battery::Charge::EMPTY && !Ion::USB::isPlugged()) {
Ion::Backlight::setBrightness(0);
if (!GlobalPreferences::sharedGlobalPreferences()->isInExamMode()) {
/* Unless the LED is lit up for the exam mode, switch off the LED. IF the

View File

@@ -9,7 +9,7 @@ BatteryTimer::BatteryTimer() :
bool BatteryTimer::fire() {
AppsContainer * container = AppsContainer::sharedAppsContainer();
bool needRedrawing = container->updateBatteryState();
if (Ion::Battery::level() == Ion::Battery::Charge::EMPTY) {
if (Ion::Battery::level() == Ion::Battery::Charge::EMPTY && !Ion::USB::isPlugged()) {
container->shutdownDueToLowBattery();
}
return needRedrawing;