[apps] Timers access the shared container directly

This commit is contained in:
Ruben Dashyan
2019-05-17 10:50:53 +02:00
committed by EmilieNumworks
parent 652cbae9ac
commit 5548767809
5 changed files with 14 additions and 20 deletions

View File

@@ -1,16 +1,16 @@
#include "battery_timer.h"
#include "apps_container.h"
BatteryTimer::BatteryTimer(AppsContainer * container) :
Timer(1),
m_container(container)
BatteryTimer::BatteryTimer() :
Timer(1)
{
}
bool BatteryTimer::fire() {
bool needRedrawing = m_container->updateBatteryState();
AppsContainer * container = AppsContainer::sharedAppsContainer();
bool needRedrawing = container->updateBatteryState();
if (Ion::Battery::level() == Ion::Battery::Charge::EMPTY) {
m_container->shutdownDueToLowBattery();
container->shutdownDueToLowBattery();
}
return needRedrawing;
}