~aleteoryx/muditaos

6e0c4844f85ec82510b53dcb60c3d4c0f40c2965 — Mateusz Grzegorzek 4 years ago 6787a67
[BH-739] Split EventManager

Renaming:
- rename EventManager to EventManagerCommon,
- rename PureEventManager and BellEventManager
to EventManager
28 files changed, 171 insertions(+), 158 deletions(-)

M CMakeLists.txt
D cmake/modules/AddCatch2Executable.cmake
M module-apps/application-clock/ApplicationClock.cpp
M module-services/service-appmgr/model/ApplicationManager.cpp
M module-services/service-desktop/ServiceDesktop.cpp
M module-services/service-evtmgr/EventManager.cpp
R module-services/service-evtmgr/service-evtmgr/{EventManager => EventManagerCommon}.hpp
M module-services/service-evtmgr/service-evtmgr/WorkerEvent.hpp
M module-services/service-time/RTCcommand.cpp
M module-services/service-time/doc/time_date_flow.puml
M module-services/service-time/doc/time_date_flow.svg
M module-sys/CMakeLists.txt
M module-utils/log/doc/logging_engine.md
M products/BellHybrid/BellHybridMain.cpp
M products/BellHybrid/CMakeLists.txt
A products/BellHybrid/services/CMakeLists.txt
A products/BellHybrid/services/evtmgr/CMakeLists.txt
R products/BellHybrid/services/evtmgr/{BellEventManager => EventManager}.cpp
R products/BellHybrid/services/evtmgr/{BellEventManager => include/evtmgr/EventManager}.hpp
M products/PurePhone/CMakeLists.txt
M products/PurePhone/PurePhoneMain.cpp
M products/PurePhone/services/evtmgr/CMakeLists.txt
R products/PurePhone/services/evtmgr/{PureEventManager => EventManager}.cpp
R products/PurePhone/services/evtmgr/include/evtmgr/{PureEventManager => EventManager}.hpp
M products/PurePhone/test/CMakeLists.txt
M products/PurePhone/test/test-settings/CMakeLists.txt
M products/PurePhone/test/test-settings/test-service-db-settings-api.cpp
M test/CMakeLists.txt
M CMakeLists.txt => CMakeLists.txt +0 -4
@@ 41,12 41,8 @@ endif()

if (${ENABLE_TESTS})
    enable_testing()
    add_custom_target(unittests)
    add_custom_target(check ${CMAKE_CTEST_COMMAND} -V)
    add_subdirectory(test)
    if (EXISTS products/${PRODUCT}/test)
        add_subdirectory(products/${PRODUCT}/test)
    endif ()
    include(PureCoverage)
endif ()


D cmake/modules/AddCatch2Executable.cmake => cmake/modules/AddCatch2Executable.cmake +0 -65
@@ 1,65 0,0 @@
function(add_catch2_executable)
    cmake_parse_arguments(
            _TEST_ARGS
            "USE_FS"
            "NAME"
            "SRCS;INCLUDE;LIBS;DEFS;DEPS"
            ${ARGN}
    )

    if(NOT _TEST_ARGS_NAME)
        message(FATAL_ERROR "You must provide a test name")
    endif(NOT _TEST_ARGS_NAME)
    set(_TESTNAME "catch2-${_TEST_ARGS_NAME}")

    if(NOT _TEST_ARGS_SRCS)
        message(FATAL_ERROR "You must provide test sources for ${_TESTNAME}")
    endif(NOT _TEST_ARGS_SRCS)

    get_directory_property(_TEST_ENTITY TEST_ENTITY)

    add_executable(${_TESTNAME} EXCLUDE_FROM_ALL ${_TEST_ARGS_SRCS})

    target_compile_options(${_TESTNAME} PUBLIC "-fsanitize=address")
    target_link_options(${_TESTNAME} PUBLIC "-fsanitize=address")

    # disable logs in unit tests
    if (NOT ${ENABLE_TEST_LOGS} AND NOT ${_TESTNAME} STREQUAL "catch2-utils-log")
        target_sources(${_TESTNAME} PRIVATE ${ROOT_TEST_DIR}/mock-logs.cpp)
        target_sources(${_TESTNAME} PRIVATE ${ROOT_TEST_DIR}/mock-freertos-tls.cpp)
    endif (NOT ${ENABLE_TEST_LOGS} AND NOT ${_TESTNAME} STREQUAL "catch2-utils-log")

    set(_TEST_LABELS "")
    if(_TEST_ARGS_USE_FS)
        enable_test_filesystem()
    endif()

    target_link_libraries(${_TESTNAME} PRIVATE Catch2::Catch2 log)
    foreach(lib ${_TEST_ARGS_LIBS})
        target_link_libraries(${_TESTNAME} PRIVATE ${lib})
    endforeach(lib)
    foreach(include ${_TEST_ARGS_INCLUDE})
        target_include_directories(${_TESTNAME} PRIVATE ${include})
    endforeach(include)

    foreach(def ${_TEST_ARGS_DEFS})
        target_compile_definitions(${_TESTNAME} PRIVATE ${def})
    endforeach(def)

    foreach(dep ${_TEST_ARGS_DEPS})
        add_dependencies(${_TESTNAME}  ${dep})
    endforeach(dep)

    add_dependencies(unittests ${_TESTNAME})
    add_dependencies(check ${_TESTNAME})

    if(_TEST_ENTITY)
        add_dependencies(unittests-${_TEST_ENTITY} ${_TESTNAME})
        list(APPEND _TEST_LABELS ${_TEST_ENTITY})
    endif()

    catch_discover_tests(${_TESTNAME}
            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
            PROPERTIES LABELS ${_TEST_LABELS}
            )
endfunction()

M module-apps/application-clock/ApplicationClock.cpp => module-apps/application-clock/ApplicationClock.cpp +1 -1
@@ 8,7 8,7 @@
// module-utils
#include <log.hpp>
#include <service-evtmgr/EVMessages.hpp>
#include <service-evtmgr/EventManager.hpp>
#include <service-evtmgr/EventManagerCommon.hpp>
#include <service-appmgr/model/ApplicationManager.hpp>
#include <module-sys/Timers/TimerFactory.hpp>
// MessageType

M module-services/service-appmgr/model/ApplicationManager.cpp => module-services/service-appmgr/model/ApplicationManager.cpp +2 -2
@@ 39,7 39,7 @@
#include <service-desktop/DesktopMessages.hpp>
#include <service-eink/ServiceEink.hpp>
#include <service-evtmgr/EVMessages.hpp>
#include <service-evtmgr/EventManager.hpp>
#include <service-evtmgr/EventManagerCommon.hpp>

#include <algorithm>
#include <utility>


@@ 1036,7 1036,7 @@ namespace app::manager
            app.blockClosing = false;
            app.setState(ApplicationHandle::State::ACTIVE_FORGROUND);
            setState(State::Running);
            EventManager::messageSetApplication(this, app.name());
            EventManagerCommon::messageSetApplication(this, app.name());
            onLaunchFinished(app);
            return true;
        }

M module-services/service-desktop/ServiceDesktop.cpp => module-services/service-desktop/ServiceDesktop.cpp +1 -1
@@ 17,7 17,7 @@
#include <application-desktop/Constants.hpp>
#include <service-db/service-db/Settings.hpp>
#include <service-db/QueryMessage.hpp>
#include <service-evtmgr/EventManager.hpp>
#include <service-evtmgr/EventManagerCommon.hpp>
#include <service-evtmgr/EVMessages.hpp>
#include <purefs/filesystem_paths.hpp>
#include <module-sys/SystemManager/SystemManager.hpp>

M module-services/service-evtmgr/EventManager.cpp => module-services/service-evtmgr/EventManager.cpp +15 -15
@@ 5,7 5,7 @@
#include "service-evtmgr/EVMessages.hpp"
#include "service-evtmgr/KbdMessage.hpp"
#include "service-evtmgr/Constants.hpp"
#include "service-evtmgr/EventManager.hpp"
#include "service-evtmgr/EventManagerCommon.hpp"
#include "service-evtmgr/WorkerEvent.hpp"

#include "battery-level-check/BatteryLevelCheck.hpp"


@@ 47,7 47,7 @@ namespace
    constexpr auto loggerTimerName      = "Logger";
} // namespace

EventManager::EventManager(const std::string &name)
EventManagerCommon::EventManagerCommon(const std::string &name)
    : sys::Service(name, "", stackDepth), loggerTimer{sys::TimerFactory::createPeriodicTimer(
                                              this,
                                              loggerTimerName,


@@ 62,7 62,7 @@ EventManager::EventManager(const std::string &name)
    loggerTimer.start();
}

EventManager::~EventManager()
EventManagerCommon::~EventManagerCommon()
{
    if (EventWorker != nullptr) {
        EventWorker->close();


@@ 70,7 70,7 @@ EventManager::~EventManager()
}

// Invoked upon receiving data message
sys::MessagePointer EventManager::DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp)
sys::MessagePointer EventManagerCommon::DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp)
{
    bool handled = false;



@@ 114,7 114,7 @@ sys::MessagePointer EventManager::DataReceivedHandler(sys::DataMessage *msgl, sy
}

// Invoked during initialization
sys::ReturnCodes EventManager::InitHandler()
sys::ReturnCodes EventManagerCommon::InitHandler()
{
    settings->init(service::ServiceProxy(shared_from_this()));



@@ 200,7 200,7 @@ sys::ReturnCodes EventManager::InitHandler()
    return sys::ReturnCodes::Success;
}

sys::ReturnCodes EventManager::DeinitHandler()
sys::ReturnCodes EventManagerCommon::DeinitHandler()
{
    settings->deinit();



@@ 211,13 211,13 @@ sys::ReturnCodes EventManager::DeinitHandler()
    return sys::ReturnCodes::Success;
}

void EventManager::ProcessCloseReason(sys::CloseReason closeReason)
void EventManagerCommon::ProcessCloseReason(sys::CloseReason closeReason)
{
    bsp::torch::turn(bsp::torch::State::off);
    sendCloseReadyMessage(this);
}

sys::ReturnCodes EventManager::SwitchPowerModeHandler(const sys::ServicePowerMode mode)
sys::ReturnCodes EventManagerCommon::SwitchPowerModeHandler(const sys::ServicePowerMode mode)
{
    LOG_FATAL("[ServiceEvtMgr] PowerModeHandler: %s", c_str(mode));



@@ 232,13 232,13 @@ sys::ReturnCodes EventManager::SwitchPowerModeHandler(const sys::ServicePowerMod
    return sys::ReturnCodes::Success;
}

bool EventManager::messageSetApplication(sys::Service *sender, const std::string &applicationName)
bool EventManagerCommon::messageSetApplication(sys::Service *sender, const std::string &applicationName)
{
    auto msg = std::make_shared<sevm::EVMFocusApplication>(applicationName);
    return sender->bus.sendUnicast(msg, service::name::evt_manager);
}

void EventManager::handleKeyEvent(sys::Message *msg)
void EventManagerCommon::handleKeyEvent(sys::Message *msg)
{
    auto kbdMessage = dynamic_cast<sevm::KbdMessage *>(msg);
    auto message    = std::make_shared<sevm::KbdMessage>();


@@ 259,7 259,7 @@ void EventManager::handleKeyEvent(sys::Message *msg)
    app::manager::Controller::preventBlockingDevice(this);
}

int EventManager::dumpLogsToFile()
int EventManagerCommon::dumpLogsToFile()
{
    const auto logPath = purefs::dir::getUserDiskPath() / LOG_FILE_NAME;
    const auto ts      = cpp_freertos::Ticks::TicksToMs(cpp_freertos::Ticks::GetTicks());


@@ 269,7 269,7 @@ int EventManager::dumpLogsToFile()
    return Log::Logger::get().dumpToFile(std::move(logPath));
}

void EventManager::handleMinuteUpdate(time_t timestamp)
void EventManagerCommon::handleMinuteUpdate(time_t timestamp)
{
    if (!targetApplication.empty()) {
        auto message       = std::make_shared<sevm::RtcMinuteAlarmMessage>(MessageType::EVMMinuteUpdated);


@@ 278,7 278,7 @@ void EventManager::handleMinuteUpdate(time_t timestamp)
    }
}

void EventManager::processRTCFromTmRequest(struct tm &newTime)
void EventManagerCommon::processRTCFromTmRequest(struct tm &newTime)
{
    if (bsp::rtc::setDateTime(&newTime) != bsp::rtc::ErrorCode::OK) {
        LOG_ERROR("Setting RTC failed.");


@@ 290,7 290,7 @@ void EventManager::processRTCFromTmRequest(struct tm &newTime)
    bus.sendMulticast(std::move(notification), sys::BusChannel::ServiceEvtmgrNotifications);
}

void EventManager::processRTCFromTimestampRequest(time_t &newTime)
void EventManagerCommon::processRTCFromTimestampRequest(time_t &newTime)
{
    if (bsp::rtc::setDateTimeFromTimestamp(newTime) != bsp::rtc::ErrorCode::OK) {
        LOG_ERROR("Setting RTC failed.");


@@ 301,7 301,7 @@ void EventManager::processRTCFromTimestampRequest(time_t &newTime)
    bus.sendMulticast(std::move(notification), sys::BusChannel::ServiceEvtmgrNotifications);
}

void EventManager::processTimezoneRequest(const std::string &timezone)
void EventManagerCommon::processTimezoneRequest(const std::string &timezone)
{
    if (setenv("TZ", timezone.c_str(), 1) != 0) {
        LOG_ERROR("Setting timezone failed.");

R module-services/service-evtmgr/service-evtmgr/EventManager.hpp => module-services/service-evtmgr/service-evtmgr/EventManagerCommon.hpp +3 -3
@@ 22,7 22,7 @@

class WorkerEvent;

class EventManager : public sys::Service
class EventManagerCommon : public sys::Service
{
  private:
    static constexpr auto stackDepth = 4096;


@@ 52,8 52,8 @@ class EventManager : public sys::Service
    bool alarmIsValid = false;

  public:
    explicit EventManager(const std::string &name = service::name::evt_manager);
    ~EventManager();
    explicit EventManagerCommon(const std::string &name = service::name::evt_manager);
    ~EventManagerCommon();

    sys::MessagePointer DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp) override;


M module-services/service-evtmgr/service-evtmgr/WorkerEvent.hpp => module-services/service-evtmgr/service-evtmgr/WorkerEvent.hpp +1 -1
@@ 3,7 3,7 @@

#pragma once

#include "EventManager.hpp"
#include "EventManagerCommon.hpp"

#include <Service/Message.hpp>
#include <Service/Service.hpp>

M module-services/service-time/RTCcommand.cpp => module-services/service-time/RTCcommand.cpp +1 -1
@@ 4,7 4,7 @@
#include "service-time/RTCCommand.hpp"
#include <service-time/TimeMessage.hpp>

#include <service-evtmgr/service-evtmgr/EventManager.hpp>
#include <service-evtmgr/service-evtmgr/EventManagerCommon.hpp>

void RTCCommand::setTime(const struct tm &time)
{

M module-services/service-time/doc/time_date_flow.puml => module-services/service-time/doc/time_date_flow.puml +1 -1
@@ 4,7 4,7 @@ participant ServiceTime as time
participant TimeManager as manager
participant SettingsApp as settings
participant SettingsDB as db
participant EventManager as event
participant EventManagerCommon as event
participant bspRTC as rtc
participant OS as os


M module-services/service-time/doc/time_date_flow.svg => module-services/service-time/doc/time_date_flow.svg +9 -9
@@ 1,4 1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="712px" preserveAspectRatio="none" style="width:1270px;height:712px;" version="1.1" viewBox="0 0 1270 712" width="1270px" zoomAndPan="magnify"><defs><filter height="300%" id="fdmmks63ug5yv" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="68" x2="68" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="531.5" x2="531.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="653.5" x2="653.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="818.5" x2="818.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="928.5" x2="928.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="1046.5" x2="1046.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="1170" x2="1170" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="1239" x2="1239" y1="40.2969" y2="668.8203"/><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="122" x="5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="108" x="12" y="24.9951">ServiceCellular</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="122" x="5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="108" x="12" y="687.8154">ServiceCellular</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="103" x="478.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="89" x="485.5" y="24.9951">ServiceTime</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="103" x="478.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="89" x="485.5" y="687.8154">ServiceTime</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="113" x="595.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="99" x="602.5" y="24.9951">TimeManager</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="113" x="595.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="99" x="602.5" y="687.8154">TimeManager</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="99" x="767.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="85" x="774.5" y="24.9951">SettingsApp</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="99" x="767.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="85" x="774.5" y="687.8154">SettingsApp</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="92" x="880.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="78" x="887.5" y="24.9951">SettingsDB</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="92" x="880.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="78" x="887.5" y="687.8154">SettingsDB</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="117" x="986.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="103" x="993.5" y="24.9951">EventManager</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="117" x="986.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="103" x="993.5" y="687.8154">EventManager</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="68" x="1134" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="54" x="1141" y="24.9951">bspRTC</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="68" x="1134" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="54" x="1141" y="687.8154">bspRTC</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="34" x="1220" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="20" x="1227" y="24.9951">OS</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="34" x="1220" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="20" x="1227" y="687.8154">OS</text><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1263" x="0" y="70.8633"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="70.8633" y2="70.8633"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="73.8633" y2="73.8633"/><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="220" x="521.5" y="60.2969"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="201" x="527.5" y="76.3638">Network time sync enabled</text><polygon fill="#A80036" points="79,110.5625,69,114.5625,79,118.5625,75,114.5625" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="73" x2="531" y1="114.5625" y2="114.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="440" x="85" y="109.4966">Settings: Network time synchronisation Network time sync enabled</text><polygon fill="#A80036" points="520,139.6953,530,143.6953,520,147.6953,524,143.6953" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="68" x2="526" y1="143.6953" y2="143.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="199" x="75" y="138.6294">CTZE notification: time update</text><polygon fill="#A80036" points="642,168.8281,652,172.8281,642,176.8281,646,172.8281" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="532" x2="648" y1="172.8281" y2="172.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="81" x="539" y="167.7622">Update time</text><polygon fill="#A80036" points="1035,197.9609,1045,201.9609,1035,205.9609,1039,201.9609" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="654" x2="1041" y1="201.9609" y2="201.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="99" x="661" y="196.895">Store new time</text><polygon fill="#A80036" points="1158,227.0938,1168,231.0938,1158,235.0938,1162,231.0938" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1047" x2="1164" y1="231.0938" y2="231.0938"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="99" x="1054" y="226.0278">Store new time</text><polygon fill="#A80036" points="1227,256.2266,1237,260.2266,1227,264.2266,1231,260.2266" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1047" x2="1233" y1="260.2266" y2="260.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="168" x="1054" y="255.1606">Time updated notification</text><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1263" x="0" y="288.793"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="288.793" y2="288.793"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="291.793" y2="291.793"/><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="382" x="440.5" y="278.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="363" x="446.5" y="294.2935">Disabling / Enabling Network time synchonisation</text><polygon fill="#A80036" points="543,328.4922,533,332.4922,543,336.4922,539,332.4922" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="537" x2="818" y1="332.4922" y2="332.4922"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="263" x="549" y="327.4263">Time synchronisation disabled / enabled</text><polygon fill="#A80036" points="916.5,357.625,926.5,361.625,916.5,365.625,920.5,361.625" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="532" x2="922.5" y1="361.625" y2="361.625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="121" x="539" y="356.5591">Store new settings</text><polygon fill="#A80036" points="543,386.7578,533,390.7578,543,394.7578,539,390.7578" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="537" x2="927.5" y1="390.7578" y2="390.7578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="91" x="549" y="385.6919">Setting stored</text><polygon fill="#A80036" points="79,415.8906,69,419.8906,79,423.8906,75,419.8906" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="73" x2="531" y1="419.8906" y2="419.8906"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="105" x="85" y="414.8247">Setting changed</text><line style="stroke:#A80036;stroke-width:1.0;" x1="68" x2="110" y1="449.0234" y2="449.0234"/><line style="stroke:#A80036;stroke-width:1.0;" x1="110" x2="110" y1="449.0234" y2="462.0234"/><line style="stroke:#A80036;stroke-width:1.0;" x1="69" x2="110" y1="462.0234" y2="462.0234"/><polygon fill="#A80036" points="79,458.0234,69,462.0234,79,466.0234,75,462.0234" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="438" x="75" y="443.9575">handle settings changed ( Enable / Disable Network time reporting)</text><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1263" x="0" y="490.5898"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="490.5898" y2="490.5898"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="493.5898" y2="493.5898"/><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="518" x="372.5" y="480.0234"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="504" x="378.5" y="496.0903">Network time synchronisation disabled, manually setting date / time</text><polygon fill="#A80036" points="543,530.2891,533,534.2891,543,538.2891,539,534.2891" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="537" x2="818" y1="534.2891" y2="534.2891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="143" x="549" y="529.2231">New date / time is set</text><polygon fill="#A80036" points="642,559.4219,652,563.4219,642,567.4219,646,563.4219" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="532" x2="648" y1="563.4219" y2="563.4219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="81" x="539" y="558.356">Update time</text><polygon fill="#A80036" points="1035,588.5547,1045,592.5547,1035,596.5547,1039,592.5547" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="654" x2="1041" y1="592.5547" y2="592.5547"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="99" x="661" y="587.4888">Store new time</text><polygon fill="#A80036" points="1158,617.6875,1168,621.6875,1158,625.6875,1162,621.6875" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1047" x2="1164" y1="621.6875" y2="621.6875"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="99" x="1054" y="616.6216">Store new time</text><polygon fill="#A80036" points="1227,646.8203,1237,650.8203,1227,654.8203,1231,650.8203" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1047" x2="1233" y1="650.8203" y2="650.8203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="168" x="1054" y="645.7544">Time updated notification</text><!--MD5=[cc510ad7b2eefb15d12f2c7123c69107]
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="712px" preserveAspectRatio="none" style="width:1270px;height:712px;" version="1.1" viewBox="0 0 1270 712" width="1270px" zoomAndPan="magnify"><defs><filter height="300%" id="fdmmks63ug5yv" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="68" x2="68" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="531.5" x2="531.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="653.5" x2="653.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="818.5" x2="818.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="928.5" x2="928.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="1046.5" x2="1046.5" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="1170" x2="1170" y1="40.2969" y2="668.8203"/><line style="stroke:#A80036;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="1239" x2="1239" y1="40.2969" y2="668.8203"/><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="122" x="5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="108" x="12" y="24.9951">ServiceCellular</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="122" x="5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="108" x="12" y="687.8154">ServiceCellular</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="103" x="478.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="89" x="485.5" y="24.9951">ServiceTime</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="103" x="478.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="89" x="485.5" y="687.8154">ServiceTime</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="113" x="595.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="99" x="602.5" y="24.9951">TimeManager</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="113" x="595.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="99" x="602.5" y="687.8154">TimeManager</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="99" x="767.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="85" x="774.5" y="24.9951">SettingsApp</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="99" x="767.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="85" x="774.5" y="687.8154">SettingsApp</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="92" x="880.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="78" x="887.5" y="24.9951">SettingsDB</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="92" x="880.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="78" x="887.5" y="687.8154">SettingsDB</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="117" x="986.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="103" x="993.5" y="24.9951">EventManagerCommon</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="117" x="986.5" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="103" x="993.5" y="687.8154">EventManagerCommon</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="68" x="1134" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="54" x="1141" y="24.9951">bspRTC</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="68" x="1134" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="54" x="1141" y="687.8154">bspRTC</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="34" x="1220" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="20" x="1227" y="24.9951">OS</text><rect fill="#FEFECE" filter="url(#fdmmks63ug5yv)" height="30.2969" style="stroke:#A80036;stroke-width:1.5;" width="34" x="1220" y="667.8203"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="20" x="1227" y="687.8154">OS</text><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1263" x="0" y="70.8633"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="70.8633" y2="70.8633"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="73.8633" y2="73.8633"/><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="220" x="521.5" y="60.2969"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="201" x="527.5" y="76.3638">Network time sync enabled</text><polygon fill="#A80036" points="79,110.5625,69,114.5625,79,118.5625,75,114.5625" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="73" x2="531" y1="114.5625" y2="114.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="440" x="85" y="109.4966">Settings: Network time synchronisation Network time sync enabled</text><polygon fill="#A80036" points="520,139.6953,530,143.6953,520,147.6953,524,143.6953" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="68" x2="526" y1="143.6953" y2="143.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="199" x="75" y="138.6294">CTZE notification: time update</text><polygon fill="#A80036" points="642,168.8281,652,172.8281,642,176.8281,646,172.8281" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="532" x2="648" y1="172.8281" y2="172.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="81" x="539" y="167.7622">Update time</text><polygon fill="#A80036" points="1035,197.9609,1045,201.9609,1035,205.9609,1039,201.9609" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="654" x2="1041" y1="201.9609" y2="201.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="99" x="661" y="196.895">Store new time</text><polygon fill="#A80036" points="1158,227.0938,1168,231.0938,1158,235.0938,1162,231.0938" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1047" x2="1164" y1="231.0938" y2="231.0938"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="99" x="1054" y="226.0278">Store new time</text><polygon fill="#A80036" points="1227,256.2266,1237,260.2266,1227,264.2266,1231,260.2266" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1047" x2="1233" y1="260.2266" y2="260.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="168" x="1054" y="255.1606">Time updated notification</text><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1263" x="0" y="288.793"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="288.793" y2="288.793"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="291.793" y2="291.793"/><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="382" x="440.5" y="278.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="363" x="446.5" y="294.2935">Disabling / Enabling Network time synchonisation</text><polygon fill="#A80036" points="543,328.4922,533,332.4922,543,336.4922,539,332.4922" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="537" x2="818" y1="332.4922" y2="332.4922"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="263" x="549" y="327.4263">Time synchronisation disabled / enabled</text><polygon fill="#A80036" points="916.5,357.625,926.5,361.625,916.5,365.625,920.5,361.625" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="532" x2="922.5" y1="361.625" y2="361.625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="121" x="539" y="356.5591">Store new settings</text><polygon fill="#A80036" points="543,386.7578,533,390.7578,543,394.7578,539,390.7578" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="537" x2="927.5" y1="390.7578" y2="390.7578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="91" x="549" y="385.6919">Setting stored</text><polygon fill="#A80036" points="79,415.8906,69,419.8906,79,423.8906,75,419.8906" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="73" x2="531" y1="419.8906" y2="419.8906"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="105" x="85" y="414.8247">Setting changed</text><line style="stroke:#A80036;stroke-width:1.0;" x1="68" x2="110" y1="449.0234" y2="449.0234"/><line style="stroke:#A80036;stroke-width:1.0;" x1="110" x2="110" y1="449.0234" y2="462.0234"/><line style="stroke:#A80036;stroke-width:1.0;" x1="69" x2="110" y1="462.0234" y2="462.0234"/><polygon fill="#A80036" points="79,458.0234,69,462.0234,79,466.0234,75,462.0234" style="stroke:#A80036;stroke-width:1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="438" x="75" y="443.9575">handle settings changed ( Enable / Disable Network time reporting)</text><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="3" style="stroke:#EEEEEE;stroke-width:1.0;" width="1263" x="0" y="490.5898"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="490.5898" y2="490.5898"/><line style="stroke:#000000;stroke-width:1.0;" x1="0" x2="1263" y1="493.5898" y2="493.5898"/><rect fill="#EEEEEE" filter="url(#fdmmks63ug5yv)" height="23.1328" style="stroke:#000000;stroke-width:2.0;" width="518" x="372.5" y="480.0234"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="504" x="378.5" y="496.0903">Network time synchronisation disabled, manually setting date / time</text><polygon fill="#A80036" points="543,530.2891,533,534.2891,543,538.2891,539,534.2891" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="537" x2="818" y1="534.2891" y2="534.2891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="143" x="549" y="529.2231">New date / time is set</text><polygon fill="#A80036" points="642,559.4219,652,563.4219,642,567.4219,646,563.4219" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="532" x2="648" y1="563.4219" y2="563.4219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="81" x="539" y="558.356">Update time</text><polygon fill="#A80036" points="1035,588.5547,1045,592.5547,1035,596.5547,1039,592.5547" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="654" x2="1041" y1="592.5547" y2="592.5547"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="99" x="661" y="587.4888">Store new time</text><polygon fill="#A80036" points="1158,617.6875,1168,621.6875,1158,625.6875,1162,621.6875" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1047" x2="1164" y1="621.6875" y2="621.6875"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="99" x="1054" y="616.6216">Store new time</text><polygon fill="#A80036" points="1227,646.8203,1237,650.8203,1227,654.8203,1231,650.8203" style="stroke:#A80036;stroke-width:1.0;"/><line style="stroke:#A80036;stroke-width:1.0;" x1="1047" x2="1233" y1="650.8203" y2="650.8203"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="168" x="1054" y="645.7544">Time updated notification</text><!--MD5=[cc510ad7b2eefb15d12f2c7123c69107]
@startuml
participant ServiceCellular as cellular
participant ServiceTime as time


@@ 35,12 35,12 @@ event -> os : Time updated notification


@enduml

PlantUML version 1.2021.5(Sun Apr 25 13:20:28 CEST 2021)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: Dynamic Code Evolution 64-Bit Server VM
Default Encoding: UTF-8
Language: pl
Country: PL

PlantUML version 1.2021.5(Sun Apr 25 13:20:28 CEST 2021)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: Dynamic Code Evolution 64-Bit Server VM
Default Encoding: UTF-8
Language: pl
Country: PL
--></g></svg>
\ No newline at end of file

M module-sys/CMakeLists.txt => module-sys/CMakeLists.txt +0 -5
@@ 58,11 58,6 @@ target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_TARGET})
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_INCLUDES})
target_include_directories(${PROJECT_NAME} PUBLIC ../module-services )

target_include_directories(${PROJECT_NAME}
        PUBLIC
        ${CMAKE_SOURCE_DIR}
)

if (${ENABLE_TESTS})
    add_subdirectory(SystemManager/tests)
    add_subdirectory(Service/tests)

M module-utils/log/doc/logging_engine.md => module-utils/log/doc/logging_engine.md +1 -1
@@ 25,7 25,7 @@ In such a case, proper `lost message info` is added to `msg` received from the b

## Dumping to a file

Logs from `Circular buffer` are dumped to a file named `MuditaOS.log` every 10 sec by `EventManager` timer.
Logs from `Circular buffer` are dumped to a file named `MuditaOS.log` every 10 sec by `EventManagerCommon` timer.

Current max log file size is 50 MB (after reaching this size no more logs are dumped).


M products/BellHybrid/BellHybridMain.cpp => products/BellHybrid/BellHybridMain.cpp +2 -2
@@ 9,7 9,7 @@
#include <application-bell-settings/ApplicationBellSettings.hpp>

// services
#include <services/evtmgr/BellEventManager.hpp>
#include <evtmgr/EventManager.hpp>
#include <module-services/service-eink/ServiceEink.hpp>
#include <Service/ServiceCreator.hpp>
#include <service-appmgr/model/ApplicationManager.hpp>


@@ 57,7 57,7 @@ int main()
    }

    std::vector<std::unique_ptr<sys::BaseServiceCreator>> systemServices;
    systemServices.emplace_back(sys::CreatorFor<BellEventManager>());
    systemServices.emplace_back(sys::CreatorFor<EventManager>());
#if ENABLE_FILEINDEXER_SERVICE
    systemServices.emplace_back(sys::CreatorFor<service::ServiceFileIndexer>());
#endif

M products/BellHybrid/CMakeLists.txt => products/BellHybrid/CMakeLists.txt +3 -4
@@ 19,8 19,6 @@ target_sources(BellHybrid
    PRIVATE
        BellHybridMain.cpp
        PlatformFactory.cpp
        services/evtmgr/BellEventManager.cpp
        services/evtmgr/BellEventManager.hpp
    )

target_include_directories(BellHybrid


@@ 28,7 26,6 @@ target_include_directories(BellHybrid
        ${TARGET_DIR_INCLUDES}
        ${PROJECT_INCLUDES}
        ${CMAKE_BINARY_DIR}
        ${CMAKE_CURRENT_SOURCE_DIR}
)

set_target_properties(BellHybrid


@@ 39,10 36,11 @@ set_target_properties(BellHybrid

target_link_libraries(BellHybrid
    PRIVATE
        application-bell-alarm
        application-bell-main
        application-bell-settings
        application-bell-alarm
        application-music-player
        evtmgr
        messagetype
        module-apps
        module-bsp


@@ 84,3 82,4 @@ add_version_json(BellHybrid)
add_standalone_image(BellHybrid)
add_update_package(BellHybrid)

add_subdirectory(services)

A products/BellHybrid/services/CMakeLists.txt => products/BellHybrid/services/CMakeLists.txt +1 -0
@@ 0,0 1,1 @@
add_subdirectory(evtmgr)

A products/BellHybrid/services/evtmgr/CMakeLists.txt => products/BellHybrid/services/evtmgr/CMakeLists.txt +19 -0
@@ 0,0 1,19 @@
add_library(evtmgr STATIC)

target_sources(evtmgr
    PRIVATE
        EventManager.cpp
    PUBLIC
        include/evtmgr/EventManager.hpp
)

target_include_directories(evtmgr
    PUBLIC
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(evtmgr
   PRIVATE
        module-utils
        service-evtmgr
)

R products/BellHybrid/services/evtmgr/BellEventManager.cpp => products/BellHybrid/services/evtmgr/EventManager.cpp +3 -3
@@ 1,13 1,13 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "BellEventManager.hpp"
#include <evtmgr/EventManager.hpp>

#include <service-evtmgr/WorkerEvent.hpp>

sys::ReturnCodes BellEventManager::InitHandler()
sys::ReturnCodes EventManager::InitHandler()
{
    EventManager::InitHandler();
    EventManagerCommon::InitHandler();

    using namespace std::string_literals;
    std::list<sys::WorkerQueueInfo> list;

R products/BellHybrid/services/evtmgr/BellEventManager.hpp => products/BellHybrid/services/evtmgr/include/evtmgr/EventManager.hpp +3 -3
@@ 3,9 3,9 @@

#pragma once

#include <service-evtmgr/EventManager.hpp>
#include <service-evtmgr/EventManagerCommon.hpp>

class BellEventManager : public EventManager
class EventManager : public EventManagerCommon
{
  private:
    sys::ReturnCodes InitHandler() override;


@@ 13,7 13,7 @@ class BellEventManager : public EventManager

namespace sys
{
    template <> struct ManifestTraits<BellEventManager>
    template <> struct ManifestTraits<EventManager>
    {
        static auto GetManifest() -> ServiceManifest
        {

M products/PurePhone/CMakeLists.txt => products/PurePhone/CMakeLists.txt +7 -4
@@ 32,7 32,6 @@ target_include_directories(PurePhone
        ${TARGET_DIR_INCLUDES}
        ${PROJECT_INCLUDES}
        ${CMAKE_BINARY_DIR}
        ${CMAKE_CURRENT_SOURCE_DIR}
    )

set_target_properties(PurePhone


@@ 45,9 44,9 @@ target_link_libraries(PurePhone
    PRIVATE
        application-antenna
        application-calculator
        application-calllog
        application-calendar
        application-call
        application-calllog
        application-desktop
        application-meditation
        application-messages


@@ 56,16 55,16 @@ target_link_libraries(PurePhone
        application-phonebook
        application-settings
        application-special-input
        evtmgr
        messagetype
        module-apps
        module-bsp
        module-vfs
        platform
        service-audio
        service-bluetooth
        service-desktop
        service-lwip
        platform
        PurePhone-evtmgr
        ${LWIP_LIBRARIES}
        "$<$<STREQUAL:${PROJECT_TARGET},TARGET_Linux>:iosyscalls>"
        "$<$<STREQUAL:${PROJECT_TARGET},TARGET_RT1051>:CrashCatcher::CrashCatcher>"


@@ 105,3 104,7 @@ github_message_standalone()
github_message_update()

add_subdirectory(services)

if (${ENABLE_TESTS})
    add_subdirectory(test)
endif ()

M products/PurePhone/PurePhoneMain.cpp => products/PurePhone/PurePhoneMain.cpp +2 -2
@@ 22,7 22,7 @@
#include <application-onboarding/ApplicationOnBoarding.hpp>

// services
#include <evtmgr/PureEventManager.hpp>
#include <evtmgr/EventManager.hpp>
#include <service-appmgr/model/ApplicationManager.hpp>
#include <service-audio/ServiceAudio.hpp>
#include <service-bluetooth/ServiceBluetooth.hpp>


@@ 78,7 78,7 @@ int main()
    }

    std::vector<std::unique_ptr<sys::BaseServiceCreator>> systemServices;
    systemServices.emplace_back(sys::CreatorFor<PureEventManager>());
    systemServices.emplace_back(sys::CreatorFor<EventManager>());
#if ENABLE_FILEINDEXER_SERVICE
    systemServices.emplace_back(sys::CreatorFor<service::ServiceFileIndexer>());
#endif

M products/PurePhone/services/evtmgr/CMakeLists.txt => products/PurePhone/services/evtmgr/CMakeLists.txt +8 -9
@@ 1,19 1,18 @@
add_library(PurePhone-evtmgr STATIC)
add_library(evtmgr STATIC)

target_sources(PurePhone-evtmgr
target_sources(evtmgr
    PRIVATE
        PureEventManager.cpp
        include/evtmgr/PureEventManager.hpp
        EventManager.cpp
    PUBLIC
        include/evtmgr/EventManager.hpp
)

target_include_directories(PurePhone-evtmgr
    PRIVATE
        include/evtmgr
target_include_directories(evtmgr
    PUBLIC
        include
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(PurePhone-evtmgr
target_link_libraries(evtmgr
    PRIVATE
        module-bsp
        module-sys

R products/PurePhone/services/evtmgr/PureEventManager.cpp => products/PurePhone/services/evtmgr/EventManager.cpp +11 -11
@@ 1,7 1,7 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "PureEventManager.hpp"
#include <evtmgr/EventManager.hpp>

#include <bsp/magnetometer/magnetometer.hpp>
#include <bsp/torch/torch.hpp>


@@ 23,7 23,7 @@ namespace
    }
} // namespace

bool PureEventManager::processVibraRequest(bsp::vibrator::Action act, std::chrono::milliseconds RepetitionTime)
bool EventManager::processVibraRequest(bsp::vibrator::Action act, std::chrono::milliseconds RepetitionTime)
{
    switch (act) {
    case bsp::vibrator::Action::pulse:


@@ 42,9 42,9 @@ bool PureEventManager::processVibraRequest(bsp::vibrator::Action act, std::chron
    return true;
}

sys::ReturnCodes PureEventManager::InitHandler()
sys::ReturnCodes EventManager::InitHandler()
{
    EventManager::InitHandler();
    EventManagerCommon::InitHandler();

    backlightHandler.init();



@@ 125,14 125,14 @@ sys::ReturnCodes PureEventManager::InitHandler()
    return sys::ReturnCodes::Success;
}

void PureEventManager::toggleTorchOnOff()
void EventManager::toggleTorchOnOff()
{
    auto state    = bsp::torch::getState();
    auto newState = (state.second == bsp::torch::State::off) ? bsp::torch::State::on : bsp::torch::State::off;
    bsp::torch::turn(newState, bsp::torch::ColourTemperature::coldest);
}

void PureEventManager::toggleTorchColor()
void EventManager::toggleTorchColor()
{
    auto state = bsp::torch::getState();
    if (state.second == bsp::torch::State::on) {


@@ 143,11 143,11 @@ void PureEventManager::toggleTorchColor()
    }
}

sys::MessagePointer PureEventManager::DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp)
sys::MessagePointer EventManager::DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp)
{

    auto responseMessage =
        std::static_pointer_cast<sys::ResponseMessage>(EventManager::DataReceivedHandler(msgl, resp));
        std::static_pointer_cast<sys::ResponseMessage>(EventManagerCommon::DataReceivedHandler(msgl, resp));

    if (responseMessage->retCode != sys::ReturnCodes::Unresolved) {
        return responseMessage;


@@ 186,9 186,9 @@ sys::MessagePointer PureEventManager::DataReceivedHandler(sys::DataMessage *msgl
    }
}

void PureEventManager::handleKeyEvent(sys::Message *msg)
void EventManager::handleKeyEvent(sys::Message *msg)
{
    EventManager::handleKeyEvent(msg);
    EventManagerCommon::handleKeyEvent(msg);

    auto kbdMessage = dynamic_cast<sevm::KbdMessage *>(msg);



@@ 201,7 201,7 @@ void PureEventManager::handleKeyEvent(sys::Message *msg)
    }
}

void PureEventManager::handleKeyMoveEvent(RawKey key)
void EventManager::handleKeyMoveEvent(RawKey key)
{
    if (isSliderKeyCode(key.keyCode)) {
        LOG_INFO("Slider position: %s", magic_enum::enum_name(key.keyCode).data());

R products/PurePhone/services/evtmgr/include/evtmgr/PureEventManager.hpp => products/PurePhone/services/evtmgr/include/evtmgr/EventManager.hpp +5 -5
@@ 3,17 3,17 @@

#pragma once

#include <service-evtmgr/EventManager.hpp>
#include <service-evtmgr/EventManagerCommon.hpp>

#include <backlight-handler/BacklightHandler.hpp>
#include <bsp/vibrator/vibrator.hpp>
#include <vibra/Vibra.hpp>

class PureEventManager : public EventManager
class EventManager : public EventManagerCommon
{
  public:
    explicit PureEventManager(const std::string &name = service::name::evt_manager)
        : EventManager(name), Vibra(std::make_unique<vibra_handle::Vibra>(this)), backlightHandler(settings, this)
    explicit EventManager(const std::string &name = service::name::evt_manager)
        : EventManagerCommon(name), Vibra(std::make_unique<vibra_handle::Vibra>(this)), backlightHandler(settings, this)
    {}

  private:


@@ 33,7 33,7 @@ class PureEventManager : public EventManager

namespace sys
{
    template <> struct ManifestTraits<PureEventManager>
    template <> struct ManifestTraits<EventManager>
    {
        static auto GetManifest() -> ServiceManifest
        {

M products/PurePhone/test/CMakeLists.txt => products/PurePhone/test/CMakeLists.txt +0 -1
@@ 1,2 1,1 @@
include(AddCatch2Executable)
add_subdirectory(test-settings)

M products/PurePhone/test/test-settings/CMakeLists.txt => products/PurePhone/test/test-settings/CMakeLists.txt +1 -1
@@ 6,12 6,12 @@ add_catch2_executable(
            main.cpp
            test-service-db-settings-api.cpp
        LIBS
            evtmgr
            module-audio
            module-cellular
            module-vfs
            service-audio
            service-cellular
            PurePhone-evtmgr
        DEPS
            module-sys
)

M products/PurePhone/test/test-settings/test-service-db-settings-api.cpp => products/PurePhone/test/test-settings/test-service-db-settings-api.cpp +3 -3
@@ 8,11 8,11 @@
#include <functional>
#include <thread> // for Message_t, ResponseMessage, DataMessage, Message

#include <evtmgr/EventManager.hpp>
#include <module-services/service-db/ServiceDB.hpp>
#include <module-sys/SystemManager/SystemManager.hpp>

#include <service-evtmgr/Constants.hpp>
#include <evtmgr/PureEventManager.hpp>

#include "test-service-db-settings-testmsgs.hpp"
#include "test-service-db-settings-testservices.hpp"


@@ 36,8 36,8 @@ TEST_CASE("SettingsApi")
            testStart = std::make_shared<std::mutex>();
            testStart->lock();
            std::cout << "start thr_id: " << std::this_thread::get_id() << std::endl << std::flush;
            auto ret = sys::SystemManager::RunSystemService(
                std::make_shared<PureEventManager>(service::name::evt_manager), manager.get());
            auto ret = sys::SystemManager::RunSystemService(std::make_shared<EventManager>(service::name::evt_manager),
                                                            manager.get());
            ret &= sys::SystemManager::RunSystemService(std::make_shared<ServiceDB>(), manager.get());

            varWritter = std::make_shared<settings::MyService>("writterVar");

M test/CMakeLists.txt => test/CMakeLists.txt +68 -1
@@ 17,7 17,8 @@ include(Catch)
include(CMakeParseArguments)
include(DiskImage)
include(GoogleTest)
include(AddCatch2Executable)

add_custom_target(unittests)

set(ROOT_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
set(TEST_ASSETS_DEST_DIR ${CMAKE_BINARY_DIR}/test-sysroot/sys)


@@ 112,6 113,72 @@ function(add_gtest_executable)
    set_tests_properties(${_TEST_LIST} PROPERTIES LABELS ${_TEST_LABELS})
endfunction()

function(add_catch2_executable)
    cmake_parse_arguments(
            _TEST_ARGS
            "USE_FS"
            "NAME"
            "SRCS;INCLUDE;LIBS;DEFS;DEPS"
            ${ARGN}
    )

    if(NOT _TEST_ARGS_NAME)
        message(FATAL_ERROR "You must provide a test name")
    endif(NOT _TEST_ARGS_NAME)
    set(_TESTNAME "catch2-${_TEST_ARGS_NAME}")

    if(NOT _TEST_ARGS_SRCS)
        message(FATAL_ERROR "You must provide test sources for ${_TESTNAME}")
    endif(NOT _TEST_ARGS_SRCS)

    get_directory_property(_TEST_ENTITY TEST_ENTITY)

    add_executable(${_TESTNAME} EXCLUDE_FROM_ALL ${_TEST_ARGS_SRCS})

    target_compile_options(${_TESTNAME} PUBLIC "-fsanitize=address")
    target_link_options(${_TESTNAME} PUBLIC "-fsanitize=address")

    # disable logs in unit tests
    if (NOT ${ENABLE_TEST_LOGS} AND NOT ${_TESTNAME} STREQUAL "catch2-utils-log")
        target_sources(${_TESTNAME} PRIVATE ${ROOT_TEST_DIR}/mock-logs.cpp)
        target_sources(${_TESTNAME} PRIVATE ${ROOT_TEST_DIR}/mock-freertos-tls.cpp)
    endif (NOT ${ENABLE_TEST_LOGS} AND NOT ${_TESTNAME} STREQUAL "catch2-utils-log")

    set(_TEST_LABELS "")
    if(_TEST_ARGS_USE_FS)
        enable_test_filesystem()
    endif()

    target_link_libraries(${_TESTNAME} PRIVATE Catch2::Catch2 log)
    foreach(lib ${_TEST_ARGS_LIBS})
        target_link_libraries(${_TESTNAME} PRIVATE ${lib})
    endforeach(lib)
    foreach(include ${_TEST_ARGS_INCLUDE})
        target_include_directories(${_TESTNAME} PRIVATE ${include})
    endforeach(include)

    foreach(def ${_TEST_ARGS_DEFS})
        target_compile_definitions(${_TESTNAME} PRIVATE ${def})
    endforeach(def)

    foreach(dep ${_TEST_ARGS_DEPS})
        add_dependencies(${_TESTNAME}  ${dep})
    endforeach(dep)

    add_dependencies(unittests ${_TESTNAME})
    add_dependencies(check ${_TESTNAME})

    if(_TEST_ENTITY)
        add_dependencies(unittests-${_TEST_ENTITY} ${_TESTNAME})
        list(APPEND _TEST_LABELS ${_TEST_ENTITY})
    endif()

    catch_discover_tests(${_TESTNAME}
            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
            PROPERTIES LABELS ${_TEST_LABELS}
            )
endfunction()

function(add_test_entity)
    cmake_parse_arguments(
        _ARGS