[apps] Init and quit the app in the "run" method of apps container

Change-Id: I3eb5adedca57fede14c4af67d72cbde697188000
This commit is contained in:
Émilie Feral
2017-05-23 16:15:35 +02:00
parent 4c4dd4b33d
commit dee5f315a9
4 changed files with 8 additions and 3 deletions

View File

@@ -151,6 +151,12 @@ void AppsContainer::switchTo(App::Snapshot * snapshot) {
}
}
void AppsContainer::run() {
switchTo(onBoardingAppSnapshot());
Container::run();
switchTo(nullptr);
}
bool AppsContainer::updateBatteryState() {
if (m_window.updateBatteryLevel() ||
m_window.updateIsChargingState() ||

View File

@@ -43,6 +43,7 @@ public:
void suspend(bool checkIfPowerKeyReleased = false);
virtual bool dispatchEvent(Ion::Events::Event event) override;
void switchTo(App::Snapshot * snapshot) override;
void run() override;
bool updateBatteryState();
void refreshPreferences();
void displayExamModePopUp(bool activate);

View File

@@ -3,7 +3,5 @@
AppsContainer container;
void ion_app() {
container.switchTo(container.onBoardingAppSnapshot());
container.run();
container.switchTo(nullptr);
}

View File

@@ -23,7 +23,7 @@ public:
Container(Container&& other) = delete;
Container& operator=(const Container& other) = delete;
Container& operator=(Container&& other) = delete;
void run();
virtual void run();
App * activeApp();
virtual bool dispatchEvent(Ion::Events::Event event) override;
virtual void switchTo(App::Snapshot * snapshot);