[apps] Warn & Suspend when the battery is too low

Change-Id: I814697b36f6111198dc367d4591371e6a6e260d8
This commit is contained in:
Émilie Feral
2017-04-13 14:46:23 +02:00
parent e5610b2916
commit 9ecb2c0c53
8 changed files with 53 additions and 2 deletions

View File

@@ -9,4 +9,7 @@ BatteryTimer::BatteryTimer(AppsContainer * container) :
void BatteryTimer::fire() {
m_container->updateBatteryState();
if (Ion::Battery::level() == Ion::Battery::Charge::EMPTY) {
m_container->shutdownDueToLowBattery();
}
}