[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 "suspend_timer.h"
#include "apps_container.h"
SuspendTimer::SuspendTimer(AppsContainer * container) :
Timer(k_idleBeforeSuspendDuration/Timer::TickDuration),
m_container(container)
SuspendTimer::SuspendTimer() :
Timer(k_idleBeforeSuspendDuration/Timer::TickDuration)
{
}
bool SuspendTimer::fire() {
/* We could just call m_container->suspend(), but we want to notify all
/* We could just call container->suspend(), but we want to notify all
* responders in the responder chain that the calculator will be switched off,
* so we use an event to switch off the calculator. */
m_container->dispatchEvent(Ion::Events::OnOff);
AppsContainer * container = AppsContainer::sharedAppsContainer();
container->dispatchEvent(Ion::Events::OnOff);
return false;
}