M module-services/service-evtmgr/service-evtmgr/EventManagerCommon.hpp => module-services/service-evtmgr/service-evtmgr/EventManagerCommon.hpp +1 -1
@@ 44,7 44,7 @@ class EventManagerCommon : public sys::Service
sys::MessagePointer DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp) override;
// Invoked during initialization
- sys::ReturnCodes InitHandler() final;
+ sys::ReturnCodes InitHandler();
sys::ReturnCodes DeinitHandler() override;
M products/BellHybrid/apps/application-bell-main/presenters/StateController.cpp => products/BellHybrid/apps/application-bell-main/presenters/StateController.cpp +5 -1
@@ 570,7 570,11 @@ namespace app::home_screen
void StateController::resetStateMachine()
{
- pimpl->resetSM();
+ using namespace sml;
+
+ if (not pimpl->sm->is("Init"_s)) {
+ pimpl->resetSM();
+ }
}
bool StateController::handleBatteryStatus()
{
M products/BellHybrid/apps/application-bell-main/windows/BellHomeScreenWindow.cpp => products/BellHybrid/apps/application-bell-main/windows/BellHomeScreenWindow.cpp +0 -1
@@ 81,7 81,6 @@ namespace gui
buildInterface();
this->presenter->attach(this);
this->presenter->createData();
- this->presenter->onBeforeShow();
}
void BellHomeScreenWindow::buildInterface()
M products/BellHybrid/apps/common/src/AlarmModel.cpp => products/BellHybrid/apps/common/src/AlarmModel.cpp +8 -2
@@ 87,7 87,10 @@ namespace app
{
auto request = AsyncRequest::createFromMessage(std::make_unique<alarms::AlarmUpdateRequestMessage>(alarm),
service::name::service_time);
- request->execute(app, this, responseCallback);
+ request->execute(app, this, [this](sys::ResponseMessage *) {
+ update(nullptr);
+ return true;
+ });
cachedRecord = alarm.getNextSingleEvent(TimePointNow());
}
@@ 95,7 98,10 @@ namespace app
{
auto request = AsyncRequest::createFromMessage(std::make_unique<alarms::TurnOffSnoozeRequestMessage>(alarm.ID),
service::name::service_time);
- request->execute(app, this, responseCallback);
+ request->execute(app, this, [this](sys::ResponseMessage *) {
+ update(nullptr);
+ return true;
+ });
nextSnoozeTime = TIME_POINT_INVALID;
}
bool AlarmModel::isActive() const
M products/BellHybrid/services/evtmgr/EventManager.cpp => products/BellHybrid/services/evtmgr/EventManager.cpp +7 -1
@@ 40,7 40,6 @@ EventManager::EventManager(LogDumpFunction logDumpFunction, const std::string &n
temperatureSource{hal::temperature::AbstractTemperatureSource::Factory::create()},
backlightHandler(settings, this), userActivityHandler(std::make_shared<sys::CpuSentinel>(name, this), this)
{
- latchStatus = bsp::bell_switches::isLatchPressed() ? sevm::LatchStatus::PRESSED : sevm::LatchStatus::RELEASED;
buildKeySequences();
updateTemperature(*temperatureSource);
@@ 68,6 67,13 @@ void EventManager::handleKeyEvent(sys::Message *msg)
keySequenceMgr->process(kbdMessage->key);
}
+sys::ReturnCodes EventManager::InitHandler()
+{
+ auto ret = EventManagerCommon::InitHandler();
+ latchStatus = bsp::bell_switches::isLatchPressed() ? sevm::LatchStatus::PRESSED : sevm::LatchStatus::RELEASED;
+ return ret;
+}
+
auto EventManager::createEventWorker() -> std::unique_ptr<WorkerEventCommon>
{
return std::make_unique<bell::WorkerEvent>(this);
M products/BellHybrid/services/evtmgr/include/evtmgr/EventManager.hpp => products/BellHybrid/services/evtmgr/include/evtmgr/EventManager.hpp +1 -0
@@ 24,6 24,7 @@ class EventManager : public EventManagerCommon
private:
void handleKeyEvent(sys::Message *msg) override;
+ sys::ReturnCodes InitHandler() final;
sys::MessagePointer DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp) override;
void initProductEvents() final;
auto createEventWorker() -> std::unique_ptr<WorkerEventCommon> final;