~aleteoryx/muditaos

02b8d2bf1d77fe78d2a1d0ad1136e420856880f9 — Piotr Tański 4 years ago b673981 + 9dc5ba9
Merge branch 'master' into stable
457 files changed, 1415 insertions(+), 1322 deletions(-)

M .github/workflows/releases.yaml
M CMakeLists.txt
M Jenkinsfile
M board/linux/libiosyscalls/test/CMakeLists.txt
M board/rt1051/_exit.c
M board/rt1051/crashdump/consoledump.cpp
M board/rt1051/crashdump/crashcatcher_impl.cpp
M board/rt1051/crashdump/crashdumpwriter_vfs.cpp
M cmake/modules/AddHexTarget.cmake
M cmake/modules/AddPackage.cmake
M cmake/modules/GitHubWorkerMessages.cmake
M config/format-config.sh
A doc/build_targets.md
M doc/quickstart.md
M enabled_unittests
M host-tools/CMakeLists.txt
M host-tools/pure-flash/CMakeLists.txt
M image/assets/lang/English.json
M image/user/db/settings_v2_002.sql
M image/user/db/sms_003.sql
M module-apps/Application.cpp
M module-apps/CMakeLists.txt
M module-apps/DOMResponder.cpp
M module-apps/application-alarm-clock/widgets/AlarmItem.cpp
M module-apps/application-calendar/data/dateCommon.hpp
M module-apps/application-calendar/widgets/AllEventsItem.cpp
M module-apps/application-calendar/widgets/DayEventsItem.cpp
M module-apps/application-calendar/widgets/EventDetailDescriptionItem.cpp
M module-apps/application-call/ApplicationCall.cpp
M module-apps/application-call/widgets/StateIcon.hpp
M module-apps/application-call/windows/CallWindow.cpp
M module-apps/application-calllog/ApplicationCallLog.cpp
M module-apps/application-calllog/CalllogModel.cpp
M module-apps/application-calllog/windows/CallLogDetailsWindow.cpp
M module-apps/application-clock/ApplicationClock.cpp
M module-apps/application-desktop/ApplicationDesktop.cpp
M module-apps/application-desktop/ApplicationDesktop.hpp
M module-apps/application-desktop/windows/ChargingBatteryWindow.cpp
M module-apps/application-desktop/windows/DeadBatteryWindow.cpp
M module-apps/application-desktop/windows/DesktopMainWindow.cpp
M module-apps/application-desktop/windows/LogoWindow.cpp
M module-apps/application-desktop/windows/Update.cpp
M module-apps/application-desktop/windows/UpdateProgress.cpp
M module-apps/application-messages/CMakeLists.txt
M module-apps/application-messages/data/SMSdata.hpp
M module-apps/application-messages/models/ThreadsModel.cpp
M module-apps/application-messages/windows/MessagesMainWindow.cpp
M module-apps/application-messages/windows/OptionsMessages.cpp
M module-apps/application-messages/windows/SMSTemplatesWindow.cpp
M module-apps/application-messages/windows/SMSThreadViewWindow.cpp
M module-apps/application-messages/windows/ThreadWindowOptions.cpp
M module-apps/application-music-player/ApplicationMusicPlayer.cpp
M module-apps/application-music-player/windows/MusicPlayerEmptyWindow.cpp
M module-apps/application-notes/CMakeLists.txt
M module-apps/application-notes/model/NotesSearchListModel.cpp
M module-apps/application-notes/widgets/NotesItem.cpp
M module-apps/application-notes/windows/NotePreviewWindow.cpp
M module-apps/application-notes/windows/NotesOptions.cpp
M module-apps/application-onboarding/CMakeLists.txt
M module-apps/application-onboarding/data/OnBoardingSwitchData.hpp
M module-apps/application-onboarding/windows/ConfigurationSuccessfulDialogWindow.cpp
M module-apps/application-onboarding/windows/NoConfigurationDialogWindow.cpp
M module-apps/application-onboarding/windows/UpdateDialogWindow.cpp
M module-apps/application-onboarding/windows/UpdateDialogWindow.hpp
M module-apps/application-settings-new/ApplicationSettings.cpp
M module-apps/application-settings-new/ApplicationSettings.hpp
M module-apps/application-settings-new/CMakeLists.txt
M module-apps/application-settings-new/data/QuoteSwitchData.hpp
M module-apps/application-settings-new/models/AudioSettingsModel.cpp
M module-apps/application-settings-new/models/DateAndTimeModel.cpp
M module-apps/application-settings-new/models/QuotesModel.cpp
M module-apps/application-settings-new/widgets/QuoteWidget.hpp
M module-apps/application-settings-new/windows/DateAndTimeMainWindow.cpp
M module-apps/application-settings-new/windows/NetworkWindow.cpp
M module-apps/application-settings-new/windows/QuotesMainWindow.cpp
M module-apps/application-settings-new/windows/SecurityMainWindow.cpp
M module-apps/application-settings-new/windows/SecurityMainWindow.hpp
M module-apps/application-settings-new/windows/SettingsMainWindow.cpp
M module-apps/application-settings/ApplicationSettings.hpp
M module-apps/application-settings/CMakeLists.txt
M module-apps/application-settings/windows/DateTimeWindow.cpp
M module-apps/application-settings/windows/Info.cpp
M module-apps/application-settings/windows/SettingsMainWindow.cpp
M module-apps/application-settings/windows/UITestWindow.cpp
M module-apps/locks/handlers/LockPolicyHandler.cpp
M module-apps/locks/handlers/SimLockHandler.cpp
M module-apps/locks/widgets/Lock.cpp
M module-apps/popups/PowerOffWindow.cpp
M module-apps/widgets/DateOrTimeListItem.hpp
M module-apps/widgets/TimeWidget.hpp
M module-apps/windows/NoEvents.cpp
M module-apps/windows/OptionWindow.cpp
M module-audio/Audio/Audio.cpp
M module-audio/Audio/Operation/PlaybackOperation.cpp
M module-audio/Audio/Operation/RecorderOperation.cpp
M module-audio/Audio/Operation/RouterOperation.cpp
M module-audio/Audio/decoder/Decoder.hpp
M module-audio/Audio/encoder/EncoderWAV.cpp
M module-audio/Audio/test/CMakeLists.txt
M module-audio/CMakeLists.txt
M module-audio/board/rt1051/RT1051AudioCodec.cpp
M module-audio/board/rt1051/RT1051CellularAudio.cpp
M module-bluetooth/Bluetooth/BluetoothWorker.cpp
M module-bluetooth/Bluetooth/BtKeysStorage.cpp
M module-bluetooth/Bluetooth/BtKeysStorage.hpp
M module-bluetooth/Bluetooth/WorkerController.cpp
M module-bluetooth/Bluetooth/glucode/BluetoothRunLoop.hpp
M module-bluetooth/Bluetooth/glucode/btstack_uart_block_rt1051.cpp
M module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DP.cpp
M module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DPImpl.hpp
M module-bluetooth/Bluetooth/interface/profiles/GAP/GAP.cpp
M module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp
M module-bluetooth/Bluetooth/interface/profiles/PAN.cpp
M module-bluetooth/CMakeLists.txt
M module-bsp/CMakeLists.txt
M module-bsp/board/linux/audio/LinuxCellularAudio.cpp
M module-bsp/board/linux/audio/linux_audiocodec.cpp
M module-bsp/board/linux/battery-charger/battery_charger.cpp
M module-bsp/board/linux/bluetooth/Bluetooth.cpp
M module-bsp/board/linux/cellular/linux_cellular.cpp
M module-bsp/board/linux/vibrator/vibrator.cpp
M module-bsp/board/linux/watchdog/software_watchdog.cpp
M module-bsp/board/rt1051/bluetooth/BlueKitchen.cpp
M module-bsp/board/rt1051/bluetooth/BluetoothCommon.cpp
M module-bsp/board/rt1051/bluetooth/Bluetopia.cpp
M module-bsp/board/rt1051/bsp/battery-charger/battery_charger.cpp
M module-bsp/board/rt1051/bsp/cellular/rt1051_cellular.cpp
M module-bsp/board/rt1051/bsp/eeprom/eeprom.cpp
M module-bsp/board/rt1051/bsp/light_sensor/light_sensor.cpp
M module-bsp/board/rt1051/bsp/lpm/CpuFreqLPM.cpp
M module-bsp/board/rt1051/bsp/lpm/RT1051LPM.cpp
M module-bsp/board/rt1051/bsp/rtc/rtc.cpp
M module-bsp/board/rt1051/common/chip.cpp
M module-bsp/board/rt1051/common/clock_config.cpp
M module-bsp/board/rt1051/common/startup_mimxrt1052.cpp
M module-bsp/board/rt1051/drivers/RT1051DriverDMA.cpp
M module-bsp/board/rt1051/drivers/RT1051DriverGPIO.cpp
M module-bsp/board/rt1051/drivers/RT1051DriverI2C.cpp
M module-bsp/board/rt1051/drivers/RT1051DriverPLL.cpp
M module-bsp/board/rt1051/drivers/RT1051DriverPWM.cpp
M module-bsp/bsp/cellular/bsp_cellular.hpp
M module-bsp/bsp/usb/usb.hpp
M module-cellular/CMakeLists.txt
M module-cellular/at/UrcCreg.hpp
M module-cellular/at/cmd/src/CFUN.cpp
M module-cellular/at/cmd/src/CSCA.cpp
M module-cellular/at/cmd/src/QECCNUM.cpp
M module-cellular/at/response.hpp
M module-cellular/at/src/UrcCtze.cpp
M module-cellular/modem/ATCommon.cpp
M module-cellular/modem/mux/CellularMuxFrame.h
M module-cellular/modem/mux/DLCChannel.cpp
M module-cellular/test/CMakeLists.txt
M module-db/CMakeLists.txt
M module-db/Common/Query.hpp
M module-db/Database/Database.cpp
M module-db/Database/DatabaseInitializer.cpp
M module-db/Database/Field.cpp
M module-db/Interface/AlarmsRecord.hpp
M module-db/Interface/CalllogRecord.cpp
M module-db/Interface/EventsRecord.cpp
M module-db/Interface/NotificationsRecord.cpp
M module-db/Interface/Record.cpp
M module-db/Interface/SMSRecord.cpp
M module-db/Interface/SMSTemplateRecord.cpp
M module-db/Interface/ThreadRecord.cpp
M module-db/Tables/AlarmsTable.hpp
M module-db/Tables/CalllogTable.cpp
M module-db/Tables/ContactsTable.cpp
M module-db/Tables/EventsTable.cpp
M module-db/Tables/NotesTable.cpp
M module-db/Tables/NotificationsTable.cpp
M module-db/Tables/Record.hpp
M module-db/Tables/SMSTable.cpp
M module-db/Tables/SMSTemplateTable.cpp
M module-db/Tables/ThreadsTable.cpp
M module-db/tests/CMakeLists.txt
M module-db/tests/DbInitializer.cpp
M module-db/tests/QueryInterface.cpp
M module-gui/CMakeLists.txt
M module-gui/gui/core/DrawCommand.cpp
M module-gui/gui/core/Font.cpp
M module-gui/gui/core/FontManager.cpp
M module-gui/gui/core/ImageManager.cpp
M module-gui/gui/core/RawFont.cpp
M module-gui/gui/dom/Item2JsonSerializer.hpp
M module-gui/gui/dom/Item2JsonSerializingVisitor.hpp
M module-gui/gui/input/Profile.cpp
M module-gui/gui/input/Profile.hpp
M module-gui/gui/input/Translator.cpp
M module-gui/gui/widgets/Arc.cpp
M module-gui/gui/widgets/BottomBar.cpp
M module-gui/gui/widgets/BoxLayout.cpp
M module-gui/gui/widgets/BoxLayout.hpp
M module-gui/gui/widgets/Circle.cpp
M module-gui/gui/widgets/GridLayout.cpp
M module-gui/gui/widgets/Image.cpp
M module-gui/gui/widgets/InputMode.cpp
M module-gui/gui/widgets/Label.cpp
M module-gui/gui/widgets/ListItem.cpp
M module-gui/gui/widgets/ListView.cpp
M module-gui/gui/widgets/ProgressBar.cpp
M module-gui/gui/widgets/Rect.cpp
M module-gui/gui/widgets/RichTextParser.cpp
M module-gui/gui/widgets/StatusBar.cpp
M module-gui/gui/widgets/Text.cpp
M module-gui/gui/widgets/TextBlock.cpp
M module-gui/gui/widgets/TextBlockCursor.cpp
M module-gui/gui/widgets/TextCursor.cpp
M module-gui/gui/widgets/TextLineCursor.cpp
M module-gui/gui/widgets/status-bar/BatteryBase.hpp
M module-gui/gui/widgets/status-bar/NetworkAccessTechnology.hpp
M module-gui/gui/widgets/status-bar/PhoneMode.cpp
M module-gui/gui/widgets/status-bar/PhoneMode.hpp
M module-gui/gui/widgets/status-bar/SIM.hpp
M module-gui/gui/widgets/status-bar/SignalStrengthBase.hpp
M module-gui/gui/widgets/status-bar/SignalStrengthText.cpp
M module-gui/gui/widgets/status-bar/StatusBarWidgetBase.hpp
M module-gui/test/mock/TestListViewProvider.cpp
M module-gui/test/test-catch/test-context.cpp
M module-gui/test/test-catch/test-gui.cpp
M module-gui/test/test-google/test-gui-boxlayout.cpp
M module-gui/test/test-google/test-gui-gridlayout.cpp
M module-gui/test/test-google/test-gui-listview.cpp
M module-os/CMakeLists.txt
M module-os/FreeRTOS/application.c
M module-os/FreeRTOS/include/FreeRTOSConfig.h
M module-os/systemviewPatch/FreeRTOSConfig.h
M module-services/CMakeLists.txt
M module-services/service-antenna/CMakeLists.txt
M module-services/service-antenna/ServiceAntenna.cpp
M module-services/service-antenna/service-antenna/ServiceAntenna.hpp
R {module-utils/state => module-services/service-antenna/service-antenna}/ServiceState.hpp
M module-services/service-appmgr/CMakeLists.txt
M module-services/service-appmgr/model/ActionsRegistry.cpp
M module-services/service-appmgr/model/ApplicationManager.cpp
M module-services/service-appmgr/service-appmgr/messages/DOMRequest.hpp
M module-services/service-audio/AudioServiceAPI.cpp
M module-services/service-bluetooth/CMakeLists.txt
M module-services/service-bluetooth/ServiceBluetooth.cpp
M module-services/service-bluetooth/service-bluetooth/SettingsHolder.hpp
M module-services/service-bluetooth/service-bluetooth/SettingsSerializer.cpp
M module-services/service-bluetooth/service-bluetooth/SettingsSerializer.hpp
M module-services/service-cellular/CMakeLists.txt
M module-services/service-cellular/CellularCall.cpp
M module-services/service-cellular/CellularServiceAPI.cpp
M module-services/service-cellular/NetworkSettings.cpp
M module-services/service-cellular/RequestFactory.cpp
M module-services/service-cellular/ServiceCellular.cpp
M module-services/service-cellular/SignalStrength.cpp
M module-services/service-cellular/include/service-cellular/api/common.hpp
M module-services/service-cellular/include/service-cellular/api/notification/notification.hpp
M module-services/service-cellular/service-cellular/PacketDataTypes.hpp
M module-services/service-cellular/service-cellular/SignalStrength.hpp
M module-services/service-cellular/src/SimCard.cpp
M module-services/service-cellular/src/State.cpp
M module-services/service-cellular/src/messages.hpp
M module-services/service-cellular/tests/CMakeLists.txt
M module-services/service-db/CMakeLists.txt
M module-services/service-db/DBServiceAPI.cpp
M module-services/service-db/ServiceDB.cpp
M module-services/service-db/agents/file_indexer/FileIndexerAgent.cpp
M module-services/service-db/agents/settings/FactorySettings.hpp
M module-services/service-db/agents/settings/Settings.cpp
M module-services/service-db/agents/settings/Settings_queries.hpp
M module-services/service-db/agents/settings/SystemSettings.hpp
M module-services/service-db/test/test-settings/Database.cpp
M module-services/service-desktop/CMakeLists.txt
M module-services/service-desktop/DesktopMessages.cpp
M module-services/service-desktop/ServiceDesktop.cpp
M module-services/service-desktop/USBSecurityModel.cpp
M module-services/service-desktop/WorkerDesktop.cpp
R module-services/service-desktop/endpoints/{developerMode/Mode => }/BaseHelper.cpp
R module-services/service-desktop/endpoints/{developerMode/Mode => }/BaseHelper.hpp
M module-services/service-desktop/endpoints/Context.hpp
M module-services/service-desktop/endpoints/Endpoint.hpp
M module-services/service-desktop/endpoints/EndpointFactory.hpp
M module-services/service-desktop/endpoints/ResponseContext.hpp
M module-services/service-desktop/endpoints/backup/BackupEndpoint.cpp
M module-services/service-desktop/endpoints/backup/BackupRestore.cpp
M module-services/service-desktop/endpoints/backup/BackupRestore.hpp
M module-services/service-desktop/endpoints/calendarEvents/CalendarEventsHelper.cpp
M module-services/service-desktop/endpoints/calllog/CalllogHelper.hpp
M module-services/service-desktop/endpoints/contacts/ContactHelper.cpp
M module-services/service-desktop/endpoints/contacts/ContactHelper.hpp
M module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.cpp
M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.cpp
M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.hpp
M module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.cpp
M module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.hpp
M module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp
M module-services/service-desktop/endpoints/factoryReset/FactoryReset.cpp
M module-services/service-desktop/endpoints/factoryReset/FactoryResetEndpoint.cpp
M module-services/service-desktop/endpoints/messages/MessageHelper.cpp
M module-services/service-desktop/endpoints/messages/MessageHelper.hpp
M module-services/service-desktop/endpoints/restore/RestoreEndpoint.cpp
M module-services/service-desktop/endpoints/security/SecurityEndpoint.cpp
M module-services/service-desktop/endpoints/security/SecurityEndpoint.hpp
A module-services/service-desktop/endpoints/security/SecurityEndpointHelper.cpp
A module-services/service-desktop/endpoints/security/SecurityEndpointHelper.hpp
M module-services/service-desktop/endpoints/update/UpdateEndpoint.cpp
M module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp
M module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp
M module-services/service-desktop/parser/HttpEnums.cpp
M module-services/service-desktop/parser/MessageHandler.cpp
M module-services/service-desktop/parser/MessageHandler.hpp
M module-services/service-desktop/parser/ParserFSM.cpp
M module-services/service-desktop/parser/ParserFSM.hpp
M module-services/service-desktop/parser/ParserUtils.hpp
M module-services/service-desktop/service-desktop/DesktopMessages.hpp
M module-services/service-desktop/service-desktop/ServiceDesktop.hpp
M module-services/service-desktop/service-desktop/USBSecurityModel.hpp
M module-services/service-desktop/tests/test-contacts.cpp
M module-services/service-desktop/tests/unittest.cpp
M module-services/service-eink/ServiceEink.cpp
M module-services/service-evtmgr/CMakeLists.txt
M module-services/service-evtmgr/EventManager.cpp
M module-services/service-evtmgr/WorkerEvent.cpp
M module-services/service-evtmgr/backlight-handler/BacklightHandler.cpp
M module-services/service-evtmgr/battery-level-check/BatteryLevelCheck.cpp
M module-services/service-evtmgr/vibra/Vibra.cpp
M module-services/service-fileindexer/CMakeLists.txt
M module-services/service-fileindexer/notesIndexer.cpp
M module-services/service-fota/FotaServiceAPI.cpp
M module-services/service-fota/ServiceFota.cpp
M module-services/service-fota/service-fota/ServiceFota.hpp
M module-services/service-gui/ServiceGUI.cpp
M module-services/service-gui/WorkerGUI.cpp
M module-services/service-lwip/ServiceLwIP.cpp
M module-services/service-time/ServiceTime.cpp
M module-services/service-time/TimezoneHandler.cpp
M module-services/service-time/tests/CMakeLists.txt
M module-sys/CMakeLists.txt
M module-sys/Service/Service.cpp
M module-sys/SystemManager/CpuGovernor.cpp
M module-sys/SystemManager/CpuStatistics.cpp
M module-sys/SystemManager/DeviceManager.cpp
M module-sys/SystemManager/PowerManager.cpp
M module-sys/SystemManager/SystemManager.cpp
M module-sys/SystemWatchdog/SystemWatchdog.cpp
M module-sys/Timers/SystemTimer.cpp
M module-utils/CMakeLists.txt
A module-utils/Clipboard/CMakeLists.txt
R module-utils/{common_data => Clipboard}/Clipboard.cpp
R module-utils/{common_data => Clipboard}/Clipboard.hpp
A module-utils/Clipboard/test/CMakeLists.txt
R module-utils/{ => Clipboard}/test/unittest_clipboard.cpp
A module-utils/EventStore/CMakeLists.txt
R module-utils/{common_data => EventStore}/EventStore.cpp
R module-utils/{common_data => EventStore}/EventStore.hpp
M module-utils/PhoneNumber.cpp
M module-utils/PhoneNumber.hpp
M module-utils/Utils.hpp
A module-utils/board/CMakeLists.txt
M module-utils/board/cross/log_rt1051.cpp
M module-utils/board/cross/log_writeLUART.cpp
M module-utils/board/cross/log_writeRTT.cpp
M module-utils/board/cross/log_writeSYSTEMVIEW.cpp
M module-utils/board/linux/log_linux.cpp
M module-utils/bootconfig/CMakeLists.txt
M module-utils/bootconfig/include/boot/bootconfig.hpp
M module-utils/bootconfig/src/bootconfig.cpp
M module-utils/i18n/i18n.cpp
M module-utils/i18n/i18nImpl.hpp
M module-utils/ical/ParserICS.cpp
M module-utils/ical/ParserICS.hpp
A module-utils/log/CMakeLists.txt
M module-utils/log/Logger.cpp
M module-utils/log/Logger.hpp
M module-utils/log/log.cpp
D module-utils/targets/Target_Cross.cmake
D module-utils/targets/Target_Linux.cmake
M module-utils/test/CMakeLists.txt
M module-utils/test/test_LoggerBuffer.cpp
M module-utils/test/test_log.cpp
D module-utils/test/unittest_TimeRangeParser.cpp
A module-utils/time/CMakeLists.txt
A module-utils/time/test/CMakeLists.txt
A module-utils/time/test/unittest_TimeRangeParser.cpp
R module-utils/time/{ => }/time/DateAndTimeSettings.cpp
R module-utils/time/{ => }/time/DateAndTimeSettings.hpp
R module-utils/time/{ => }/time/FromTillDate.hpp
R module-utils/time/{ => }/time/README.md
R module-utils/time/{ => }/time/ScopedTime.hpp
R module-utils/time/{ => }/time/TimeRangeParser.cpp
R module-utils/time/{ => }/time/TimeRangeParser.hpp
R module-utils/time/{ => }/time/time_conversion.cpp
R module-utils/time/{ => }/time/time_conversion.hpp
R module-utils/time/{ => }/time/time_date_validation.cpp
R module-utils/time/{ => }/time/time_date_validation.hpp
R module-utils/time/{ => }/time/time_locale.hpp
R module-utils/time/{ => }/time/time_syscalls.hpp
A module-utils/ucs2/CMakeLists.txt
A module-utils/ucs2/test/CMakeLists.txt
R module-utils/{ => ucs2}/test/unittest_ucs2.cpp
R module-utils/ucs2/{ => }/ucs2/UCS2.cpp
R module-utils/ucs2/{ => }/ucs2/UCS2.hpp
A module-utils/utf8/CMakeLists.txt
A module-utils/utf8/test/CMakeLists.txt
R module-utils/{ => utf8}/test/unittest_utf8.cpp
R module-utils/utf8/{ => }/utf8/UTF8.cpp
R module-utils/utf8/{ => }/utf8/UTF8.hpp
M module-vfs/CMakeLists.txt
M module-vfs/drivers/src/purefs/fs/filesystem_littlefs.cpp
M module-vfs/drivers/src/purefs/fs/filesystem_vfat.cpp
M module-vfs/drivers/src/thirdparty/littlefs/lfs_glue.cpp
M module-vfs/src/purefs/blkdev/disk_handle.cpp
M module-vfs/src/purefs/blkdev/disk_manager.cpp
M module-vfs/src/purefs/blkdev/partition_parser.cpp
M module-vfs/src/purefs/fs/filesystem_syscalls.cpp
M module-vfs/src/purefs/vfs_subsystem.cpp
M module-vfs/tests/CMakeLists.txt
M products/PurePhone/CMakeLists.txt
M products/PurePhone/PurePhoneMain.cpp
M source/MessageType.hpp
M test/CMakeLists.txt
M test/firmware_update_test/update.py
M test/harness
M test/make_a_call.py
M test/mock-logs.cpp
M test/phone_modem_clear_sms_queue.py
M test/phone_off.py
M test/phone_sim_check.py
M test/phone_sim_detection_on.py
M test/phone_unlock.py
M test/pytest/conftest.py
M test/pytest/service-bluetooth/test_basic_control_dev_perspective.py
M test/pytest/service-bluetooth/test_pairing_dev_perspective.py
M test/pytest/service-bluetooth/test_pairing_hmi_perspective.py
M test/pytest/service-desktop/test_backup.py
M test/pytest/service-desktop/test_battery_file.py
M test/pytest/service-desktop/test_calendar.py
M test/pytest/service-desktop/test_calendar_events.py
M test/pytest/service-desktop/test_calllog.py
M test/pytest/service-desktop/test_contacts.py
M test/pytest/service-desktop/test_device_info.py
M test/pytest/service-desktop/test_factory_reset.py
M test/pytest/service-desktop/test_messages.py
M test/pytest/service-desktop/test_restore.py
M test/pytest/service-desktop/test_security.py
M test/pytest/service-desktop/test_templates.py
M test/pytest/service-desktop/test_threads.py
M test/pytest/service-desktop/test_update.py
M test/pytest/test_call.py
M test/pytest/test_call_back.py
M test/pytest/test_cellular_sleep.py
M test/pytest/test_cellular_start.py
M test/pytest/test_send_message.py
M test/search_sms.py
M test/set_tethering.py
M test/version_check.py
M third-party/CMakeLists.txt
A third-party/json/CMakeLists.txt
R {module-utils => third-party}/json/json11.cpp
R {module-utils => third-party}/json/json11.hpp
M third-party/re2/CMakeLists.txt
M tools/run_unittests.sh
M .github/workflows/releases.yaml => .github/workflows/releases.yaml +3 -3
@@ 38,9 38,9 @@ jobs:
        echo "JOBS=${JOBS}" &&  \
        ./configure.sh rt1051 RelWithDebInfo -G Ninja && \
        pushd build-rt1051-RelWithDebInfo && \
        ninja -j ${JOBS} && \
        ninja -j ${JOBS} package-update && \
        ninja -j ${JOBS} package-standalone && \
        ninja -j ${JOBS} Pure&& \
        ninja -j ${JOBS} PurePhone-UpdatePackage && \
        ninja -j ${JOBS} PurePhone-StandaloneImage && \
        popd && \
        ./print_last_changes.sh && \
        uptime

M CMakeLists.txt => CMakeLists.txt +1 -2
@@ 1,4 1,4 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.19.5)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)


@@ 159,4 159,3 @@ add_custom_target(
fetch_ecoboot()
add_subdirectory(products)

include(GitHubWorkerMessages)

M Jenkinsfile => Jenkinsfile +2 -0
@@ 148,7 148,9 @@ export JOBS=${JOBS:-6}
echo "JOBS=${JOBS}"
pushd "${WORKSPACE}"
./tools/run_unittests.sh enabled_unittests
set +e
./tools/check_unittests.sh
set -e
pushd build-linux-Debug
./googletest-gui
popd

M board/linux/libiosyscalls/test/CMakeLists.txt => board/linux/libiosyscalls/test/CMakeLists.txt +0 -2
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

# iosyscalls tests
add_catch2_executable(
    NAME

M board/rt1051/_exit.c => board/rt1051/_exit.c +1 -1
@@ 32,7 32,7 @@

#include <FreeRTOS.h>
#include <MIMXRT1051.h>
#include <log/log.hpp>
#include <log.hpp>
#include <task.h>
#include <macros.h>
// ----------------------------------------------------------------------------

M board/rt1051/crashdump/consoledump.cpp => board/rt1051/crashdump/consoledump.cpp +1 -1
@@ 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 <log/log.hpp>
#include <log.hpp>

#include "consoledump.hpp"
#include "MIMXRT1051.h"

M board/rt1051/crashdump/crashcatcher_impl.cpp => board/rt1051/crashdump/crashcatcher_impl.cpp +1 -1
@@ 5,7 5,7 @@

#include <CrashCatcher.h>

#include <log/log.hpp>
#include <log.hpp>
#include <date/date.h>
#include "crashdumpwriter.hpp"


M board/rt1051/crashdump/crashdumpwriter_vfs.cpp => board/rt1051/crashdump/crashdumpwriter_vfs.cpp +1 -1
@@ 3,7 3,7 @@

#include "crashdumpwriter_vfs.hpp"

#include <log/log.hpp>
#include <log.hpp>
#include <fcntl.h>
#include "purefs/vfs_subsystem.hpp"


M cmake/modules/AddHexTarget.cmake => cmake/modules/AddHexTarget.cmake +2 -1
@@ 4,7 4,8 @@ function(add_hex_target SOURCE_TARGET)
        COMMENT "Generate ${HEX_FILE}"
        OUTPUT ${CMAKE_BINARY_DIR}/${HEX_FILE}
        DEPENDS ${SOURCE_TARGET}
        COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${SOURCE_TARGET}>
        COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${SOURCE_TARGET}> ${CMAKE_BINARY_DIR}/${HEX_FILE}

        )
    add_custom_target(
        ${HEX_FILE}-target ALL

M cmake/modules/AddPackage.cmake => cmake/modules/AddPackage.cmake +8 -5
@@ 1,5 1,3 @@


macro(set_cpack_vars)
    if (${PROJECT_TARGET} STREQUAL "TARGET_Linux")
        set(CPACK_SYSTEM_NAME "Linux")


@@ 33,11 31,12 @@ function(add_standalone_image SOURCE_TARGET)
    set(CPACK_PACKAGE_NAME ${SOURCE_TARGET})
    set_cpack_vars()

    set(PACKAGE_STANDALONE_MIME "application/x-xz")
    set(PACKAGE_STANDALONE_FILE_NAME ${PACKAGE_COMMON_NAME}-image.tar.xz)
    set(STANDALONE_PKG ${PACKAGE_COMMON_NAME}-image.tar.xz)
    set(PACKAGE_STANDALONE_FILE_NAME ${STANDALONE_PKG} PARENT_SCOPE)
    set(PACKAGE_STANDALONE_MIME "application/x-xz" PARENT_SCOPE)

    add_custom_target(${PACKAGE_COMMON_NAME}-package-standalone
        COMMAND tar -ScJf ${PACKAGE_STANDALONE_FILE_NAME} ${SOURCE_TARGET}.img
        COMMAND tar -ScJf ${STANDALONE_PKG} ${SOURCE_TARGET}.img
        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
        DEPENDS ${BIN_FILE} ${ECOBOOT_FILE}-target ${VERSION_JSON_FILE}-target ${SOURCE_TARGET}.img
        )


@@ 55,6 54,10 @@ function(add_update_package SOURCE_TARGET)
    set(CPACK_PACKAGE_NAME ${SOURCE_TARGET})
    set_cpack_vars()
    set(UPDATE_PKG "${SOURCE_TARGET}-${CMAKE_PROJECT_VERSION}-${CPACK_SYSTEM_NAME}-Update.tar")

    set(PACKAGE_UPDATE_FILE_NAME ${UPDATE_PKG} PARENT_SCOPE)
    set(PACKAGE_UPDATE_MIME "application/x-tar" PARENT_SCOPE)

    add_custom_command(
        OUTPUT ${UPDATE_PKG}
        DEPENDS ${SOURCE_TARGET}

M cmake/modules/GitHubWorkerMessages.cmake => cmake/modules/GitHubWorkerMessages.cmake +6 -1
@@ 1,4 1,4 @@
function(github_worker_message)
function(github_message_standalone)
    if (NOT DEFINED ENV{GITHUB_WORKSPACE})
        return()
    endif()


@@ 6,7 6,12 @@ function(github_worker_message)
        message("::set-output name=package-standalone::${PACKAGE_STANDALONE_FILE_NAME}")
        message("set-output name=standalone-mime_type::${PACKAGE_STANDALONE_MIME}")
        message("::set-output name=standalone-mime_type::${PACKAGE_STANDALONE_MIME}")
endfunction()

function(github_message_update)
    if (NOT DEFINED ENV{GITHUB_WORKSPACE})
        return()
    endif()
        message("set-output name=package-update::${PACKAGE_UPDATE_FILE_NAME}")
        message("::set-output name=package-update::${PACKAGE_UPDATE_FILE_NAME}")
        message("set-output name=update-mime_type::${PACKAGE_UPDATE_MIME}")

M config/format-config.sh => config/format-config.sh +1 -1
@@ 47,7 47,6 @@ export declare ignore_paths=(
    'module-lwip/includes/lwipopts.h'
    'module-lwip/lib/lwip/'
    'module-os/'
    'module-utils/json/'
    'module-utils/microtar/'
    'module-utils/segger/log/'
    'module-utils/segger/systemview/'


@@ 56,6 55,7 @@ export declare ignore_paths=(
    'module-vfs/board/free_rtos_custom/include/FreeRTOSFATConfig.h'
    'module-vfs/drivers/include/thirdparty/fatfs/ffconf.h'
    'module-vfs/thirdparty/*'
    'third-party/'
)

# bash function using above config function

A doc/build_targets.md => doc/build_targets.md +33 -0
@@ 0,0 1,33 @@
# Products

In one source tree we have two products:

* PurePhone
* BellHybrid

For simplicity, we have defined a few CMake targets that will create
all required images and prepare update packages.

# Architectures

We support two target architectures:

* Linux x86_64
* RT1051

Some build targets are enabled/disabled based on the selected target architecture.

# Targets


| Arch | Name | Alias | Description |
|------|------|-------|-------------|
|common| Pure | | Main target for PurePhone |
|common| Bell | | Main target for BellHybrid |
|common| PurePhone-disk-img  | PurePhone.img  | Disk image for PurePhone  |
|common| BellHybrid-disk-img | BellHybrid.img | Disk image for BellHybrid | 
|RT1051| PurePhone-StandaloneImage  | PurePhone-\<version\>-RT1051-package-standalone  | Creates image that can be `dd` or `pureflash` to the device|
|RT1051| PurePhone-UpdatePackage    | PurePhone-\<version\>-RT1051-Update.tar          | Creates Update package, that can be used by Mudita Center or an update script|
|RT1051| BellHybrid-StandaloneImage | BellHybrid-\<version\>-RT1051-package-standalone | Creates image that can be `dd` or `pureflash` to the device|
|RT1051| BellHybrid-UpdatePackage   | BellHybrid-\<version\>-RT1051-Update.tar         | Creates Update package, that can be used by Mudita Center or an update script|


M doc/quickstart.md => doc/quickstart.md +4 -13
@@ 74,8 74,8 @@ git submodule update --init --recursive                        # initialize subm
cd ./config/ && ./bootstrap.sh 0- && cd ../                    # bootstrap requirements
./configure.sh rt1051|linux Debug|Release|RelWithDebInfo       # configure build
cd <build-dir>                                                 # build dir depends on configuration
make -j                                                        # build
./PurePhone                                                    # run PurePhone - simulator screen will pop up (on the Linux filesystem)
make Pure                                               # build
./PurePhone.elf                                                # run PurePhone - simulator screen will pop up (on the Linux filesystem)
```

If you want to run the simulator with image and our VFS implementation


@@ 105,7 105,7 @@ git submodule update --init --recursive
cd ./config/ && ./bootstrap.sh 0- && cd ../
./configure.sh rt1051 RelWithDebInfo
cd build-arm-RelWithDebInfo
make -j
make Pure

```



@@ 270,16 270,7 @@ Please be aware that when building custom image you'll have to give it some tag 

## Preparing packages

If you need a package, containing everything needed to run the application (on target device or Linux), in the build directory run the following command: `make package`

After executing this command, the name of the package that was created will be displayed on the screen.

Package name is: `PurePhone-<version>-<target>.<extension>`
where:

- `<version>`   - is read from the latest "release-x.y.z" tag
- `<target>`    - RT1051 or Linux 
- `<extension>` - `zip` for RT1051 and `tar.gz` for Linux
If you need a package, containing everything needed to run the application, please check (build_targests.md)[./doc/build_targests.md] document.

## Generating code coverage reports


M enabled_unittests => enabled_unittests +2 -3
@@ 248,7 248,6 @@ TESTS_LIST["catch2-service-db"]="
    Settings Messages;
    Quotes;
    Factory Settings;
    Factory Settings Init;
"
#---------
TESTS_LIST["catch2-service-db-settings"]="


@@ 364,7 363,7 @@ TESTS_LIST["catch2-utils-time_display"]="
    Time display parser;
"
#---------
TESTS_LIST["catch2-utils-ucs2"]="
TESTS_LIST["catch2-ucs2"]="
    UCS2 to UTF8 conversion;
    UCS2 from UTF8 emoji 😁;
    UCS2 from UTF8 emoji 🍣;


@@ 380,7 379,7 @@ TESTS_LIST["catch2-utils-ucs2"]="
    UTF8 to UCS2 long string conversion;
"
#---------
TESTS_LIST["catch2-utils-utf8"]="
TESTS_LIST["catch2-utf8"]="
    UTF8: operator index returns value;
    UTF8: operator index exceeds string size;
    UTF8: operator== returns properly;

M host-tools/CMakeLists.txt => host-tools/CMakeLists.txt +8 -10
@@ 1,3 1,5 @@
include(ExternalProject)

if (CMAKE_CROSSCOMPILING)
    # Littlefs fuse is needed in rt1051 and Linux for manipulate images
    # genlittlefs is needed only on the Linux image for generate emulator target image


@@ 19,19 21,15 @@ if (CMAKE_CROSSCOMPILING)
        -H"${CMAKE_SOURCE_DIR}/host-tools/genlittlefs"
        COMMAND ${CMAKE_COMMAND} --build genlittlefs --config Release
    )
    add_custom_target(
        pureflash
        COMMAND ${CMAKE_COMMAND}
        -DCMAKE_BUILD_TYPE:STRING="Release"
        -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE:PATH="${CMAKE_BINARY_DIR}"
        -B"pureflash"
        -H"${CMAKE_SOURCE_DIR}/host-tools/pure-flash"
        COMMAND ${CMAKE_COMMAND} --build pureflash --config Release
    ExternalProject_Add(pureflash
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/pure-flash
        INSTALL_DIR ${PROJECT_BINARY_DIR}
        CMAKE_ARGS
            -D CMAKE_BUILD_TYPE=Release
            -D CMAKE_INSTALL_PREFIX=<INSTALL_DIR>
    )

else()
    set(_genlittlefs "${CMAKE_BINARY_DIR}/genlittlefs${CMAKE_EXECUTABLE_SUFFIX}")
    add_subdirectory(genlittlefs)
    add_subdirectory(littlefs-fuse)
endif()


M host-tools/pure-flash/CMakeLists.txt => host-tools/pure-flash/CMakeLists.txt +5 -0
@@ 9,4 9,9 @@ set(PUREFLASH_SRCS

add_executable(${PROJECT_NAME} ${PUREFLASH_SRCS})
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -pedantic -Werror -Wextra )

target_compile_definitions(${PROJECT_NAME} PRIVATE _GNU_SOURCE _DEFAULT_SOURCE)

install(TARGETS pureflash
    RUNTIME DESTINATION .
)

M image/assets/lang/English.json => image/assets/lang/English.json +1 -1
@@ 322,7 322,7 @@
  "app_onboarding_skip_confirm": "<text>Sim setup is required for network connection. Skip the setup anyway? </text>",
  "app_onboarding_configuration_successful": "<text>Your Mudita Pure<br></br>is ready to use.</text>",
  "app_onboarding_no_configuration": "<text>Your Mudita Pure has not been<br></br>configured. You can go to<br></br>Settings to set it up.</text>",
  "app_onboarding_update_info": "<text>New Mudita OS version is available.</text><br></br><text>To update your Pure Phone, please</text><br></br><text>visit: </text><text font='gt_pressura' weight='bold' size='27'>www.mudita.com/updateos</text><br></br><text>and follow the instructions.</text>",
  "app_onboarding_update_info": "<text>The current version of MuditaOS is <br></br> <token>$VERSION</token>. Updates with new <br></br> features and fixes appear often. <br></br>To update your Phone please <br></br> visit: </text><text font='gt_pressura' weight='bold' size='27'>www.mudita.com/updateos</text><br></br><text>and follow the instructions.</text>",
  "app_settings_title_main": "Advanced",
  "app_settings_title_main_new": "Settings",
  "app_settings_bt": "Bluetooth",

M image/user/db/settings_v2_002.sql => image/user/db/settings_v2_002.sql +0 -1
@@ 21,7 21,6 @@ INSERT OR IGNORE INTO settings_tab (path, value) VALUES
    ('gs_eula_accepted', '0'),
    ('\ApplicationManager\\gs_onboarding_done', '1'),
    ('gs_usb_security', '1'),
    ('gs_usb_devices', ''),
    ('gs_os_update_version', '0.00.0'),
    ('gs_os_current_version', '0.00.0'),
    ('\ServiceBluetooth\\bt_state', '0'),

M image/user/db/sms_003.sql => image/user/db/sms_003.sql +2 -2
@@ 12,6 12,6 @@ INSERT OR REPLACE INTO "templates" ("_id","text","lastUsageTimestamp") VALUES (2
INSERT OR REPLACE INTO "templates" ("_id","text","lastUsageTimestamp") VALUES (3,'I''ll be there in 15 minutes',2);
INSERT OR REPLACE INTO "templates" ("_id","text","lastUsageTimestamp") VALUES (4,'Some test template number, which is too long to be displayed.',1);
INSERT OR REPLACE INTO "templates" ("_id","text","lastUsageTimestamp") VALUES (5,'Give me 5 minutes',5);
INSERT OR REPLACE INTO "threads" ("_id","date","msg_count","read","contact_id","number_id","snippet","last_dir") VALUES (1,1574335694,3,1,1,1,'I''m happy to hear that :)',4);
INSERT OR REPLACE INTO "threads" ("_id","date","msg_count","read","contact_id","number_id","snippet","last_dir") VALUES (2,1618910720,2,0,2,2,'It was great seeing you too :*',4);
INSERT OR REPLACE INTO "threads" ("_id","date","msg_count","read","contact_id","number_id","snippet","last_dir") VALUES (1,1618907734,3,1,1,1,'I''m happy to hear that :)',4);
INSERT OR REPLACE INTO "threads" ("_id","date","msg_count","read","contact_id","number_id","snippet","last_dir") VALUES (2,1547492321,2,0,2,2,'It was great seeing you too :*',4);
COMMIT;

M module-apps/Application.cpp => module-apps/Application.cpp +3 -3
@@ 10,11 10,11 @@
#include "StatusBar.hpp"
#include "status-bar/Time.hpp"
#include "Translator.hpp"                // for KeyInputSim...
#include "common_data/EventStore.hpp"    // for Battery
#include <EventStore.hpp>                // for Battery
#include "common_data/RawKey.hpp"        // for RawKey, key...
#include "gui/input/InputEvent.hpp"      // for InputEvent
#include "log/debug.hpp"                 // for DEBUG_APPLI...
#include "log/log.hpp"                   // for LOG_INFO
#include <log.hpp>                       // for LOG_INFO
#include "messages/AppMessage.hpp"       // for AppSwitchMe...
#include "service-appmgr/Controller.hpp" // for Controller
#include <service-cellular-api>


@@ 37,7 37,7 @@
#include <service-gui/Common.hpp>
#include <module-utils/Utils.hpp>
#include <service-db/agents/settings/SystemSettings.hpp>
#include <module-utils/time/DateAndTimeSettings.hpp>
#include <time/DateAndTimeSettings.hpp>
#include <service-audio/AudioServiceAPI.hpp> // for GetOutputVolume

#include <popups/VolumeWindow.hpp>

M module-apps/CMakeLists.txt => module-apps/CMakeLists.txt +12 -6
@@ 1,8 1,6 @@
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

cmake_minimum_required(VERSION 3.14)

project(module-apps VERSION 1.0
        DESCRIPTION "Library with all applications.")



@@ 105,6 103,11 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
    endforeach()
endif()

option(ENABLE_VOLTE "Enable VoLTE" OFF)
if(${ENABLE_VOLTE})
    target_compile_definitions(${PROJECT_NAME} PUBLIC ENABLE_VOLTE=1)
endif()

include_directories( ../module-sys )
include_directories( ../module-utils )
include_directories( ../module-services )


@@ 119,22 122,25 @@ add_subdirectory(locks)
target_link_libraries(${PROJECT_NAME}
    PRIVATE
        date::date
        service-appmgr
        service-antenna
        service-appmgr
        service-audio
        service-cellular
        service-db
        service-evtmgr
        Microsoft.GSL::GSL
        eventstore
    PUBLIC
        module-audio
        module-bsp
        module-db
        module-gui
        module-os
        module-services
        module-sys
        module-utils
        module-gui
        module-services
        module-db
        time
        utf8
        ${TARGET_LIBRARIES}
)


M module-apps/DOMResponder.cpp => module-apps/DOMResponder.cpp +1 -1
@@ 7,7 7,7 @@
#include <module-gui/gui/dom/Item2JsonSerializer.hpp>
#include <memory>
#include <Item.hpp>
#include <module-utils/time/ScopedTime.hpp>
#include <time/ScopedTime.hpp>
#include <service-desktop/endpoints/developerMode/event/DomRequest.hpp>

namespace app

M module-apps/application-alarm-clock/widgets/AlarmItem.cpp => module-apps/application-alarm-clock/widgets/AlarmItem.cpp +1 -1
@@ 6,7 6,7 @@
#include "application-alarm-clock/data/AlarmsData.hpp"
#include "application-calendar/data/dateCommon.hpp"
#include <InputEvent.hpp>
#include <module-utils/time/time_conversion.hpp>
#include <time/time_conversion.hpp>

namespace gui
{

M module-apps/application-calendar/data/dateCommon.hpp => module-apps/application-calendar/data/dateCommon.hpp +1 -1
@@ 5,7 5,7 @@
#define DATECOMMON_H

#include <date/date.h>
#include <module-utils/time/DateAndTimeSettings.hpp>
#include <time/DateAndTimeSettings.hpp>
#include <time/time_conversion.hpp>
#include <Utils.hpp>
#include <random>

M module-apps/application-calendar/widgets/AllEventsItem.cpp => module-apps/application-calendar/widgets/AllEventsItem.cpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "AllEventsItem.hpp"


@@ 7,7 7,7 @@
#include <Style.hpp>
#include <gui/widgets/Label.hpp>
#include <time/time_conversion.hpp>
#include <module-utils/time/TimeRangeParser.hpp>
#include <time/TimeRangeParser.hpp>

namespace gui
{

M module-apps/application-calendar/widgets/DayEventsItem.cpp => module-apps/application-calendar/widgets/DayEventsItem.cpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "DayEventsItem.hpp"


@@ 6,7 6,7 @@
#include <ListView.hpp>
#include <gui/widgets/Label.hpp>
#include <Style.hpp>
#include <module-utils/time/TimeRangeParser.hpp>
#include <time/TimeRangeParser.hpp>

namespace gui
{

M module-apps/application-calendar/widgets/EventDetailDescriptionItem.cpp => module-apps/application-calendar/widgets/EventDetailDescriptionItem.cpp +1 -1
@@ 6,7 6,7 @@
#include <Style.hpp>
#include <time/time_conversion.hpp>
#include <date/date.h>
#include <module-utils/time/TimeRangeParser.hpp>
#include <time/TimeRangeParser.hpp>

namespace gui
{

M module-apps/application-call/ApplicationCall.cpp => module-apps/application-call/ApplicationCall.cpp +1 -1
@@ 14,7 14,7 @@
#include <MessageType.hpp>
#include <PhoneNumber.hpp>
#include <Dialog.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <memory>
#include <service-cellular/ServiceCellular.hpp>
#include <service-cellular/CellularServiceAPI.hpp>

M module-apps/application-call/widgets/StateIcon.hpp => module-apps/application-call/widgets/StateIcon.hpp +1 -1
@@ 6,7 6,7 @@
#include "Image.hpp"
#include "Label.hpp"
#include <Style.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <i18n/i18n.hpp>
#include <map>


M module-apps/application-call/windows/CallWindow.cpp => module-apps/application-call/windows/CallWindow.cpp +8 -6
@@ 7,7 7,7 @@
#include "InputEvent.hpp"
#include "application-call/data/CallState.hpp"
#include "application-call/widgets/StateIcons.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "service-appmgr/Controller.hpp"

#include "application-call/ApplicationCall.hpp"


@@ 136,9 136,11 @@ namespace gui
        };
        sendSmsIcon->activatedCallback = [=](gui::Item &item) {
            LOG_INFO("Send message template and reject the call");
            return app::manager::Controller::sendAction(application,
                                                        app::manager::actions::ShowSmsTemplates,
                                                        std::make_unique<SMSSendTemplateRequest>(phoneNumber));
            constexpr auto preventAutoLock = true;
            return app::manager::Controller::sendAction(
                application,
                app::manager::actions::ShowSmsTemplates,
                std::make_unique<SMSSendTemplateRequest>(phoneNumber, preventAutoLock));
        };

        // define navigation between icons


@@ 452,14 454,14 @@ namespace gui
    void CallWindow::setCallEndMessage()
    {
        switch (callEndType) {
        case CallEndType::None:
            [[fallthrough]];
        case CallEndType::Ended:
            durationLabel->setText(utils::translate(strings::callended));
            break;
        case CallEndType::Rejected:
            durationLabel->setText(utils::translate(strings::callrejected));
            break;
        case CallEndType::None:
            break;
        }
    }
} /* namespace gui */

M module-apps/application-calllog/ApplicationCallLog.cpp => module-apps/application-calllog/ApplicationCallLog.cpp +1 -1
@@ 13,7 13,7 @@
#include <Dialog.hpp>
#include <OptionWindow.hpp>
#include <i18n/i18n.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <MessageType.hpp>
#include <module-db/queries/calllog/QueryCalllogSetAllRead.hpp>
#include <module-db/queries/notifications/QueryNotificationsClear.hpp>

M module-apps/application-calllog/CalllogModel.cpp => module-apps/application-calllog/CalllogModel.cpp +1 -1
@@ 8,7 8,7 @@
#include "data/CallLogInternals.hpp"
#include "data/CallLogSwitchData.hpp"
#include "widgets/CalllogItem.hpp"
#include <module-utils/time/DateAndTimeSettings.hpp>
#include <time/DateAndTimeSettings.hpp>

#include <service-appmgr/Controller.hpp>
#include "application-call/data/CallSwitchData.hpp"

M module-apps/application-calllog/windows/CallLogDetailsWindow.cpp => module-apps/application-calllog/windows/CallLogDetailsWindow.cpp +1 -1
@@ 11,7 11,7 @@
#include <application-calllog/data/CallLogInternals.hpp>
#include <application-calllog/data/CallLogSwitchData.hpp>
#include <application-calllog/windows/CallLogOptionsWindow.hpp>
#include <module-utils/time/DateAndTimeSettings.hpp>
#include <time/DateAndTimeSettings.hpp>
#include <widgets/TextWithIconsWidget.hpp>
#include <widgets/ActiveIconFactory.hpp>


M module-apps/application-clock/ApplicationClock.cpp => module-apps/application-clock/ApplicationClock.cpp +1 -1
@@ 6,7 6,7 @@
#include "gui/widgets/Window.hpp"

// module-utils
#include "log/log.hpp"
#include <log.hpp>
#include <service-evtmgr/EVMessages.hpp>
#include <service-evtmgr/EventManager.hpp>
#include <service-appmgr/model/ApplicationManager.hpp>

M module-apps/application-desktop/ApplicationDesktop.cpp => module-apps/application-desktop/ApplicationDesktop.cpp +10 -9
@@ 26,8 26,7 @@
#include "data/DesktopData.hpp"

#include <service-appmgr/Controller.hpp>
#include <service-cellular/ServiceCellular.hpp>
#include <service-cellular/CellularMessage.hpp>
#include <service-cellular-api>
#include <service-db/QueryMessage.hpp>
#include <module-services/service-db/agents/settings/SystemSettings.hpp>
#include <magic_enum.hpp>


@@ 85,6 84,12 @@ namespace app
            switchWindow(app::window::name::logo_window, std::move(data));
            return actionHandled();
        });

        connect(typeid(cellular::msg::notification::ModemStateChanged), [this](sys::Message *request) {
            auto msg = static_cast<cellular::msg::notification::ModemStateChanged *>(request);
            handle(msg);
            return sys::MessageNone{};
        });
    }

    // Invoked upon receiving data message


@@ 98,10 103,7 @@ namespace app
        }

        bool handled = false;
        if (auto msg = dynamic_cast<cellular::StateChange *>(msgl)) {
            handled = handle(msg);
        }
        else if (auto msg = dynamic_cast<sdesktop::UpdateOsMessage *>(msgl)) {
        if (auto msg = dynamic_cast<sdesktop::UpdateOsMessage *>(msgl)) {
            handled = handle(msg);
        }



@@ 147,13 149,12 @@ namespace app
        }
    }

    auto ApplicationDesktop::handle(cellular::StateChange *msg) -> bool
    void ApplicationDesktop::handle(cellular::msg::notification::ModemStateChanged *msg)
    {
        assert(msg);
        if (msg->request == cellular::service::State::ST::ModemFatalFailure) {
        if (msg->state == cellular::api::ModemState::Fatal) {
            switchWindow(app::window::name::desktop_reboot);
        }
        return false;
    }

    // Invoked during initialization

M module-apps/application-desktop/ApplicationDesktop.hpp => module-apps/application-desktop/ApplicationDesktop.hpp +3 -3
@@ 10,9 10,9 @@
#include <Service/Message.hpp>
#include <service-desktop/DesktopMessages.hpp>

namespace cellular
namespace cellular::msg::notification
{
    class StateChange;
    class ModemStateChanged;
}

namespace gui


@@ 42,7 42,7 @@ namespace app
        void destroyUserInterface() override;
        // if there is modem notification and there is no default SIM selected, then we need to select if when unlock is
        // done
        bool handle(cellular::StateChange *msg);
        void handle(cellular::msg::notification::ModemStateChanged *msg);
        auto handle(sdesktop::UpdateOsMessage *msg) -> bool;
        void handleNotificationsChanged(std::unique_ptr<gui::SwitchData> notificationsParams) override;


M module-apps/application-desktop/windows/ChargingBatteryWindow.cpp => module-apps/application-desktop/windows/ChargingBatteryWindow.cpp +1 -1
@@ 4,7 4,7 @@
#include "ChargingBatteryWindow.hpp"
#include "InputEvent.hpp"
#include "gui/widgets/Image.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <application-desktop/windows/Names.hpp>
#include <service-appmgr/model/ApplicationManager.hpp>
#include <service-appmgr/Controller.hpp>

M module-apps/application-desktop/windows/DeadBatteryWindow.cpp => module-apps/application-desktop/windows/DeadBatteryWindow.cpp +1 -1
@@ 4,7 4,7 @@
#include "DeadBatteryWindow.hpp"
#include "InputEvent.hpp"
#include "gui/widgets/Image.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <application-desktop/windows/Names.hpp>
#include <service-appmgr/model/ApplicationManager.hpp>
#include <service-appmgr/Controller.hpp>

M module-apps/application-desktop/windows/DesktopMainWindow.cpp => module-apps/application-desktop/windows/DesktopMainWindow.cpp +1 -1
@@ 17,7 17,7 @@
#include <windows/DialogMetadata.hpp>
#include <messages/DialogMetadataMessage.hpp>

#include <log/log.hpp>
#include <log.hpp>

namespace gui
{

M module-apps/application-desktop/windows/LogoWindow.cpp => module-apps/application-desktop/windows/LogoWindow.cpp +1 -1
@@ 3,7 3,7 @@

#include "LogoWindow.hpp"
#include "gui/widgets/Image.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <application-desktop/windows/Names.hpp>

namespace gui

M module-apps/application-desktop/windows/Update.cpp => module-apps/application-desktop/windows/Update.cpp +1 -1
@@ 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 "log/log.hpp"
#include <log.hpp>
#include "application-desktop/data/DesktopData.hpp"
#include <source/version.hpp>


M module-apps/application-desktop/windows/UpdateProgress.cpp => module-apps/application-desktop/windows/UpdateProgress.cpp +1 -1
@@ 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 <log/log.hpp>
#include <log.hpp>
#include <source/version.hpp>
#include <boot/bootconfig.hpp>


M module-apps/application-messages/CMakeLists.txt => module-apps/application-messages/CMakeLists.txt +1 -0
@@ 52,4 52,5 @@ target_sources( ${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME}
    PRIVATE
        service-db
        clipboard
    )

M module-apps/application-messages/data/SMSdata.hpp => module-apps/application-messages/data/SMSdata.hpp +11 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 53,9 53,18 @@ class SMSSendRequest : public SMSRequest
class SMSSendTemplateRequest : public SMSRequest
{
  public:
    SMSSendTemplateRequest(const utils::PhoneNumber::View &phoneNumber) : SMSRequest(phoneNumber)
    SMSSendTemplateRequest(const utils::PhoneNumber::View &phoneNumber, bool preventAutoLock = false)
        : SMSRequest(phoneNumber), preventAutoLock(preventAutoLock)
    {}
    ~SMSSendTemplateRequest() override = default;

    [[nodiscard]] bool isAutoLockPrevented() const
    {
        return preventAutoLock;
    }

  private:
    bool preventAutoLock;
};

class SMSTemplateSent : public gui::SwitchData

M module-apps/application-messages/models/ThreadsModel.cpp => module-apps/application-messages/models/ThreadsModel.cpp +1 -1
@@ 10,7 10,7 @@
#include "application-messages/data/MessagesStyle.hpp"
#include "application-messages/widgets/ThreadItem.hpp"
#include "application-messages/windows/ThreadWindowOptions.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <module-db/queries/messages/threads/QueryThreadsGet.hpp>
#include <module-db/queries/messages/threads/QueryThreadsGetForList.hpp>
#include <service-db/DBServiceAPI.hpp>

M module-apps/application-messages/windows/MessagesMainWindow.cpp => module-apps/application-messages/windows/MessagesMainWindow.cpp +1 -1
@@ 16,7 16,7 @@
#include <i18n/i18n.hpp>
#include <application-phonebook/data/PhonebookItemData.hpp>
#include <Style.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <module-db/queries/notifications/QueryNotificationsClear.hpp>
#include <module-db/queries/messages/threads/QueryThreadGetByContactID.hpp>

M module-apps/application-messages/windows/OptionsMessages.cpp => module-apps/application-messages/windows/OptionsMessages.cpp +1 -1
@@ 5,7 5,7 @@
#include "application-messages/data/SMSdata.hpp"
#include "tools/Common.hpp"

#include <common_data/Clipboard.hpp>
#include <Clipboard.hpp>
#include <Option.hpp>
#include <Text.hpp>
#include <i18n/i18n.hpp>

M module-apps/application-messages/windows/SMSTemplatesWindow.cpp => module-apps/application-messages/windows/SMSTemplatesWindow.cpp +3 -1
@@ 10,7 10,7 @@
#include <service-appmgr/Controller.hpp>
#include <i18n/i18n.hpp>
#include <Style.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <cassert>
#include <memory>


@@ 73,6 73,7 @@ namespace gui

    void SMSTemplatesWindow::smsSendTemplateRequestHandler(const SMSSendTemplateRequest *const switchData)
    {
        preventsAutoLock = switchData->isAutoLockPrevented();
        auto app = dynamic_cast<app::ApplicationMessages *>(application);
        assert(app != nullptr);



@@ 89,6 90,7 @@ namespace gui

    void SMSTemplatesWindow::onBeforeShow(ShowMode mode, SwitchData *data)
    {
        preventsAutoLock = false;
        if (mode == ShowMode::GUI_SHOW_INIT) {
            list->rebuildList();
        }

M module-apps/application-messages/windows/SMSThreadViewWindow.cpp => module-apps/application-messages/windows/SMSThreadViewWindow.cpp +1 -1
@@ 15,7 15,7 @@
#include <service-db/DBNotificationMessage.hpp>
#include <module-db/queries/phonebook/QueryContactGetByID.hpp>

#include <log/log.hpp>
#include <log.hpp>
#include <Style.hpp>

#include <cassert>

M module-apps/application-messages/windows/ThreadWindowOptions.cpp => module-apps/application-messages/windows/ThreadWindowOptions.cpp +1 -1
@@ 3,7 3,7 @@

#include "ThreadWindowOptions.hpp"
#include <i18n/i18n.hpp>
#include "log/log.hpp"
#include <log.hpp>
#include <OptionWindow.hpp>
#include <module-services/service-db/service-db/DBServiceAPI.hpp>
#include <OptionCall.hpp>

M module-apps/application-music-player/ApplicationMusicPlayer.cpp => module-apps/application-music-player/ApplicationMusicPlayer.cpp +1 -1
@@ 6,7 6,7 @@
#include "windows/MusicPlayerEmptyWindow.hpp"

#include <filesystem>
#include <log/log.hpp>
#include <log.hpp>
#include <i18n/i18n.hpp>
#include <purefs/filesystem_paths.hpp>
#include <service-audio/AudioServiceAPI.hpp>

M module-apps/application-music-player/windows/MusicPlayerEmptyWindow.cpp => module-apps/application-music-player/windows/MusicPlayerEmptyWindow.cpp +1 -1
@@ 7,7 7,7 @@

#include <Style.hpp>
#include <i18n/i18n.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <service-audio/AudioServiceAPI.hpp>

namespace gui

M module-apps/application-notes/CMakeLists.txt => module-apps/application-notes/CMakeLists.txt +4 -0
@@ 54,3 54,7 @@ target_include_directories(${PROJECT_NAME}
        service-db
)

target_link_libraries(${PROJECT_NAME}
	PRIVATE
		clipboard
)

M module-apps/application-notes/model/NotesSearchListModel.cpp => module-apps/application-notes/model/NotesSearchListModel.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "NotesSearchListModel.hpp"
#include "log/log.hpp"
#include <log.hpp>

namespace app::notes
{

M module-apps/application-notes/widgets/NotesItem.cpp => module-apps/application-notes/widgets/NotesItem.cpp +1 -1
@@ 6,7 6,7 @@
#include <Style.hpp>
#include <module-apps/application-notes/style/NotesListStyle.hpp>

#include <module-utils/time/time_conversion.hpp>
#include <time/time_conversion.hpp>

namespace gui
{

M module-apps/application-notes/windows/NotePreviewWindow.cpp => module-apps/application-notes/windows/NotePreviewWindow.cpp +1 -1
@@ 10,7 10,7 @@
#include <module-apps/messages/OptionsWindow.hpp>

#include <i18n/i18n.hpp>
#include <module-utils/time/time_conversion.hpp>
#include <time/time_conversion.hpp>

#include <Style.hpp>


M module-apps/application-notes/windows/NotesOptions.cpp => module-apps/application-notes/windows/NotesOptions.cpp +2 -2
@@ 4,7 4,7 @@
#include "NotesOptions.hpp"

#include <Option.hpp>
#include <common_data/Clipboard.hpp>
#include <Clipboard.hpp>

#include <module-apps/windows/DialogMetadata.hpp>
#include <module-apps/messages/DialogMetadataMessage.hpp>


@@ 27,7 27,7 @@ namespace app::notes
        void removeNote(const NotesRecord &record, Application *application, AbstractNotesRepository &notesRepository)
        {
            auto metaData = std::make_unique<gui::DialogMetadataMessage>(
                gui::DialogMetadata{utils::translate("app_alarm_clock_title_main"),
                gui::DialogMetadata{record.snippet,
                                    "phonebook_contact_delete_trashcan",
                                    utils::translate("app_notes_note_delete_confirmation"),
                                    "",

M module-apps/application-onboarding/CMakeLists.txt => module-apps/application-onboarding/CMakeLists.txt +1 -0
@@ 49,4 49,5 @@ target_sources(${PROJECT_NAME}
target_include_directories(${PROJECT_NAME}
    PRIVATE
        service-db
        json::json
)

M module-apps/application-onboarding/data/OnBoardingSwitchData.hpp => module-apps/application-onboarding/data/OnBoardingSwitchData.hpp +1 -1
@@ 4,7 4,7 @@
#pragma once

#include <SwitchData.hpp>
#include <json/json11.hpp>
#include <json11.hpp>
#include <utility>

namespace app::onBoarding

M module-apps/application-onboarding/windows/ConfigurationSuccessfulDialogWindow.cpp => module-apps/application-onboarding/windows/ConfigurationSuccessfulDialogWindow.cpp +1 -8
@@ 27,14 27,7 @@ namespace app::onBoarding
    {
        if (inputEvent.isShortRelease()) {
            if (inputEvent.is(gui::KeyCode::KEY_ENTER)) {
                auto metaData = std::make_unique<gui::DialogMetadataMessage>(
                    gui::DialogMetadata{utils::translate("app_onboarding_title_update_info"),
                                        "update_icon_W_G",
                                        utils::translate("app_onboarding_update_info"),
                                        "",
                                        [=]() -> bool { return true; }});
                application->switchWindow(
                    gui::window::name::onBoarding_update, gui::ShowMode::GUI_SHOW_INIT, std::move(metaData));
                application->switchWindow(gui::window::name::onBoarding_update, gui::ShowMode::GUI_SHOW_INIT);
                return true;
            }


M module-apps/application-onboarding/windows/NoConfigurationDialogWindow.cpp => module-apps/application-onboarding/windows/NoConfigurationDialogWindow.cpp +1 -8
@@ 27,14 27,7 @@ namespace app::onBoarding
    {
        if (inputEvent.isShortRelease()) {
            if (inputEvent.is(gui::KeyCode::KEY_ENTER)) {
                auto metaData = std::make_unique<gui::DialogMetadataMessage>(
                    gui::DialogMetadata{utils::translate("app_onboarding_title_update_info"),
                                        "update_icon_W_G",
                                        utils::translate("app_onboarding_update_info"),
                                        "",
                                        [=]() -> bool { return true; }});
                application->switchWindow(
                    gui::window::name::onBoarding_update, gui::ShowMode::GUI_SHOW_INIT, std::move(metaData));
                application->switchWindow(gui::window::name::onBoarding_update, gui::ShowMode::GUI_SHOW_INIT);
                return true;
            }


M module-apps/application-onboarding/windows/UpdateDialogWindow.cpp => module-apps/application-onboarding/windows/UpdateDialogWindow.cpp +8 -0
@@ 8,6 8,7 @@

#include <application-onboarding/ApplicationOnBoarding.hpp>
#include <service-appmgr/service-appmgr/Controller.hpp>
#include <source/version.hpp>

namespace app::onBoarding
{


@@ 20,6 21,13 @@ namespace app::onBoarding
        presenter->attach(this);
    }

    void UpdateDialogWindow::onBeforeShow(gui::ShowMode mode, gui::SwitchData *data)
    {
        setTitle(utils::translate("app_onboarding_title_update_info"));
        icon->image->set("update_icon_W_G");
        icon->text->setRichText(utils::translate("app_onboarding_update_info"), {{"$VERSION", std::string(VERSION)}});
    }

    bool UpdateDialogWindow::onInput(const gui::InputEvent &inputEvent)
    {
        if (inputEvent.isShortRelease()) {

M module-apps/application-onboarding/windows/UpdateDialogWindow.hpp => module-apps/application-onboarding/windows/UpdateDialogWindow.hpp +1 -1
@@ 18,7 18,7 @@ namespace app::onBoarding
      public:
        UpdateDialogWindow(app::Application *app,
                           std::unique_ptr<OnBoardingFinalizeContract::Presenter> &&windowPresenter);

        void onBeforeShow(gui::ShowMode mode, gui::SwitchData *data) override;
        bool onInput(const gui::InputEvent &inputEvent) override;
    };
} // namespace app::onBoarding

M module-apps/application-settings-new/ApplicationSettings.cpp => module-apps/application-settings-new/ApplicationSettings.cpp +1 -17
@@ 307,10 307,6 @@ namespace app
            [this](const std::string &value) { volteChanged(value); },
            ::settings::SettingsScope::Global);
        settings->registerValueChange(
            ::settings::SystemProperties::usbSecurity,
            [this](const std::string &value) { usbSecured = utils::getNumericValue<bool>(value); },
            ::settings::SettingsScope::Global);
        settings->registerValueChange(
            ::settings::Cellular::offlineMode,
            [this](const std::string &value) { flightModeOn = utils::getNumericValue<bool>(value); },
            ::settings::SettingsScope::Global);


@@ 422,7 418,7 @@ namespace app
            return std::make_unique<gui::DialogYesNo>(app, name);
        });
        windowsFactory.attach(gui::window::name::security, [](Application *app, const std::string &name) {
            return std::make_unique<gui::SecurityMainWindow>(app, static_cast<ApplicationSettingsNew *>(app));
            return std::make_unique<gui::SecurityMainWindow>(app);
        });
        windowsFactory.attach(gui::window::name::dialog_confirm, [](Application *app, const std::string &name) {
            return std::make_unique<gui::DialogConfirm>(app, gui::window::name::dialog_confirm);


@@ 631,18 627,6 @@ namespace app
                           ::settings::SettingsScope::Global);
    }

    bool ApplicationSettingsNew::isUSBSecured() const
    {
        return usbSecured;
    }

    void ApplicationSettingsNew::setUSBSecurity(bool security)
    {
        usbSecured = security;
        settings->setValue(
            ::settings::SystemProperties::usbSecurity, std::to_string(security), ::settings::SettingsScope::Global);
    }

    auto ApplicationSettingsNew::getNotificationsWhenLocked() const noexcept -> bool
    {
        return notificationsWhenLocked;

M module-apps/application-settings-new/ApplicationSettings.hpp => module-apps/application-settings-new/ApplicationSettings.hpp +1 -15
@@ 8,7 8,7 @@
#include <bsp/common.hpp>
#include <bsp/keypad_backlight/keypad_backlight.hpp>
#include <module-services/service-evtmgr/screen-light-control/ScreenLightControl.hpp>
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>

namespace gui::window::name
{


@@ 128,15 128,6 @@ namespace app
            virtual void setKeypadBacklightState(bsp::keypad_backlight::State state) = 0;
        };

        class SecuritySettings
        {
          public:
            virtual ~SecuritySettings() = default;

            virtual auto isUSBSecured() const -> bool  = 0;
            virtual void setUSBSecurity(bool security) = 0;
        };

        class DndSettings
        {
          public:


@@ 178,7 169,6 @@ namespace app
                                   public settingsInterface::OperatorsSettings,
                                   public settingsInterface::ScreenLightSettings,
                                   public settingsInterface::KeypdBacklightSettings,
                                   public settingsInterface::SecuritySettings,
                                   public settingsInterface::DndSettings,
                                   public settingsInterface::OfflineSettings,
                                   public settingsInterface::ConnectionSettings,


@@ 222,9 212,6 @@ namespace app
        auto getKeypadBacklightState() -> bsp::keypad_backlight::State override;
        void setKeypadBacklightState(bsp::keypad_backlight::State keypadLightState) override;

        auto isUSBSecured() const -> bool override;
        void setUSBSecurity(bool security) override;

        auto getNotificationsWhenLocked() const noexcept -> bool override;
        void setNotificationsWhenLocked(bool on) noexcept override;
        auto getCallsFromFavourite() const noexcept -> bool override;


@@ 248,7 235,6 @@ namespace app
        bsp::Board board              = bsp::Board::none;
        bool operatorsOn              = false;
        bool voLteStateOn             = false;
        bool usbSecured               = true;
        bool notificationsWhenLocked  = true;
        bool callsFromFavorites       = false;
        int connectionFrequency       = 0;

M module-apps/application-settings-new/CMakeLists.txt => module-apps/application-settings-new/CMakeLists.txt +1 -0
@@ 119,4 119,5 @@ add_dependencies(${PROJECT_NAME} version)
target_link_libraries(${PROJECT_NAME}
    PUBLIC
        service-bluetooth
        eventstore
)

M module-apps/application-settings-new/data/QuoteSwitchData.hpp => module-apps/application-settings-new/data/QuoteSwitchData.hpp +1 -1
@@ 6,7 6,7 @@
#include "application-settings-new/models/QuotesModel.hpp"

#include <SwitchData.hpp>
#include <json/json11.hpp>
#include <json11.hpp>
#include <utility>

namespace Quotes

M module-apps/application-settings-new/models/AudioSettingsModel.cpp => module-apps/application-settings-new/models/AudioSettingsModel.cpp +1 -1
@@ 4,7 4,7 @@
#include "AudioSettingsModel.hpp"

#include <service-audio/AudioServiceAPI.hpp>
#include <log/log.hpp>
#include <log.hpp>

namespace audio_settings
{

M module-apps/application-settings-new/models/DateAndTimeModel.cpp => module-apps/application-settings-new/models/DateAndTimeModel.cpp +1 -1
@@ 6,7 6,7 @@
#include "DateAndTimeModel.hpp"
#include <ListView.hpp>
#include <module-apps/widgets/DateAndTimeStyle.hpp>
#include <module-utils/time/DateAndTimeSettings.hpp>
#include <time/DateAndTimeSettings.hpp>

DateAndTimeModel::DateAndTimeModel(app::Application *application) : app(application)
{}

M module-apps/application-settings-new/models/QuotesModel.cpp => module-apps/application-settings-new/models/QuotesModel.cpp +1 -1
@@ 7,7 7,7 @@

#include <InputEvent.hpp>
#include <i18n/i18n.hpp>
#include <json/json11.hpp>
#include <json11.hpp>
#include <Utils.hpp>
#include <string>
#include <utility>

M module-apps/application-settings-new/widgets/QuoteWidget.hpp => module-apps/application-settings-new/widgets/QuoteWidget.hpp +0 -1
@@ 9,7 9,6 @@
#include <ImageBox.hpp>
#include <Label.hpp>
#include <ListItem.hpp>
#include <json/json11.hpp>
#include <service-db/QuotesMessages.hpp>

namespace gui

M module-apps/application-settings-new/windows/DateAndTimeMainWindow.cpp => module-apps/application-settings-new/windows/DateAndTimeMainWindow.cpp +1 -1
@@ 4,7 4,7 @@
#include "application-settings-new/ApplicationSettings.hpp"
#include "DateAndTimeMainWindow.hpp"
#include "module-apps/application-desktop/windows/Names.hpp"
#include <module-utils/time/DateAndTimeSettings.hpp>
#include <time/DateAndTimeSettings.hpp>
#include "OptionSetting.hpp"
#include "service-appmgr/Controller.hpp"


M module-apps/application-settings-new/windows/NetworkWindow.cpp => module-apps/application-settings-new/windows/NetworkWindow.cpp +3 -2
@@ 45,7 45,6 @@ namespace gui
            break;
        }
        auto operatorsOn = operatorsSettings->getOperatorsOn();
        auto voLteOn     = operatorsSettings->getVoLTEOn();

        optList.emplace_back(std::make_unique<gui::option::OptionSettings>(
            utils::translate("app_settings_network_active_card") + ":" + simStr + " / " + phoneNumber,


@@ 114,6 113,8 @@ namespace gui
            nullptr,
            nullptr));

#if ENABLE_VOLTE == 1
        auto voLteOn = operatorsSettings->getVoLTEOn();
        optList.emplace_back(std::make_unique<gui::option::OptionSettings>(
            utils::translate("app_settings_network_voice_over_lte"),
            [=](gui::Item &item) {


@@ 124,7 125,7 @@ namespace gui
            nullptr,
            nullptr,
            voLteOn ? gui::option::SettingRightItem::On : gui::option::SettingRightItem::Off));

#endif // ENABLE_VOLTE
        optList.emplace_back(std::make_unique<gui::option::OptionSettings>(
            utils::translate("app_settings_network_apn_settings"),
            [=](gui::Item &item) {

M module-apps/application-settings-new/windows/QuotesMainWindow.cpp => module-apps/application-settings-new/windows/QuotesMainWindow.cpp +1 -1
@@ 9,7 9,7 @@

#include <InputEvent.hpp>
#include <i18n/i18n.hpp>
#include <json/json11.hpp>
#include <json11.hpp>
#include <utility>

namespace style::quotes

M module-apps/application-settings-new/windows/SecurityMainWindow.cpp => module-apps/application-settings-new/windows/SecurityMainWindow.cpp +1 -2
@@ 11,8 11,7 @@

namespace gui
{
    SecurityMainWindow::SecurityMainWindow(app::Application *app, app::settingsInterface::SecuritySettings *settings)
        : BaseSettingsWindow(app, window::name::security), securitySettings(settings)
    SecurityMainWindow::SecurityMainWindow(app::Application *app) : BaseSettingsWindow(app, window::name::security)
    {}

    void SecurityMainWindow::onBeforeShow(ShowMode mode, SwitchData *data)

M module-apps/application-settings-new/windows/SecurityMainWindow.hpp => module-apps/application-settings-new/windows/SecurityMainWindow.hpp +1 -2
@@ 10,13 10,12 @@ namespace gui
    class SecurityMainWindow : public BaseSettingsWindow
    {
      public:
        explicit SecurityMainWindow(app::Application *app, app::settingsInterface::SecuritySettings *settings);
        explicit SecurityMainWindow(app::Application *app);

      private:
        auto buildOptionsList() -> std::list<Option> override;
        void onBeforeShow(ShowMode mode, SwitchData *data) override;

        bool isPhoneLockEnabled;
        app::settingsInterface::SecuritySettings *securitySettings;
    };
} // namespace gui

M module-apps/application-settings-new/windows/SettingsMainWindow.cpp => module-apps/application-settings-new/windows/SettingsMainWindow.cpp +1 -1
@@ 5,7 5,7 @@
#include "application-settings-new/ApplicationSettings.hpp"

#include <i18n/i18n.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <service-appmgr/Controller.hpp>

std::list<gui::Option> mainWindowOptionsNew(app::Application *app)

M module-apps/application-settings/ApplicationSettings.hpp => module-apps/application-settings/ApplicationSettings.hpp +1 -1
@@ 6,7 6,7 @@

#include "Application.hpp"
#include "bsp/common.hpp"
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>

namespace app
{

M module-apps/application-settings/CMakeLists.txt => module-apps/application-settings/CMakeLists.txt +2 -0
@@ 45,4 45,6 @@ target_link_libraries(${PROJECT_NAME}
        service-bluetooth
        service-evtmgr
        service-fota
    PUBLIC
        eventstore
)

M module-apps/application-settings/windows/DateTimeWindow.cpp => module-apps/application-settings/windows/DateTimeWindow.cpp +1 -1
@@ 26,7 26,7 @@
#include <Style.hpp>
#include <widgets/BoxLayout.hpp>

#include <module-utils/time/DateAndTimeSettings.hpp>
#include <time/DateAndTimeSettings.hpp>
#include <module-utils/Utils.hpp>
#include <module-services/service-db/agents/settings/SystemSettings.hpp>


M module-apps/application-settings/windows/Info.cpp => module-apps/application-settings/windows/Info.cpp +1 -1
@@ 7,7 7,7 @@
#include <service-cellular/CellularServiceAPI.hpp>

#include <source/version.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <gui/widgets/BoxLayout.hpp>
#include <gui/widgets/Label.hpp>

M module-apps/application-settings/windows/SettingsMainWindow.cpp => module-apps/application-settings/windows/SettingsMainWindow.cpp +1 -1
@@ 5,7 5,7 @@
#include "../ApplicationSettings.hpp"
#include "Info.hpp"
#include <i18n/i18n.hpp>
#include "log/log.hpp"
#include <log.hpp>
#include "CellularPassthroughWindow.hpp"
#include "FotaWindow.hpp"
#include "EinkModeWindow.hpp"

M module-apps/application-settings/windows/UITestWindow.cpp => module-apps/application-settings/windows/UITestWindow.cpp +1 -1
@@ 6,7 6,7 @@
#include "Label.hpp"
#include "Margins.hpp"
#include <i18n/i18n.hpp>
#include "log/log.hpp"
#include <log.hpp>
#include "messages/AppMessage.hpp"
#include <service-appmgr/model/ApplicationManager.hpp>
#include <GridLayout.hpp>

M module-apps/locks/handlers/LockPolicyHandler.cpp => module-apps/locks/handlers/LockPolicyHandler.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "LockPolicyHandler.hpp"
#include <log/log.hpp>
#include <log.hpp>
#include <Application.hpp>
#include <gsl/assert>


M module-apps/locks/handlers/SimLockHandler.cpp => module-apps/locks/handlers/SimLockHandler.cpp +1 -1
@@ 8,7 8,7 @@
#include <memory>

#include <module-apps/popups/data/PopupRequestParams.hpp>
#include <module-utils/common_data/EventStore.hpp>
#include <EventStore.hpp>
#include <module-sys/Timers/TimerFactory.hpp>
#include <service-cellular-api>


M module-apps/locks/widgets/Lock.cpp => module-apps/locks/widgets/Lock.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Lock.hpp"
#include <module-utils/log/log.hpp>
#include <log.hpp>

namespace locks
{

M module-apps/popups/PowerOffWindow.cpp => module-apps/popups/PowerOffWindow.cpp +1 -1
@@ 3,7 3,7 @@

#include "PowerOffWindow.hpp"

#include <log/log.hpp>
#include <log.hpp>
#include <messages/DialogMetadataMessage.hpp>

namespace gui

M module-apps/widgets/DateOrTimeListItem.hpp => module-apps/widgets/DateOrTimeListItem.hpp +1 -1
@@ 3,7 3,7 @@

#pragma once

#include <module-utils/time/FromTillDate.hpp>
#include <time/FromTillDate.hpp>
#include <module-gui/gui/widgets/ListItem.hpp>

namespace gui

M module-apps/widgets/TimeWidget.hpp => module-apps/widgets/TimeWidget.hpp +1 -1
@@ 7,7 7,7 @@
#include <Text.hpp>
#include <BoxLayout.hpp>
#include "widgets/DateWidget.hpp"
#include <module-utils/time/FromTillDate.hpp>
#include <time/FromTillDate.hpp>

namespace gui
{

M module-apps/windows/NoEvents.cpp => module-apps/windows/NoEvents.cpp +1 -1
@@ 4,7 4,7 @@
#include "NoEvents.hpp"
#include "Dialog.hpp"
#include "DialogMetadataMessage.hpp"
#include "log/log.hpp"
#include <log.hpp>

#include <service-appmgr/Controller.hpp>
#include <Image.hpp>

M module-apps/windows/OptionWindow.cpp => module-apps/windows/OptionWindow.cpp +1 -1
@@ 4,7 4,7 @@
#include "OptionWindow.hpp"
#include "Label.hpp"
#include <i18n/i18n.hpp>
#include "log/log.hpp"
#include <log.hpp>
#include <service-appmgr/model/ApplicationManager.hpp>
#include <Style.hpp>
#include <memory>

M module-audio/Audio/Audio.cpp => module-audio/Audio/Audio.cpp +1 -1
@@ 4,7 4,7 @@
#include "Audio.hpp"
#include "Operation/Operation.hpp"

#include <log/log.hpp>
#include <log.hpp>
#include <bsp/headset/headset.hpp>

namespace audio

M module-audio/Audio/Operation/PlaybackOperation.cpp => module-audio/Audio/Operation/PlaybackOperation.cpp +1 -1
@@ 9,7 9,7 @@

#include "Audio/AudioCommon.hpp"

#include <log/log.hpp>
#include <log.hpp>

namespace audio
{

M module-audio/Audio/Operation/RecorderOperation.cpp => module-audio/Audio/Operation/RecorderOperation.cpp +1 -1
@@ 10,7 10,7 @@
#include "Audio/Profiles/ProfileRecordingOnBoardMic.hpp"
#include "Audio/AudioCommon.hpp"

#include "log/log.hpp"
#include <log.hpp>
#include "FreeRTOS.h"
#include "task.h"


M module-audio/Audio/Operation/RouterOperation.cpp => module-audio/Audio/Operation/RouterOperation.cpp +1 -1
@@ 9,7 9,7 @@
#include <Audio/StreamFactory.hpp>
#include <Audio/transcode/TransformFactory.hpp>

#include <log/log.hpp>
#include <log.hpp>
#include <mutex.hpp>

#include <algorithm>

M module-audio/Audio/decoder/Decoder.hpp => module-audio/Audio/decoder/Decoder.hpp +1 -1
@@ 8,7 8,7 @@
#include "Audio/Stream.hpp"
#include "DecoderWorker.hpp"

#include <log/log.hpp>
#include <log.hpp>

#include <memory>
#include <optional>

M module-audio/Audio/encoder/EncoderWAV.cpp => module-audio/Audio/encoder/EncoderWAV.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "EncoderWAV.hpp"
#include "log/log.hpp"
#include <log.hpp>

namespace audio
{

M module-audio/Audio/test/CMakeLists.txt => module-audio/Audio/test/CMakeLists.txt +0 -1
@@ 1,4 1,3 @@
cmake_minimum_required(VERSION 3.12)

# audio tests
add_catch2_executable(

M module-audio/CMakeLists.txt => module-audio/CMakeLists.txt +0 -2
@@ 1,8 1,6 @@
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

cmake_minimum_required(VERSION 3.12)

project(module-audio VERSION 1.0
        DESCRIPTION "Audio module library")


M module-audio/board/rt1051/RT1051AudioCodec.cpp => module-audio/board/rt1051/RT1051AudioCodec.cpp +1 -1
@@ 4,7 4,7 @@
#include "RT1051AudioCodec.hpp"
#include "board.h"
#include "dma_config.h"
#include "log/log.hpp"
#include <log.hpp>

#include "bsp/BoardDefinitions.hpp"
#include "board/rt1051/common/audio.hpp"

M module-audio/board/rt1051/RT1051CellularAudio.cpp => module-audio/board/rt1051/RT1051CellularAudio.cpp +1 -1
@@ 4,7 4,7 @@
#include "RT1051CellularAudio.hpp"
#include "board.h"
#include "dma_config.h"
#include "log/log.hpp"
#include <log.hpp>

#include "bsp/BoardDefinitions.hpp"


M module-bluetooth/Bluetooth/BluetoothWorker.cpp => module-bluetooth/Bluetooth/BluetoothWorker.cpp +1 -1
@@ 4,7 4,7 @@
#include <service-bluetooth/ServiceBluetooth.hpp>
#include "BluetoothWorker.hpp"
#include "BtCommand.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "interface/BluetoothDriverImpl.hpp"
#include "interface/profiles/A2DP/A2DP.hpp"
#include "interface/profiles/HSP/HSP.hpp"

M module-bluetooth/Bluetooth/BtKeysStorage.cpp => module-bluetooth/Bluetooth/BtKeysStorage.cpp +1 -1
@@ 3,7 3,7 @@

#include <algorithm>
#include "BtKeysStorage.hpp"
#include <log/log.hpp>
#include <log.hpp>

json11::Json bluetooth::KeyStorage::keysJson = json11::Json();
btstack_link_key_db_t bluetooth::KeyStorage::keyStorage;

M module-bluetooth/Bluetooth/BtKeysStorage.hpp => module-bluetooth/Bluetooth/BtKeysStorage.hpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 6,7 6,7 @@
#include <btstack_link_key_db_memory.h>
#include <btstack_util.h>

#include <json/json11.hpp>
#include <json11.hpp>
#include <service-bluetooth/SettingsHolder.hpp>

namespace bluetooth

M module-bluetooth/Bluetooth/WorkerController.cpp => module-bluetooth/Bluetooth/WorkerController.cpp +1 -1
@@ 6,7 6,7 @@
#include "Device.hpp"
#include "interface/profiles/ProfileManager.hpp"

#include <module-utils/log/log.hpp>
#include <log.hpp>
#define BOOST_SML_CFG_DISABLE_MIN_SIZE // GCC10 fix
#include <boost/sml.hpp>
#include <magic_enum.hpp>

M module-bluetooth/Bluetooth/glucode/BluetoothRunLoop.hpp => module-bluetooth/Bluetooth/glucode/BluetoothRunLoop.hpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include <log/log.hpp>
#include <log.hpp>
#include "queue.hpp"
#include <btstack_run_loop.h>
#include <timer.hpp>

M module-bluetooth/Bluetooth/glucode/btstack_uart_block_rt1051.cpp => module-bluetooth/Bluetooth/glucode/btstack_uart_block_rt1051.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <bsp/bluetooth/Bluetooth.hpp>
#include <log/log.hpp>
#include <log.hpp>

using namespace bsp;


M module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DP.cpp => module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DP.cpp +1 -2
@@ 11,12 11,11 @@
#include "AVRCP.hpp"
#include <Bluetooth/Device.hpp>
#include <Bluetooth/Error.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <service-bluetooth/BluetoothMessage.hpp>
#include <Audio/AudioCommon.hpp>
#include <service-audio/AudioMessage.hpp>
#include <service-evtmgr/Constants.hpp>
#include <log/log.hpp>
#include "service-bluetooth/messages/Connect.hpp"
#include "service-bluetooth/messages/Disconnect.hpp"
#include "service-bluetooth/Constants.hpp"

M module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DPImpl.hpp => module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DPImpl.hpp +1 -1
@@ 6,7 6,7 @@
#include <Bluetooth/Device.hpp>
#include <Bluetooth/Error.hpp>
#include <BtCommand.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <Audio/AudioCommon.hpp>
#include <audio/BluetoothAudioDevice.hpp>


M module-bluetooth/Bluetooth/interface/profiles/GAP/GAP.cpp => module-bluetooth/Bluetooth/interface/profiles/GAP/GAP.cpp +1 -1
@@ 3,7 3,7 @@

#include "GAP.hpp"

#include <log/log.hpp>
#include <log.hpp>
#include <service-bluetooth/BluetoothMessage.hpp>
#include <service-bluetooth/messages/ResponseVisibleDevices.hpp>
#include <service-bluetooth/messages/Unpair.hpp>

M module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp => module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp +1 -1
@@ 5,7 5,7 @@
#include "HSP.hpp"

#include <Bluetooth/Error.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <service-evtmgr/Constants.hpp>
#include <service-audio/AudioMessage.hpp>
#include <service-cellular/service-cellular/CellularServiceAPI.hpp>

M module-bluetooth/Bluetooth/interface/profiles/PAN.cpp => module-bluetooth/Bluetooth/interface/profiles/PAN.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <log/log.hpp>
#include <log.hpp>

extern "C"
{

M module-bluetooth/CMakeLists.txt => module-bluetooth/CMakeLists.txt +1 -0
@@ 78,6 78,7 @@ target_link_libraries(${PROJECT_NAME}
    service-bluetooth
    service-evtmgr
    sml::sml
    json::json
)

if (${ENABLE_TESTS})

M module-bsp/CMakeLists.txt => module-bsp/CMakeLists.txt +7 -5
@@ 1,8 1,6 @@
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

cmake_minimum_required(VERSION 3.12)

project(module-bsp VERSION 1.0
        DESCRIPTION "VFS module library")



@@ 89,9 87,13 @@ target_include_directories(${PROJECT_NAME}
set_source_files_properties(${BOARD_SOURCE_FILES_PROPERTIES})

target_link_libraries(${PROJECT_NAME}
    module-os
    service-bluetooth
    ${TARGET_LIBRARIES}
    PUBLIC
        eventstore
        module-os
        service-bluetooth
        ${TARGET_LIBRARIES}
    PRIVATE
        time
)

if (${ENABLE_TESTS})

M module-bsp/board/linux/audio/LinuxCellularAudio.cpp => module-bsp/board/linux/audio/LinuxCellularAudio.cpp +1 -1
@@ 5,7 5,7 @@

#include "linux_audiocodec.hpp"

#include "log/log.hpp"
#include <log.hpp>

namespace bsp
{

M module-bsp/board/linux/audio/linux_audiocodec.cpp => module-bsp/board/linux/audio/linux_audiocodec.cpp +1 -1
@@ 3,7 3,7 @@

#include "linux_audiocodec.hpp"

#include "log/log.hpp"
#include <log.hpp>

namespace bsp
{

M module-bsp/board/linux/battery-charger/battery_charger.cpp => module-bsp/board/linux/battery-charger/battery_charger.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <sys/stat.h>
#include <fcntl.h>
#include <module-utils/common_data/EventStore.hpp>
#include <EventStore.hpp>

#include "board.h"
#include "bsp/battery-charger/battery_charger.hpp"

M module-bsp/board/linux/bluetooth/Bluetooth.cpp => module-bsp/board/linux/bluetooth/Bluetooth.cpp +1 -1
@@ 3,7 3,7 @@

#include "bsp/bluetooth/Bluetooth.hpp"
#include "BluetoothWorker.hpp"
#include "log/log.hpp"
#include <log.hpp>

/// stubs


M module-bsp/board/linux/cellular/linux_cellular.cpp => module-bsp/board/linux/cellular/linux_cellular.cpp +2 -2
@@ 7,9 7,9 @@
#include <iostream>
#include <algorithm>

#include "log/log.hpp"
#include <log.hpp>
#include "mutex.hpp"
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>
#include <errno.h>
#include <fcntl.h>
#include <map>

M module-bsp/board/linux/vibrator/vibrator.cpp => module-bsp/board/linux/vibrator/vibrator.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "bsp/vibrator/vibrator.hpp"
#include <module-utils/log/log.hpp>
#include <log.hpp>

namespace bsp
{

M module-bsp/board/linux/watchdog/software_watchdog.cpp => module-bsp/board/linux/watchdog/software_watchdog.cpp +1 -1
@@ 5,7 5,7 @@
#include <module-os/RTOSWrapper/include/critical.hpp>
#include <module-os/RTOSWrapper/include/ticks.hpp>
#include <module-sys/Service/Common.hpp>
#include <module-utils/log/log.hpp>
#include <log.hpp>
#include <cstdlib>

namespace bsp::watchdog

M module-bsp/board/rt1051/bluetooth/BlueKitchen.cpp => module-bsp/board/rt1051/bluetooth/BlueKitchen.cpp +1 -1
@@ 3,7 3,7 @@

#include "bsp/bluetooth/Bluetooth.hpp"
#include "BluetoothWorker.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "FreeRTOS.h"
#include "fsl_lpuart.h"
#include "board.h"

M module-bsp/board/rt1051/bluetooth/BluetoothCommon.cpp => module-bsp/board/rt1051/bluetooth/BluetoothCommon.cpp +1 -1
@@ 3,7 3,7 @@

#include "BluetoothWorker.hpp"
#include "bsp/bluetooth/Bluetooth.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "FreeRTOS.h"
#include "board.h"
#include "fsl_lpuart_edma.h"

M module-bsp/board/rt1051/bluetooth/Bluetopia.cpp => module-bsp/board/rt1051/bluetooth/Bluetopia.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "bluetooth/Bluetooth.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "fsl_lpuart.h"
#include "board.h"


M module-bsp/board/rt1051/bsp/battery-charger/battery_charger.cpp => module-bsp/board/rt1051/bsp/battery-charger/battery_charger.cpp +1 -1
@@ 6,7 6,7 @@
#include "fsl_common.h"

#include "bsp/BoardDefinitions.hpp"
#include "common_data/EventStore.hpp"
#include <EventStore.hpp>
#include "drivers/gpio/DriverGPIO.hpp"
#include "drivers/i2c/DriverI2C.hpp"
#include <purefs/filesystem_paths.hpp>

M module-bsp/board/rt1051/bsp/cellular/rt1051_cellular.cpp => module-bsp/board/rt1051/bsp/cellular/rt1051_cellular.cpp +1 -1
@@ 4,7 4,7 @@
#include "rt1051_cellular.hpp"
#include "fsl_cache.h"

#include <common_data/EventStore.hpp>
#include <EventStore.hpp>
#include <task.h>
#include <ticks.hpp>


M module-bsp/board/rt1051/bsp/eeprom/eeprom.cpp => module-bsp/board/rt1051/bsp/eeprom/eeprom.cpp +1 -1
@@ 7,7 7,7 @@
#include "drivers/i2c/DriverI2C.hpp"

#include "fsl_common.h"
#include "log/log.hpp"
#include <log.hpp>

#include "task.h"


M module-bsp/board/rt1051/bsp/light_sensor/light_sensor.cpp => module-bsp/board/rt1051/bsp/light_sensor/light_sensor.cpp +1 -1
@@ 8,7 8,7 @@
#include "drivers/gpio/DriverGPIO.hpp"

#include "fsl_common.h"
#include "log/log.hpp"
#include <log.hpp>

namespace bsp::light_sensor
{

M module-bsp/board/rt1051/bsp/lpm/CpuFreqLPM.cpp => module-bsp/board/rt1051/bsp/lpm/CpuFreqLPM.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "CpuFreqLPM.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "fsl_dcdc.h"

namespace bsp

M module-bsp/board/rt1051/bsp/lpm/RT1051LPM.cpp => module-bsp/board/rt1051/bsp/lpm/RT1051LPM.cpp +1 -1
@@ 4,7 4,7 @@
#include "RT1051LPM.hpp"

#include "board.h"
#include "log/log.hpp"
#include <log.hpp>
#include "bsp/BoardDefinitions.hpp"
#include "bsp/watchdog/watchdog.hpp"
#include <clock_config.h>

M module-bsp/board/rt1051/bsp/rtc/rtc.cpp => module-bsp/board/rt1051/bsp/rtc/rtc.cpp +1 -1
@@ 5,7 5,7 @@
#include <fsl_snvs_hp.h>
#include <fsl_snvs_lp.h>
#include <module-os/RTOSWrapper/include/ticks.hpp>
#include <module-utils/time/time_conversion.hpp>
#include <time/time_conversion.hpp>
#include <time.h>

namespace

M module-bsp/board/rt1051/common/chip.cpp => module-bsp/board/rt1051/common/chip.cpp +1 -1
@@ 3,7 3,7 @@

#include "chip.hpp"

#include <log/log.hpp>
#include <log.hpp>

#include <map>
#include <string>

M module-bsp/board/rt1051/common/clock_config.cpp => module-bsp/board/rt1051/common/clock_config.cpp +1 -1
@@ 54,7 54,7 @@
#include "fsl_iomuxc.h"
#include "fsl_dcdc.h"
#include "fsl_gpc.h"
#include "log/log.hpp"
#include <log.hpp>

/*******************************************************************************
 * Definitions

M module-bsp/board/rt1051/common/startup_mimxrt1052.cpp => module-bsp/board/rt1051/common/startup_mimxrt1052.cpp +1 -1
@@ 453,7 453,7 @@ extern "C"

#include "MIMXRT1051.h"
#include "macros.h"
#include <log/log.hpp>
#include <log.hpp>
#include <cinttypes>
#include <cstdlib>
#include <cstdint>

M module-bsp/board/rt1051/drivers/RT1051DriverDMA.cpp => module-bsp/board/rt1051/drivers/RT1051DriverDMA.cpp +1 -1
@@ 3,7 3,7 @@

#include "RT1051DriverDMA.hpp"
#include <algorithm>
#include "log/log.hpp"
#include <log.hpp>

namespace drivers
{

M module-bsp/board/rt1051/drivers/RT1051DriverGPIO.cpp => module-bsp/board/rt1051/drivers/RT1051DriverGPIO.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "RT1051DriverGPIO.hpp"
#include "log/log.hpp"
#include <log.hpp>

namespace drivers
{

M module-bsp/board/rt1051/drivers/RT1051DriverI2C.cpp => module-bsp/board/rt1051/drivers/RT1051DriverI2C.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "RT1051DriverI2C.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "../board.h"

namespace drivers

M module-bsp/board/rt1051/drivers/RT1051DriverPLL.cpp => module-bsp/board/rt1051/drivers/RT1051DriverPLL.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "RT1051DriverPLL.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "../common/clock_config.h"

namespace drivers

M module-bsp/board/rt1051/drivers/RT1051DriverPWM.cpp => module-bsp/board/rt1051/drivers/RT1051DriverPWM.cpp +1 -1
@@ 3,7 3,7 @@

#include "RT1051DriverPWM.hpp"
#include "RT1051DriverPWMhelper.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "../board.h"
#include <algorithm>


M module-bsp/bsp/cellular/bsp_cellular.hpp => module-bsp/bsp/cellular/bsp_cellular.hpp +1 -1
@@ 9,7 9,7 @@
#include <FreeRTOS.h>
#include <FreeRTOS/include/queue.h>
#include "drivers/lpuart/DriverLPUART.hpp"
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>

namespace bsp
{

M module-bsp/bsp/usb/usb.hpp => module-bsp/bsp/usb/usb.hpp +1 -1
@@ 12,7 12,7 @@ extern "C"

#include <errno.h>
#include <iostream>
#include <log/log.hpp>
#include <log.hpp>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

M module-cellular/CMakeLists.txt => module-cellular/CMakeLists.txt +11 -19
@@ 1,6 1,4 @@
cmake_minimum_required(VERSION 3.12)

project(module-cellular VERSION 1.0
project(module-cellular VERSION 1.0
        DESCRIPTION "Cellular module library")

include(SerialPort)


@@ 60,16 58,8 @@ target_compile_options(${PROJECT_NAME} PUBLIC ${TARGET_COMPILE_OPTIONS})
target_link_options(${PROJECT_NAME} PUBLIC ${TARGET_LINK_OPTIONS})


target_compile_definitions(${PROJECT_NAME}

        PUBLIC

)

target_include_directories(${PROJECT_NAME}

        PUBLIC

    PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}
        ${CMAKE_CURRENT_SOURCE_DIR}/at/
        ${CMAKE_SOURCE_DIR}/module-services


@@ 78,16 68,18 @@ target_include_directories(${PROJECT_NAME}

target_link_libraries(${PROJECT_NAME}
    PUBLIC
    date::date
    eventstore
    module-bsp
    module-db
    module-services
    module-sys
    module-utils
    module-vfs
    service-cellular
    service-eink
    service-fota
    module-utils
    module-vfs
    module-services
    module-sys
    module-db
    module-bsp
    date::date
    time
    PRIVATE
    Microsoft.GSL::GSL
)

M module-cellular/at/UrcCreg.hpp => module-cellular/at/UrcCreg.hpp +2 -2
@@ 1,11 1,11 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "Urc.hpp"

#include <common_data/EventStore.hpp>
#include <EventStore.hpp>

namespace at::urc
{

M module-cellular/at/cmd/src/CFUN.cpp => module-cellular/at/cmd/src/CFUN.cpp +1 -1
@@ 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 <log/log.hpp>
#include <log.hpp>
#include <memory>
#include <string>
#include <type_traits>

M module-cellular/at/cmd/src/CSCA.cpp => module-cellular/at/cmd/src/CSCA.cpp +1 -1
@@ 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 <log/log.hpp>
#include <log.hpp>
#include <memory>
#include <string>
#include <type_traits>

M module-cellular/at/cmd/src/QECCNUM.cpp => module-cellular/at/cmd/src/QECCNUM.cpp +1 -1
@@ 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 <log/log.hpp>
#include <log.hpp>
#include <memory>
#include <string>
#include <type_traits>

M module-cellular/at/response.hpp => module-cellular/at/response.hpp +1 -1
@@ 4,7 4,7 @@
#pragma once

#include "Result.hpp"
#include <log/log.hpp>
#include <log.hpp>
#include <map>
#include <memory>
#include <string>

M module-cellular/at/src/UrcCtze.cpp => module-cellular/at/src/UrcCtze.cpp +1 -1
@@ 3,7 3,7 @@

#include "../UrcCtze.hpp"
#include <log/debug.hpp>
#include <module-utils/time/time_conversion.hpp>
#include <time/time_conversion.hpp>

#include <date/date.h>


M module-cellular/modem/ATCommon.cpp => module-cellular/modem/ATCommon.cpp +1 -1
@@ 5,7 5,7 @@
#include <at/Cmd.hpp>
#include "time/ScopedTime.hpp"
#include <functional>
#include <log/log.hpp>
#include <log.hpp>
#include <string>
#include <Utils.hpp>
#include "ATStream.hpp"

M module-cellular/modem/mux/CellularMuxFrame.h => module-cellular/modem/mux/CellularMuxFrame.h +1 -1
@@ 7,7 7,7 @@
#include <inttypes.h>
#include <vector>
#include <iostream>
#include "log/log.hpp"
#include <log.hpp>

#define TS0710_FLAG          0xF9
#define TS0710_FRAME_HDR_LEN 6 // without extended address byte

M module-cellular/modem/mux/DLCChannel.cpp => module-cellular/modem/mux/DLCChannel.cpp +1 -1
@@ 6,7 6,7 @@
#include "CellularMuxData.h"
#include "CellularMuxFrame.h"

#include <module-utils/log/log.hpp>
#include <log.hpp>
#include <ticks.hpp>
#include <Utils.hpp>
#include <magic_enum.hpp>

M module-cellular/test/CMakeLists.txt => module-cellular/test/CMakeLists.txt +0 -2
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

# Phone number tests
add_catch2_executable(
    NAME

M module-db/CMakeLists.txt => module-db/CMakeLists.txt +5 -7
@@ 1,6 1,4 @@
cmake_minimum_required(VERSION 3.12)

project(module-db VERSION 1.0
project(module-db VERSION 1.0
        DESCRIPTION "Database module library")

module_is_test_entity()


@@ 178,11 176,11 @@ target_compile_options(${PROJECT_NAME}

target_link_libraries(${PROJECT_NAME}
    PUBLIC
    module-utils
    module-vfs

        module-utils
        module-vfs
        utf8
    PRIVATE
    Microsoft.GSL::GSL
        Microsoft.GSL::GSL
)

# Host target configuration(mainly used for unit testing)

M module-db/Common/Query.hpp => module-db/Common/Query.hpp +1 -1
@@ 6,7 6,7 @@
#include <memory>
#include <string>
#include <functional>
#include <log/log.hpp>
#include <log.hpp>
#include <module-services/service-desktop/endpoints/Context.hpp>

namespace db

M module-db/Database/Database.cpp => module-db/Database/Database.cpp +1 -1
@@ 4,7 4,7 @@
#include "Database.hpp"
#include "DatabaseInitializer.hpp"

#include "log/log.hpp"
#include <log.hpp>

#include <purefs/filesystem_paths.hpp>
#include <gsl/util>

M module-db/Database/DatabaseInitializer.cpp => module-db/Database/DatabaseInitializer.cpp +1 -1
@@ 9,7 9,7 @@
#include <set>
#include <string>
#include <sstream>
#include <log/log.hpp>
#include <log.hpp>

DatabaseInitializer::DatabaseInitializer(Database *db) : db(db)
{}

M module-db/Database/Field.cpp => module-db/Database/Field.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Field.hpp"
#include <log/log.hpp>
#include <log.hpp>
#include <functional>

const char *Field::getCString() const

M module-db/Interface/AlarmsRecord.hpp => module-db/Interface/AlarmsRecord.hpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 6,8 6,8 @@
#include "Record.hpp"
#include "module-db/Databases/AlarmsDB.hpp"
#include "module-db/Common/Common.hpp"
#include <module-utils/utf8/UTF8.hpp>
#include <module-apps/application-calendar/data/dateCommon.hpp>
#include <utf8/UTF8.hpp>
#include <stdint.h>

namespace db::query::alarms

M module-db/Interface/CalllogRecord.cpp => module-db/Interface/CalllogRecord.cpp +1 -1
@@ 4,7 4,7 @@
#include "CalllogRecord.hpp"

#include <ContactRecord.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <Tables/CalllogTable.hpp>
#include <PhoneNumber.hpp>
#include <Utils.hpp>

M module-db/Interface/EventsRecord.cpp => module-db/Interface/EventsRecord.cpp +1 -1
@@ 13,7 13,7 @@
#include <module-db/queries/calendar/QueryEventsGetFilteredByDay.hpp>
#include <module-db/queries/calendar/QueryEventsGetAllLimited.hpp>
#include <module-db/queries/calendar/QueryEventsSelectFirstUpcoming.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <Utils.hpp>
#include <cassert>
#include <vector>

M module-db/Interface/NotificationsRecord.cpp => module-db/Interface/NotificationsRecord.cpp +1 -1
@@ 9,7 9,7 @@
#include "module-db/queries/notifications/QueryNotificationsGetAll.hpp"
#include "Databases/NotificationsDB.hpp"

#include <log/log.hpp>
#include <log.hpp>
#include <Utils.hpp>

#include <cassert>

M module-db/Interface/Record.cpp => module-db/Interface/Record.cpp +1 -1
@@ 3,7 3,7 @@

#include "Record.hpp"
#include <Common/Query.hpp>
#include <log/log.hpp>
#include <log.hpp>

namespace db
{

M module-db/Interface/SMSRecord.cpp => module-db/Interface/SMSRecord.cpp +1 -1
@@ 19,7 19,7 @@
#include "queries/messages/sms/QuerySMSGetLastByThreadID.hpp"
#include <queries/messages/sms/QuerySMSGetForList.hpp>

#include <log/log.hpp>
#include <log.hpp>

#include <PhoneNumber.hpp>
#include <optional>

M module-db/Interface/SMSTemplateRecord.cpp => module-db/Interface/SMSTemplateRecord.cpp +1 -1
@@ 10,7 10,7 @@
#include "queries/messages/templates/QuerySMSTemplateUpdate.hpp"
#include <queries/messages/templates/QuerySMSTemplateGetForList.hpp>

#include <log/log.hpp>
#include <log.hpp>

#include <cassert>


M module-db/Interface/ThreadRecord.cpp => module-db/Interface/ThreadRecord.cpp +1 -1
@@ 15,7 15,7 @@
#include <queries/messages/threads/QueryThreadsGetCount.hpp>

#include <cassert>
#include <log/log.hpp>
#include <log.hpp>

ThreadRecordInterface::ThreadRecordInterface(SmsDB *smsDb, ContactsDB *contactsDb)
    : smsDB(smsDb), contactsDB(contactsDb)

M module-db/Tables/AlarmsTable.hpp => module-db/Tables/AlarmsTable.hpp +5 -5
@@ 1,14 1,14 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "Table.hpp"
#include "Record.hpp"
#include "Database/Database.hpp"
#include "Common/Common.hpp"
#include <module-utils/utf8/UTF8.hpp>
#include "Database/Database.hpp"
#include "Record.hpp"
#include "Table.hpp"
#include <module-apps/application-calendar/data/dateCommon.hpp>
#include <utf8/UTF8.hpp>

struct AlarmsRecord;


M module-db/Tables/CalllogTable.cpp => module-db/Tables/CalllogTable.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "CalllogTable.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <Utils.hpp>

CalllogTable::CalllogTable(Database *db) : Table(db)

M module-db/Tables/ContactsTable.cpp => module-db/Tables/ContactsTable.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ContactsTable.hpp"
#include <log/log.hpp>
#include <log.hpp>
#include <Utils.hpp>

namespace ColumnName

M module-db/Tables/EventsTable.cpp => module-db/Tables/EventsTable.cpp +1 -1
@@ 6,7 6,7 @@
//#include <module-apps/application-calendar/widgets/CalendarStyle.hpp>
//#include <module-apps/application-calendar/data/OptionParser.hpp>

#include <log/log.hpp>
#include <log.hpp>
#include <Utils.hpp>

#include <cassert>

M module-db/Tables/NotesTable.cpp => module-db/Tables/NotesTable.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "NotesTable.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <string>

NotesTable::NotesTable(Database *db) : Table(db)

M module-db/Tables/NotificationsTable.cpp => module-db/Tables/NotificationsTable.cpp +1 -1
@@ 4,7 4,7 @@
#include "NotificationsTable.hpp"
#include "Database/Database.hpp"

#include <log/log.hpp>
#include <log.hpp>
#include <Utils.hpp>
#include <cassert>


M module-db/Tables/Record.hpp => module-db/Tables/Record.hpp +1 -1
@@ 3,7 3,7 @@

#pragma once

#include <log/log.hpp>
#include <log.hpp>
#include <cstdint>

constexpr uint32_t DB_ID_NONE = 0;

M module-db/Tables/SMSTable.cpp => module-db/Tables/SMSTable.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "SMSTable.hpp"
#include <log/log.hpp>
#include <log.hpp>

SMSTable::SMSTable(Database *db) : Table(db)
{}

M module-db/Tables/SMSTemplateTable.cpp => module-db/Tables/SMSTemplateTable.cpp +1 -1
@@ 4,7 4,7 @@
#include "SMSTemplateTable.hpp"

#include <Utils.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <cassert>


M module-db/Tables/ThreadsTable.cpp => module-db/Tables/ThreadsTable.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ThreadsTable.hpp"
#include "log/log.hpp"
#include <log.hpp>

ThreadsTable::ThreadsTable(Database *db) : Table(db)
{}

M module-db/tests/CMakeLists.txt => module-db/tests/CMakeLists.txt +1 -0
@@ 38,6 38,7 @@ add_catch2_executable(
        module-sys
        iosyscalls
        module-db
        json::json
    DEPS
        assets
        PurePhone-disk-img

M module-db/tests/DbInitializer.cpp => module-db/tests/DbInitializer.cpp +1 -1
@@ 8,7 8,7 @@
#include <memory>
#include <set>
#include <string>
#include <log/log.hpp>
#include <log.hpp>

DatabaseInitializer::DatabaseInitializer(Database *db) : db(db)
{}

M module-db/tests/QueryInterface.cpp => module-db/tests/QueryInterface.cpp +1 -1
@@ 17,7 17,7 @@
#include <filesystem>
#include <memory>
#include <module-db/queries/messages/sms/QuerySMSGetCount.hpp>
#include <module-utils/json/json11.hpp>
#include <json11.hpp>

namespace db
{

M module-gui/CMakeLists.txt => module-gui/CMakeLists.txt +5 -3
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

project(module-gui VERSION 1.0
        DESCRIPTION "GUI library dedicated for pure phone.")



@@ 22,12 20,16 @@ include(gui/dom/CMakeLists.txt)
include_directories( ../module-utils )

target_link_libraries(${PROJECT_NAME} 
    PUBLIC 
    PUBLIC
        module-utils 
        utf8
        eventstore
        ${TARGET_LIBRARIES} 
        time
    PRIVATE
        pugixml::pugixml
        Microsoft.GSL::GSL
        json::json
)

# Board specific compilation definitions,options,include directories and features

M module-gui/gui/core/DrawCommand.cpp => module-gui/gui/core/DrawCommand.cpp +1 -1
@@ 18,7 18,7 @@
#include "FontManager.hpp"
#include "RawFont.hpp"
// utils
#include "log/log.hpp"
#include <log.hpp>
// module-utils
#include <cmath>
#include <cassert>

M module-gui/gui/core/Font.cpp => module-gui/gui/core/Font.cpp +1 -1
@@ 4,7 4,7 @@
#include "Font.hpp"
#include "FontManager.hpp" // for FontManager
#include "RawFont.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <algorithm>
#include <sstream>


M module-gui/gui/core/FontManager.cpp => module-gui/gui/core/FontManager.cpp +1 -1
@@ 5,7 5,7 @@
#include "Common.hpp"   // for Status, Status::GUI_SUCCESS
#include "FontInfo.hpp" // for FontInfo
#include "RawFont.hpp"  // for RawFont
#include "log/log.hpp"  // for LOG_ERROR, LOG_INFO, LOG_WARN
#include <log.hpp>      // for LOG_ERROR, LOG_INFO, LOG_WARN
#include <Utils.hpp>
#include <filesystem>
#include <cstdio>

M module-gui/gui/core/ImageManager.cpp => module-gui/gui/core/ImageManager.cpp +1 -1
@@ 17,7 17,7 @@

#include "ImageManager.hpp"
#include "utf8/UTF8.hpp"
#include "log/log.hpp"
#include <log.hpp>
// module-gui
#include "ImageMap.hpp"
#include "VecMap.hpp"

M module-gui/gui/core/RawFont.cpp => module-gui/gui/core/RawFont.cpp +1 -1
@@ 8,7 8,7 @@
#include "FontKerning.hpp"   // for FontKerning
#include "Renderer.hpp"      // for Renderer
#include "TextConstants.hpp" // for newline
#include "log/log.hpp"       // for LOG_ERROR
#include <log.hpp>           // for LOG_ERROR
#include "utf8/UTF8.hpp"     // for UTF8
#include <cstring>           // for memcpy
#include <utility>           // for pair

M module-gui/gui/dom/Item2JsonSerializer.hpp => module-gui/gui/dom/Item2JsonSerializer.hpp +1 -1
@@ 4,7 4,7 @@
#pragma once

#include "Item2JsonSerializingVisitor.hpp"
#include <module-utils/json/json11.hpp>
#include <json11.hpp>
#include <list>

namespace gui

M module-gui/gui/dom/Item2JsonSerializingVisitor.hpp => module-gui/gui/dom/Item2JsonSerializingVisitor.hpp +1 -1
@@ 4,7 4,7 @@
#pragma once

#include "visitor/GuiVisitor.hpp"
#include <module-utils/json/json11.hpp>
#include <json11.hpp>
#include <list>

namespace gui

M module-gui/gui/input/Profile.cpp => module-gui/gui/input/Profile.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "log/log.hpp"
#include <log.hpp>
#include "utf8/UTF8.hpp"
#include "Profile.hpp"
#include <Utils.hpp>

M module-gui/gui/input/Profile.hpp => module-gui/gui/input/Profile.hpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "InputEvent.hpp"


@@ 6,7 6,7 @@
#include <cstdint>
#include <vector>
#include <map>
#include "json/json11.hpp"
#include <json11.hpp>
#include <filesystem>

namespace gui

M module-gui/gui/input/Translator.cpp => module-gui/gui/input/Translator.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "Translator.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <algorithm>
#include <filesystem>
#include "i18n/i18n.hpp"

M module-gui/gui/widgets/Arc.cpp => module-gui/gui/widgets/Arc.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <module-utils/log/log.hpp>
#include <log.hpp>
#include "Arc.hpp"
#include "DrawCommand.hpp"


M module-gui/gui/widgets/BottomBar.cpp => module-gui/gui/widgets/BottomBar.cpp +1 -1
@@ 12,7 12,7 @@
#include "Margins.hpp"
#include "utf8/UTF8.hpp"
#include <Style.hpp>
#include <log/log.hpp>
#include <log.hpp>

namespace gui
{

M module-gui/gui/widgets/BoxLayout.cpp => module-gui/gui/widgets/BoxLayout.cpp +1 -1
@@ 5,7 5,7 @@
#include "BoxLayoutSizeStore.hpp"
#include <InputEvent.hpp>
#include <Label.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include "assert.h"

namespace gui

M module-gui/gui/widgets/BoxLayout.hpp => module-gui/gui/widgets/BoxLayout.hpp +1 -1
@@ 9,7 9,7 @@
#include "Rect.hpp"
#include <Alignment.hpp>
#include "LayoutSizeStore.hpp"
#include "log/log.hpp"
#include <log.hpp>

namespace gui
{

M module-gui/gui/widgets/Circle.cpp => module-gui/gui/widgets/Circle.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <module-utils/log/log.hpp>
#include <log.hpp>
#include "Circle.hpp"
#include "DrawCommand.hpp"


M module-gui/gui/widgets/GridLayout.cpp => module-gui/gui/widgets/GridLayout.cpp +1 -1
@@ 4,7 4,7 @@
#include "GridLayout.hpp"
#include "InputEvent.hpp"
#include "Style.hpp"
#include <log/log.hpp>
#include <log.hpp>

using namespace gui;


M module-gui/gui/widgets/Image.cpp => module-gui/gui/widgets/Image.cpp +1 -1
@@ 7,7 7,7 @@
#include "ImageManager.hpp"

#include <utf8/UTF8.hpp>
#include <module-utils/log/log.hpp>
#include <log.hpp>

namespace gui
{

M module-gui/gui/widgets/InputMode.cpp => module-gui/gui/widgets/InputMode.cpp +1 -1
@@ 4,7 4,7 @@
#include <InputMode.hpp>
#include <i18n/i18n.hpp>
#include <map>
#include <log/log.hpp>
#include <log.hpp>

/// input mode strings - as these are stored in json (in files...)
const std::map<InputMode::Mode, std::string> input_mode = {

M module-gui/gui/widgets/Label.cpp => module-gui/gui/widgets/Label.cpp +1 -1
@@ 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 "log/log.hpp"
#include <log.hpp>
#include "utf8/UTF8.hpp"

#include "../core/DrawCommand.hpp"

M module-gui/gui/widgets/ListItem.cpp => module-gui/gui/widgets/ListItem.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ListItem.hpp"
#include <log/log.hpp>
#include <log.hpp>
#include <Style.hpp>

namespace gui

M module-gui/gui/widgets/ListView.cpp => module-gui/gui/widgets/ListView.cpp +1 -1
@@ 4,7 4,7 @@
#include "ListView.hpp"
#include "InputEvent.hpp"
#include "cassert"
#include <log/log.hpp>
#include <log.hpp>

namespace gui
{

M module-gui/gui/widgets/ProgressBar.cpp => module-gui/gui/widgets/ProgressBar.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <module-utils/log/log.hpp>
#include <log.hpp>
#include <module-utils/math/Math.hpp>

#include "DrawCommand.hpp"

M module-gui/gui/widgets/Rect.cpp => module-gui/gui/widgets/Rect.cpp +1 -2
@@ 10,11 10,10 @@

#include "../core/BoundingBox.hpp"
#include "../core/DrawCommand.hpp"
#include <log/log.hpp>

#include "Rect.hpp"
#include "Style.hpp"
#include <log/log.hpp>
#include <log.hpp>

namespace gui
{

M module-gui/gui/widgets/RichTextParser.cpp => module-gui/gui/widgets/RichTextParser.cpp +1 -1
@@ 9,7 9,7 @@
#include <sstream>
#include <string>
#include <map>
#include <log/log.hpp>
#include <log.hpp>
#include "TextFormat.hpp"

#include <pugixml.hpp>

M module-gui/gui/widgets/StatusBar.cpp => module-gui/gui/widgets/StatusBar.cpp +1 -1
@@ 16,7 16,7 @@
#include "status-bar/SIM.hpp"
#include "status-bar/Time.hpp"
#include "status-bar/Lock.hpp"
#include "common_data/EventStore.hpp"
#include <EventStore.hpp>

namespace gui::status_bar
{

M module-gui/gui/widgets/Text.cpp => module-gui/gui/widgets/Text.cpp +1 -1
@@ 15,7 15,7 @@
#include "TextDocument.hpp"
#include "TextLine.hpp"
#include "TextParse.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "utf8/UTF8.hpp"
#include <Style.hpp>
#include <cassert>

M module-gui/gui/widgets/TextBlock.cpp => module-gui/gui/widgets/TextBlock.cpp +1 -1
@@ 3,7 3,7 @@

#include "TextBlock.hpp"
#include "TextConstants.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <cassert>
#include <TextFormat.hpp>
#include <RawFont.hpp>

M module-gui/gui/widgets/TextBlockCursor.cpp => module-gui/gui/widgets/TextBlockCursor.cpp +1 -1
@@ 5,7 5,7 @@
#include "TextBlock.hpp"
#include "TextDocument.hpp"
#include "TextParse.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include <cassert>

static const int last_char_inclusive = 0; // if then -1 / else 0

M module-gui/gui/widgets/TextCursor.cpp => module-gui/gui/widgets/TextCursor.cpp +1 -1
@@ 6,7 6,7 @@
#include "Text.hpp"
#include "TextBlockCursor.hpp"
#include "TextDocument.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "TextLine.hpp"
#include <cassert>
#include <RawFont.hpp>

M module-gui/gui/widgets/TextLineCursor.cpp => module-gui/gui/widgets/TextLineCursor.cpp +1 -1
@@ 3,7 3,7 @@

#include "TextLineCursor.hpp"
#include "Text.hpp"
#include "log/log.hpp"
#include <log.hpp>

#define debug_text_cursor(...)
// #define debug_text_cursor(...) LOG_DEBUG(__VA_ARGS__)

M module-gui/gui/widgets/status-bar/BatteryBase.hpp => module-gui/gui/widgets/status-bar/BatteryBase.hpp +1 -1
@@ 5,7 5,7 @@

#include "StatusBarWidgetBase.hpp"
#include "BoxLayout.hpp"
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>

namespace gui::status_bar
{

M module-gui/gui/widgets/status-bar/NetworkAccessTechnology.hpp => module-gui/gui/widgets/status-bar/NetworkAccessTechnology.hpp +1 -1
@@ 5,7 5,7 @@

#include "StatusBarWidgetBase.hpp"
#include <Label.hpp>
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>

namespace gui::status_bar
{

M module-gui/gui/widgets/status-bar/PhoneMode.cpp => module-gui/gui/widgets/status-bar/PhoneMode.cpp +1 -1
@@ 3,7 3,7 @@

#include "PhoneMode.hpp"

#include <log/log.hpp>
#include <log.hpp>
#include <i18n/i18n.hpp>

#include "Item.hpp"

M module-gui/gui/widgets/status-bar/PhoneMode.hpp => module-gui/gui/widgets/status-bar/PhoneMode.hpp +2 -1
@@ 5,7 5,8 @@

#include "StatusBarWidgetBase.hpp"
#include <Label.hpp>
#include <common_data/EventStore.hpp>

#include <EventStore.hpp>
#include <gui/widgets/StatusBar.hpp>

namespace gui::status_bar

M module-gui/gui/widgets/status-bar/SIM.hpp => module-gui/gui/widgets/status-bar/SIM.hpp +1 -1
@@ 5,7 5,7 @@

#include "Image.hpp"
#include "status-bar/StatusBarWidgetBase.hpp"
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>

namespace gui::status_bar
{

M module-gui/gui/widgets/status-bar/SignalStrengthBase.hpp => module-gui/gui/widgets/status-bar/SignalStrengthBase.hpp +1 -1
@@ 5,7 5,7 @@

#include "StatusBarWidgetBase.hpp"
#include "BoxLayout.hpp"
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>

namespace gui::status_bar
{

M module-gui/gui/widgets/status-bar/SignalStrengthText.cpp => module-gui/gui/widgets/status-bar/SignalStrengthText.cpp +1 -1
@@ 3,7 3,7 @@

#include "SignalStrengthText.hpp"
#include "Label.hpp"
#include "common_data/EventStore.hpp"
#include <EventStore.hpp>
#include <Utils.hpp>
#include "Style.hpp"


M module-gui/gui/widgets/status-bar/StatusBarWidgetBase.hpp => module-gui/gui/widgets/status-bar/StatusBarWidgetBase.hpp +1 -1
@@ 3,7 3,7 @@

#pragma once

#include <log/log.hpp>
#include <log.hpp>

namespace gui::status_bar
{

M module-gui/test/mock/TestListViewProvider.cpp => module-gui/test/mock/TestListViewProvider.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "TestListViewProvider.hpp"
#include <log/log.hpp>
#include <log.hpp>

namespace gui
{

M module-gui/test/test-catch/test-context.cpp => module-gui/test/test-catch/test-context.cpp +1 -1
@@ 6,7 6,7 @@

#include <catch2/catch.hpp>
#include <module-gui/gui/core/Context.hpp>
#include <log/log.hpp>
#include <log.hpp>

TEST_CASE("test context size and position")
{

M module-gui/test/test-catch/test-gui.cpp => module-gui/test/test-catch/test-gui.cpp +1 -1
@@ 17,7 17,7 @@
#include <fcntl.h>
#include <catch2/catch.hpp>

#include <log/log.hpp>
#include <log.hpp>
#include <utf8/UTF8.hpp>

#include <module-gui/gui/core/ImageManager.hpp>

M module-gui/test/test-google/test-gui-boxlayout.cpp => module-gui/test/test-google/test-gui-boxlayout.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "gtest/gtest.h"
#include <module-utils/log/log.hpp>
#include <log.hpp>
#include <module-gui/gui/widgets/BoxLayout.hpp>
#include <module-gui/test/mock/TestListViewProvider.hpp>
#include <gui/input/InputEvent.hpp>

M module-gui/test/test-google/test-gui-gridlayout.cpp => module-gui/test/test-google/test-gui-gridlayout.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "gtest/gtest.h"
#include <module-utils/log/log.hpp>
#include <log.hpp>
#include <module-gui/gui/widgets/BoxLayout.hpp>
#include <module-gui/gui/widgets/GridLayout.hpp>
#include <gui/input/InputEvent.hpp>

M module-gui/test/test-google/test-gui-listview.cpp => module-gui/test/test-google/test-gui-listview.cpp +1 -1
@@ 3,7 3,7 @@

#include "gtest/gtest.h"
#include <module-gui/gui/widgets/ListView.hpp>
#include <module-utils/log/log.hpp>
#include <log.hpp>
#include <mock/TestListViewProvider.hpp>
#include <gui/input/InputEvent.hpp>


M module-os/CMakeLists.txt => module-os/CMakeLists.txt +0 -2
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

project(module-os VERSION 1.0
        DESCRIPTION "OS module library")


M module-os/FreeRTOS/application.c => module-os/FreeRTOS/application.c +1 -1
@@ 1,6 1,6 @@
#include "FreeRTOS.h"
#include "task.h"
#include "log/log.hpp"
#include <log.hpp>

#include <assert.h>
#include <stdlib.h>

M module-os/FreeRTOS/include/FreeRTOSConfig.h => module-os/FreeRTOS/include/FreeRTOSConfig.h +1 -1
@@ 39,7 39,7 @@
 *----------------------------------------------------------*/
#include <assert.h>
#include <stdint.h>
#include "log/log.hpp"
#include <log.hpp>

//TODO: Look at tasks.c: void vTaskStepTick( const TickType_t xTicksToJump ) before upgrading FreeRTOS
#ifdef __cplusplus

M module-os/systemviewPatch/FreeRTOSConfig.h => module-os/systemviewPatch/FreeRTOSConfig.h +1 -1
@@ 39,7 39,7 @@
 *----------------------------------------------------------*/
#include <assert.h>
#include <stdint.h>
#include "log/log.hpp"
#include <log.hpp>

//TODO: Look at tasks.c: void vTaskStepTick( const TickType_t xTicksToJump ) before upgrading FreeRTOS
#ifdef __cplusplus

M module-services/CMakeLists.txt => module-services/CMakeLists.txt +20 -19
@@ 1,6 1,4 @@
cmake_minimum_required(VERSION 3.14)

project(module-services VERSION 1.0
project(module-services VERSION 1.0
        DESCRIPTION "Library with all services.")

module_is_test_entity()


@@ 33,22 31,25 @@ add_subdirectory( service-antenna )
add_subdirectory( service-time )
add_subdirectory( service-fileindexer )

target_link_libraries(${PROJECT_NAME} PUBLIC
    service-gui
    service-eink
    service-appmgr
    module-bsp
    module-os
    module-sys
    module-utils
    module-gui
    module-apps
    module-db
    module-cellular
    module-audio
    service-fileindexer
    service-antenna
    ${TARGET_LIBRARIES}
target_link_libraries(${PROJECT_NAME} 
    PUBLIC
        service-gui
        service-eink
        service-appmgr
        module-bsp
        module-os
        module-sys
        module-utils
        module-gui
        module-apps
        module-db
        module-cellular
        module-audio
        service-fileindexer
        service-antenna
        ${TARGET_LIBRARIES}
    PRIVATE
        time
)

# Board specific compilation definitions,options,include directories and features

M module-services/service-antenna/CMakeLists.txt => module-services/service-antenna/CMakeLists.txt +1 -0
@@ 14,6 14,7 @@ target_link_libraries(${PROJECT_NAME}
        module-cellular
        module-utils
        service-cellular
        eventstore
)

target_include_directories(${PROJECT_NAME}

M module-services/service-antenna/ServiceAntenna.cpp => module-services/service-antenna/ServiceAntenna.cpp +11 -12
@@ 4,14 4,16 @@
#include "service-antenna/ServiceAntenna.hpp"
#include "service-antenna/AntennaMessage.hpp"
#include "service-antenna/AntennaServiceAPI.hpp"
#include "service-antenna/ServiceState.hpp"

#include <service-appmgr/model/ApplicationManager.hpp>

#include <at/response.hpp>
#include <common_data/EventStore.hpp>
#include <log/log.hpp>

#include <log.hpp>
#include <EventStore.hpp>

#include <MessageType.hpp>
#include <module-utils/state/ServiceState.hpp>
#include <projdefs.h>
#include <module-sys/Timers/TimerFactory.hpp>
#include <service-cellular/State.hpp>


@@ 60,7 62,7 @@ ServiceAntenna::ServiceAntenna()
      phoneModeObserver{std::make_unique<sys::phone_modes::Observer>()}
{
    LOG_INFO("[%s] Initializing", service::name::antenna);
    state = new utils::state::State<antenna::State>(this);
    state = new state::State<antenna::State>(this);
    timer = sys::TimerFactory::createPeriodicTimer(
        this, "Antenna", std::chrono::seconds{5}, [this](sys::Timer & /*timer*/) {
            timer.stop();


@@ 77,6 79,11 @@ ServiceAntenna::ServiceAntenna()
    bus.channels.push_back(sys::BusChannel::AntennaNotifications);
    bus.channels.push_back(sys::BusChannel::PhoneModeChanges);

    connect(typeid(cellular::msg::notification::SimReady), [this](sys::Message *) {
        state->set(antenna::State::init);
        return sys::MessageNone{};
    });

    phoneModeObserver->connect(this);
    phoneModeObserver->subscribe([this](sys::phone_modes::PhoneMode mode) {
        if (mode == sys::phone_modes::PhoneMode::Offline) {


@@ 119,14 126,6 @@ sys::MessagePointer ServiceAntenna::DataReceivedHandler(sys::DataMessage *msgl, 
        case CellularMessage::Type::HangupCall: {
            AntennaServiceAPI::LockRequest(this, antenna::lockState::unlocked);
        } break;
        case CellularMessage::Type::StateRequest: {
            auto msg = dynamic_cast<cellular::StateChange *>(msgl);
            if (msg != nullptr) {
                if (msg->request == cellular::service::State::ST::Ready) {
                    state->set(antenna::State::init);
                }
            }
        } break;
        default:
            break;
        }

M module-services/service-antenna/service-antenna/ServiceAntenna.hpp => module-services/service-antenna/service-antenna/ServiceAntenna.hpp +6 -8
@@ 5,7 5,6 @@

#include <bsp/cellular/bsp_cellular.hpp>
#include <MessageType.hpp>
#include <module-utils/state/ServiceState.hpp>
#include <Service/Common.hpp>
#include <Service/Message.hpp>
#include <Service/Service.hpp>


@@ 19,13 18,12 @@
#include <cstdint>
#include <memory>

namespace utils
#include "ServiceState.hpp"

namespace state
{
    namespace state
    {
        template <typename T> class State;
    } // namespace state
} // namespace utils
    template <typename T> class State;
} // namespace state

namespace service::name
{


@@ 62,7 60,7 @@ namespace antenna
class ServiceAntenna : public sys::Service
{
  private:
    utils::state::State<antenna::State> *state;
    state::State<antenna::State> *state;
    bool HandleStateChange(antenna::State state);

    sys::TimerHandle timer;

R module-utils/state/ServiceState.hpp => module-services/service-antenna/service-antenna/ServiceState.hpp +57 -65
@@ 3,81 3,73 @@

#pragma once

#include <algorithm>
#include <cassert>

#include "Service/Service.hpp"
#include "Service/Message.hpp"
#include "MessageType.hpp"

namespace utils
namespace state
{

    namespace state
    template <typename T> class State
    {
        template <typename T> class State
        {

          private:
            T currentState;
            T lastState;
            sys::Service *owner = nullptr;
      private:
        T currentState;
        T lastState;
        sys::Service *owner = nullptr;

            bool timeoutActive         = false;
            uint32_t timeoutElapseTime = 0;
            T timeoutState;
        bool timeoutActive         = false;
        uint32_t timeoutElapseTime = 0;
        T timeoutState;

            bool notifyOwner(void)
            {
        bool notifyOwner()
        {
            if (owner != nullptr) {
                auto msg = std::make_shared<sys::DataMessage>(MessageType::StateChange);
                if (owner != nullptr) {
                    owner->bus.sendUnicast(msg, owner->GetName());
                    return true;
                }
                return false;
                owner->bus.sendUnicast(msg, owner->GetName());
                return true;
            }
            return false;
        }

          public:
            State(sys::Service *service) : owner(service)
            {}
            void set(T state)
            {
                LOG_INFO(
                    "%s state change: [ %s ] -> [ %s ]", owner->GetName().c_str(), c_str(currentState), c_str(state));
                lastState    = currentState;
                currentState = state;
                notifyOwner();
            }
            T get(void)
            {
                return currentState;
            }
            T getLast(void)
            {
                return lastState;
            }
            T getTimeoutState(void)
            {
                return timeoutState;
            }
            void disableTimeout(void)
            {
                timeoutActive = false;
            }
            void enableStateTimeout(uint32_t currentTime, uint32_t timeout, T timeoutOccuredState)
            {
                timeoutElapseTime = currentTime + timeout;
                timeoutState      = timeoutOccuredState;
                timeoutActive     = true;
            }
            bool timeoutOccured(uint32_t time)
            {
                if (time >= timeoutElapseTime && timeoutActive) {
                    disableTimeout();
                    return true;
                }
                return false;
      public:
        State(sys::Service *service) : owner(service)
        {}
        void set(T state)
        {
            LOG_INFO("%s state change: [ %s ] -> [ %s ]", owner->GetName().c_str(), c_str(currentState), c_str(state));
            lastState    = currentState;
            currentState = state;
            notifyOwner();
        }
        T get() const
        {
            return currentState;
        }
        T getLast() const
        {
            return lastState;
        }
        T getTimeoutState() const
        {
            return timeoutState;
        }
        void disableTimeout()
        {
            timeoutActive = false;
        }
        void enableStateTimeout(uint32_t currentTime, uint32_t timeout, T timeoutOccuredState)
        {
            timeoutElapseTime = currentTime + timeout;
            timeoutState      = timeoutOccuredState;
            timeoutActive     = true;
        }
        bool timeoutOccured(uint32_t time)
        {
            if (time >= timeoutElapseTime && timeoutActive) {
                disableTimeout();
                return true;
            }
        };
    } // namespace state
} // namespace utils
            return false;
        }
    };
} // namespace state

M module-services/service-appmgr/CMakeLists.txt => module-services/service-appmgr/CMakeLists.txt +4 -1
@@ 1,4 1,4 @@
project(service-appmgr)
project(service-appmgr)
message( "${PROJECT_NAME}  ${CMAKE_CURRENT_LIST_DIR}" )

set(SOURCES


@@ 37,6 37,9 @@ target_link_libraries(${PROJECT_NAME}
        service-gui
        module-apps
        module-audio
        json::json
    PUBLIC
        time
)

target_include_directories(${PROJECT_NAME}

M module-services/service-appmgr/model/ActionsRegistry.cpp => module-services/service-appmgr/model/ActionsRegistry.cpp +1 -1
@@ 3,7 3,7 @@

#include <service-appmgr/model/ActionsRegistry.hpp>

#include <module-utils/log/log.hpp>
#include <log.hpp>
#include <magic_enum.hpp>

#include <cassert>

M module-services/service-appmgr/model/ApplicationManager.cpp => module-services/service-appmgr/model/ApplicationManager.cpp +13 -12
@@ 20,7 20,7 @@
#include <application-onboarding/ApplicationOnBoarding.hpp>
#include <application-onboarding/data/OnBoardingMessages.hpp>
#include <i18n/i18n.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <service-appmgr/messages/Message.hpp>
#include <service-evtmgr/EventManager.hpp>
#include <service-evtmgr/EVMessages.hpp>


@@ 35,7 35,7 @@
#include <limits>
#include <utility>
#include <module-utils/Utils.hpp>
#include <module-utils/time/DateAndTimeSettings.hpp>
#include <time/DateAndTimeSettings.hpp>
#include <module-services/service-db/agents/settings/SystemSettings.hpp>
#include <service-appmgr/messages/DOMRequest.hpp>
#include <service-appmgr/messages/GetAllNotificationsRequest.hpp>


@@ 573,16 573,17 @@ namespace app::manager
                });
        connect(typeid(cellular::msg::notification::SimReady),
                [&](sys::Message *request) -> sys::MessagePointer { return simLockHandler.handleSimReadyMessage(); });
        connect(typeid(cellular::StateChange), [&](sys::Message *request) -> sys::MessagePointer {
            auto data = static_cast<cellular::StateChange *>(request);
            if (data->request == cellular::service::State::ST::URCReady) {
                simLockHandler.setSimReady();
                simLockHandler.getSettingsSimSelect(
                    settings->getValue(settings::SystemProperties::activeSim, settings::SettingsScope::Global));
                return sys::msgHandled();
            }
            return sys::msgNotHandled();
        });
        connect(typeid(cellular::msg::notification::ModemStateChanged),
                [&](sys::Message *request) -> sys::MessagePointer {
                    auto data = static_cast<cellular::msg::notification::ModemStateChanged *>(request);
                    if (data->state == cellular::api::ModemState::Ready) {
                        simLockHandler.setSimReady();
                        simLockHandler.getSettingsSimSelect(
                            settings->getValue(settings::SystemProperties::activeSim, settings::SettingsScope::Global));
                        return sys::msgHandled();
                    }
                    return sys::msgNotHandled();
                });

        connect(typeid(onBoarding::FinalizeOnBoarding),
                [&](sys::Message *request) -> sys::MessagePointer { return handleOnBoardingFinalize(); });

M module-services/service-appmgr/service-appmgr/messages/DOMRequest.hpp => module-services/service-appmgr/service-appmgr/messages/DOMRequest.hpp +1 -1
@@ 5,7 5,7 @@

#include "BaseMessage.hpp"
#include "service-desktop/DeveloperModeMessage.hpp"
#include <json/json11.hpp>
#include <json11.hpp>

namespace app::manager
{

M module-services/service-audio/AudioServiceAPI.cpp => module-services/service-audio/AudioServiceAPI.cpp +1 -1
@@ 7,7 7,7 @@

#include <Audio/decoder/Decoder.hpp>
#include <Service/Common.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <utility>


M module-services/service-bluetooth/CMakeLists.txt => module-services/service-bluetooth/CMakeLists.txt +1 -0
@@ 22,4 22,5 @@ target_link_libraries(${PROJECT_NAME}
        module-bluetooth
        service-desktop
        module-sys
        json::json
)

M module-services/service-bluetooth/ServiceBluetooth.cpp => module-services/service-bluetooth/ServiceBluetooth.cpp +1 -1
@@ 24,7 24,7 @@

#include "SystemManager/messages/SentinelRegistrationMessage.hpp"

#include <log/log.hpp>
#include <log.hpp>
#include <bits/exception.h>
#include <utility>
#include <service-desktop/service-desktop/DesktopMessages.hpp>

M module-services/service-bluetooth/service-bluetooth/SettingsHolder.hpp => module-services/service-bluetooth/service-bluetooth/SettingsHolder.hpp +1 -1
@@ 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
#pragma once
#include <json/json11.hpp>
#include <json11.hpp>
#include <string>
#include <variant>
#include <service-db/Settings.hpp>

M module-services/service-bluetooth/service-bluetooth/SettingsSerializer.cpp => module-services/service-bluetooth/service-bluetooth/SettingsSerializer.cpp +1 -1
@@ 3,7 3,7 @@

#include "SettingsSerializer.hpp"
#include "btstack_util.h"
#include <log/log.hpp>
#include <log.hpp>

namespace strings
{

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

#pragma once

#include <json/json11.hpp>
#include <json11.hpp>
#include <Device.hpp>

class SettingsSerializer

M module-services/service-cellular/CMakeLists.txt => module-services/service-cellular/CMakeLists.txt +10 -4
@@ 47,13 47,19 @@ target_include_directories(${PROJECT_NAME}

target_link_libraries(${PROJECT_NAME}
    PRIVATE
        service-antenna
        service-audio
        service-evtmgr
        Microsoft.GSL::GSL
        module-bsp
        module-cellular
        Microsoft.GSL::GSL
        re2::re2
        service-antenna
        service-audio
        service-evtmgr
        ucs2
        json::json
    PUBLIC
        time
        utf8
        eventstore
    )

if (${ENABLE_TESTS})

M module-services/service-cellular/CellularCall.cpp => module-services/service-cellular/CellularCall.cpp +1 -1
@@ 6,7 6,7 @@
#include <CalllogRecord.hpp>
#include <PhoneNumber.hpp>
#include <Utils.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <cinttypes>
#include <ctime>

M module-services/service-cellular/CellularServiceAPI.cpp => module-services/service-cellular/CellularServiceAPI.cpp +1 -1
@@ 10,7 10,7 @@
#include <PhoneNumber.hpp>
#include <Service/Common.hpp>
#include <bsp/cellular/bsp_cellular.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <memory>
#include <string>

M module-services/service-cellular/NetworkSettings.cpp => module-services/service-cellular/NetworkSettings.cpp +1 -3
@@ 191,7 191,6 @@ std::optional<std::pair<at::response::qcfg_ims::IMSState, at::response::qcfg_ims

at::Result::Code NetworkSettings::setVoLTEState(VoLTEState state)
{

    /**
     * VoLTE On scenario
     * 1^) auto select off


@@ 226,6 225,7 @@ at::Result::Code NetworkSettings::setVoLTEState(VoLTEState state)
    }
    LOG_DEBUG("Modem soft reboot");
    cellularService.resetCellularModule(ServiceCellular::ResetType::SoftReset);

    return at::Result::Code::OK;
}



@@ 249,7 249,6 @@ VoLTEState NetworkSettings::getVoLTEState()

std::string NetworkSettings::printVoLTEDebug()
{

    auto channel = cellularService.cmux->get(CellularMux::Channel::Commands);
    if (channel) {
        auto resp = channel->cmd("AT+QVOLTEDBG");


@@ 262,6 261,5 @@ std::string NetworkSettings::printVoLTEDebug()
            return buffer;
        }
    }

    return {};
}

M module-services/service-cellular/RequestFactory.cpp => module-services/service-cellular/RequestFactory.cpp +2 -2
@@ 6,7 6,7 @@
#include <re2/re2.h>

#include <at/Commands.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include "service-cellular/requests/CallRequest.hpp"
#include "service-cellular/requests/SupplementaryServicesRequest.hpp"


@@ 16,7 16,7 @@
#include "service-cellular/requests/UssdRequest.hpp"
#include "service-cellular/requests/RejectRequest.hpp"

#include <common_data/EventStore.hpp>
#include <EventStore.hpp>
#include <cmd/QECCNUM.hpp>

namespace cellular

M module-services/service-cellular/ServiceCellular.cpp => module-services/service-cellular/ServiceCellular.cpp +6 -2
@@ 52,9 52,9 @@
#include <at/UrcCpin.hpp> // for Cpin
#include <at/response.hpp>
#include <bsp/cellular/bsp_cellular.hpp>
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>
#include <country.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <at/UrcFactory.hpp>
#include <queries/messages/sms/QuerySMSSearchByType.hpp>
#include <queries/notifications/QueryNotificationsIncrement.hpp>


@@ 1399,6 1399,8 @@ bool ServiceCellular::handle_URCReady()
    }
    ret = ret && channel->cmd(at::AT::ENABLE_NETWORK_REGISTRATION_URC);

    bus.sendMulticast<cellular::msg::notification::ModemStateChanged>(cellular::api::ModemState::Ready);

    LOG_DEBUG("%s", priv->state->c_str());
    return ret;
}


@@ 1494,12 1496,14 @@ bool ServiceCellular::receiveAllMessages()
bool ServiceCellular::handle_failure()
{
    priv->state->set(State::ST::Idle);
    bus.sendMulticast<cellular::msg::notification::ModemStateChanged>(cellular::api::ModemState::Fail);
    return true;
}

bool ServiceCellular::handle_fatal_failure()
{
    LOG_FATAL("Await for death!");
    bus.sendMulticast<cellular::msg::notification::ModemStateChanged>(cellular::api::ModemState::Fatal);
    while (true) {
        vTaskDelay(500);
    }

M module-services/service-cellular/SignalStrength.cpp => module-services/service-cellular/SignalStrength.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "service-cellular/SignalStrength.hpp"
#include <log/log.hpp>
#include <log.hpp>

SignalStrength::SignalStrength(int rssi)
{

M module-services/service-cellular/include/service-cellular/api/common.hpp => module-services/service-cellular/include/service-cellular/api/common.hpp +8 -0
@@ 32,6 32,14 @@ namespace cellular
            SIM2 = 1
        };

        enum class ModemState
        {
            Startup,
            Ready,
            Fail,
            Fatal
        };

        using SimCode = std::vector<unsigned int>;
    } // namespace api
} // namespace cellular

M module-services/service-cellular/include/service-cellular/api/notification/notification.hpp => module-services/service-cellular/include/service-cellular/api/notification/notification.hpp +7 -0
@@ 38,4 38,11 @@ namespace cellular::msg::notification
    struct SimStateUpdate : public msg::Notification
    {};

    struct ModemStateChanged : public msg::Notification
    {
        explicit ModemStateChanged(api::ModemState state) : state(state)
        {}
        const api::ModemState state;
    };

} // namespace cellular::msg::notification

M module-services/service-cellular/service-cellular/PacketDataTypes.hpp => module-services/service-cellular/service-cellular/PacketDataTypes.hpp +1 -1
@@ 10,7 10,7 @@

#include <Utils.hpp>

#include <json/json11.hpp>
#include <json11.hpp>

namespace packet_data
{

M module-services/service-cellular/service-cellular/SignalStrength.hpp => module-services/service-cellular/service-cellular/SignalStrength.hpp +2 -2
@@ 1,9 1,9 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <common_data/EventStore.hpp>
#include <EventStore.hpp>

#include <limits>
class SignalStrength

M module-services/service-cellular/src/SimCard.cpp => module-services/service-cellular/src/SimCard.cpp +1 -1
@@ 3,7 3,7 @@

#include "SimCard.hpp"

#include <common_data/EventStore.hpp>
#include <EventStore.hpp>
#include <bsp/cellular/bsp_cellular.hpp>
#include <modem/BaseChannel.hpp>
#include <at/ATFactory.hpp>

M module-services/service-cellular/src/State.cpp => module-services/service-cellular/src/State.cpp +2 -1
@@ 4,6 4,7 @@
#include <service-cellular/State.hpp>
#include <Service/Service.hpp>
#include <service-cellular/CellularMessage.hpp>
#include <service-cellular/api/common.hpp>

namespace cellular::service
{


@@ 65,7 66,7 @@ namespace cellular::service
        LOG_DEBUG("GSM state: (%s) -> (%s)", c_str(this->state), c_str(state));
        this->state = state;
        auto msg    = std::make_shared<StateChange>(state);
        owner->bus.sendMulticast(msg, sys::BusChannel::ServiceCellularNotifications);
        owner->bus.sendUnicast(msg, cellular::service::name);
    }

    State::ST State::get() const

M module-services/service-cellular/src/messages.hpp => module-services/service-cellular/src/messages.hpp +1 -1
@@ 12,6 12,6 @@ namespace cellular::internal::msg
    {
        HandleATSimStateChange(at::SimState state) : state(state)
        {}
        at::SimState state;
        const at::SimState state;
    };
} // namespace cellular::internal::msg

M module-services/service-cellular/tests/CMakeLists.txt => module-services/service-cellular/tests/CMakeLists.txt +0 -2
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

add_catch2_executable(
        NAME
        cellular-request-factory

M module-services/service-db/CMakeLists.txt => module-services/service-db/CMakeLists.txt +4 -1
@@ 1,4 1,4 @@
project(service-db)
project(service-db)
message("${PROJECT_NAME}  ${CMAKE_CURRENT_LIST_DIR}" )




@@ 32,6 32,9 @@ target_include_directories(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME}
    PRIVATE
        module-db
        json::json
    PUBLIC
        utf8
)

if (${ENABLE_TESTS})

M module-services/service-db/DBServiceAPI.cpp => module-services/service-db/DBServiceAPI.cpp +1 -1
@@ 18,7 18,7 @@
#include <Tables/CountryCodesTable.hpp>
#include <ThreadRecord.hpp>
#include <Utils.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <queries/messages/threads/QueryThreadGetByNumber.hpp>

#include <utility>

M module-services/service-db/ServiceDB.cpp => module-services/service-db/ServiceDB.cpp +1 -1
@@ 34,7 34,7 @@
#include <SMSTemplateRecord.hpp>
#include <Tables/Record.hpp>
#include <ThreadRecord.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <time/ScopedTime.hpp>

#include <cassert>

M module-services/service-db/agents/file_indexer/FileIndexerAgent.cpp => module-services/service-db/agents/file_indexer/FileIndexerAgent.cpp +1 -1
@@ 4,7 4,7 @@
#include "FileIndexerAgent.hpp"
#include "FileIndexer_queries.hpp"

#include <log/log.hpp>
#include <log.hpp>
#include <purefs/filesystem_paths.hpp>
#include <Application.hpp>
#include <memory>

M module-services/service-db/agents/settings/FactorySettings.hpp => module-services/service-db/agents/settings/FactorySettings.hpp +1 -1
@@ 5,7 5,7 @@

#include <Database/Database.hpp>
#include <purefs/filesystem_paths.hpp>
#include <json/json11.hpp>
#include <json11.hpp>
#include <fstream>
#include <module-services/service-db/service-db/SettingsMessages.hpp>
#include "Settings_queries.hpp"

M module-services/service-db/agents/settings/Settings.cpp => module-services/service-db/agents/settings/Settings.cpp +1 -1
@@ 10,7 10,7 @@
#include <vector>

#if defined(DEBUG_SETTINGS_DB) and DEBUG_SETTINGS_DB == 1
#include <log/log.hpp>
#include <log.hpp>
#define log_debug(...) LOG_DEBUG(__VA_ARGS__);
#else
#define log_debug(...)

M module-services/service-db/agents/settings/Settings_queries.hpp => module-services/service-db/agents/settings/Settings_queries.hpp +1 -1
@@ 3,7 3,7 @@

#pragma once

#include <log/log.hpp>
#include <log.hpp>

namespace settings::Statements
{

M module-services/service-db/agents/settings/SystemSettings.hpp => module-services/service-db/agents/settings/SystemSettings.hpp +0 -2
@@ 9,8 9,6 @@ namespace settings
    {
        constexpr inline auto activeSim                = "gs_active_sim";
        constexpr inline auto lockPassHash             = "gs_lock_pass_hash";
        constexpr inline auto usbSecurity              = "gs_usb_security";
        constexpr inline auto usbDevices               = "gs_usb_devices";
        constexpr inline auto lockScreenPasscodeIsOn   = "gs_lock_screen_passcode_is_on";
        constexpr inline auto autoLockTimeInSec        = "gs_lock_time";
        constexpr inline auto displayLanguage          = "gs_display_language";

M module-services/service-db/test/test-settings/Database.cpp => module-services/service-db/test/test-settings/Database.cpp +1 -1
@@ 3,7 3,7 @@

#include "module-db/Database/Database.hpp"

#include "log/log.hpp"
#include <log.hpp>

#include <purefs/filesystem_paths.hpp>
#include <gsl/util>

M module-services/service-desktop/CMakeLists.txt => module-services/service-desktop/CMakeLists.txt +11 -6
@@ 1,7 1,8 @@
project(service-desktop)
project(service-desktop)
message( "${PROJECT_NAME}  ${CMAKE_CURRENT_LIST_DIR}" )

set(SOURCES
    endpoints/BaseHelper.cpp
    endpoints/backup/BackupEndpoint.cpp
    endpoints/backup/BackupRestore.cpp
    endpoints/bluetooth/BluetoothEndpoint.cpp


@@ 14,7 15,6 @@ set(SOURCES
    endpoints/contacts/ContactsEndpoint.cpp
    endpoints/developerMode/DeveloperModeEndpoint.cpp
    endpoints/developerMode/DeveloperModeHelper.cpp
    endpoints/developerMode/Mode/BaseHelper.cpp
    endpoints/developerMode/Mode/UI_Helper.cpp
    endpoints/developerMode/event/DomRequest.cpp
    endpoints/developerMode/event/ATRequest.cpp


@@ 30,6 30,7 @@ set(SOURCES
    endpoints/calendarEvents/CalendarEventsHelper.cpp
    endpoints/calendarEvents/CalendarEventsEndpoint.cpp
    endpoints/security/SecurityEndpoint.cpp
    endpoints/security/SecurityEndpointHelper.cpp

    parser/HttpEnums.cpp
    parser/ParserFSM.cpp


@@ 54,14 55,18 @@ target_include_directories(${PROJECT_NAME}

target_link_libraries(${PROJECT_NAME}
    PRIVATE
        service-cellular
        service-evtmgr
        module-utils
        module-cellular
        crc32
        microtar
        module-utils
        service-cellular
        service-evtmgr
        utf8
        utils-bootconfig
        Microsoft.GSL::GSL
        json::json
    PUBLIC
        module-cellular
        eventstore
)

if (${ENABLE_TESTS})

M module-services/service-desktop/DesktopMessages.cpp => module-services/service-desktop/DesktopMessages.cpp +1 -1
@@ 22,7 22,7 @@ namespace sdesktop
        {
            context.setResponseStatus(http::Code::OK);
            context.setEndpoint(EndpointType::developerMode);
            context.setResponseBody(json11::Json::object{{json::developerMode::isLocked, isLocked}});
            context.setResponseBody(json11::Json::object{{json::developerMode::phoneLocked, isLocked}});
        }

        CellularStateInfoRequestEvent::CellularStateInfoRequestEvent(std::string stateStr)

M module-services/service-desktop/ServiceDesktop.cpp => module-services/service-desktop/ServiceDesktop.cpp +7 -50
@@ 1,4 1,4 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "service-appmgr/service-appmgr/messages/DOMRequest.hpp"


@@ 13,8 13,8 @@
#include <Common/Query.hpp>
#include <MessageType.hpp>
#include <Service/Worker.hpp>
#include <json/json11.hpp>
#include <log/log.hpp>
#include <json11.hpp>
#include <log.hpp>
#include <module-apps/application-desktop/ApplicationDesktop.hpp>
#include <service-db/service-db/Settings.hpp>
#include <service-db/QueryMessage.hpp>


@@ 242,35 242,15 @@ sys::ReturnCodes ServiceDesktop::InitHandler()
        return sys::MessageNone{};
    });

    connect(sdesktop::usb::USBHandshake(), [&](sys::Message *msg) {
        auto handshakeMsg = dynamic_cast<sdesktop::usb::USBHandshake *>(msg);
        processUSBHandshake(handshakeMsg);
        return sys::MessageNone{};
    });

    connect(sdesktop::usb::USBSecurityOn(), [&](sys::Message *msg) {
        usbSecurityModel->enableEndpointSecurity(true);
        return sys::MessageNone{};
    });

    connect(sdesktop::usb::USBSecurityOff(), [&](sys::Message *msg) {
        usbSecurityModel->enableEndpointSecurity(false);
        return sys::MessageNone{};
    });

    connect(typeid(locks::UnlockedPhone), [&](sys::Message *msg) {
        if (usbSecurityModel->isSecurityEnabled()) {
            LOG_INFO("Phone unlocked. Enabling endpoints.");
            usbSecurityModel->setEndpointSecurity(EndpointSecurity::Allow);
        }
        LOG_INFO("Phone unlocked.");
        usbSecurityModel->setPhoneUnlocked();
        return sys::MessageNone{};
    });

    connect(typeid(locks::LockedPhone), [&](sys::Message *msg) {
        if (usbSecurityModel->isSecurityEnabled()) {
            LOG_INFO("Phone locked. Securing endpoints.");
            usbSecurityModel->setEndpointSecurity(EndpointSecurity::Block);
        }
        LOG_INFO("Phone locked.");
        usbSecurityModel->setPhoneLocked();
        return sys::MessageNone{};
    });



@@ 291,14 271,6 @@ sys::ReturnCodes ServiceDesktop::InitHandler()
    settings->registerValueChange(updateos::settings::history,
                                  [this](const std::string &value) { updateOS->setInitialHistory(value); });

    settings->registerValueChange(
        ::settings::SystemProperties::usbSecurity,
        [this](std::string value) {
            bool securityEnabled = utils::getNumericValue<bool>(value);
            usbSecurityModel->setEndpointSecurity(securityEnabled ? EndpointSecurity::Block : EndpointSecurity::Allow);
        },
        settings::SettingsScope::Global);

    return (sys::ReturnCodes::Success);
}



@@ 355,21 327,6 @@ void ServiceDesktop::prepareBackupData()
    backupRestoreStatus.backupTempDir = purefs::dir::getTemporaryPath() / backupRestoreStatus.task;
}

void ServiceDesktop::processUSBHandshake(sdesktop::usb::USBHandshake *msg)
{
    parserFSM::Context responseContext;
    responseContext.setEndpoint(parserFSM::EndpointType::usbSecurity);
    responseContext.setResponseStatus(parserFSM::http::Code::Forbidden);

    if (usbSecurityModel->processHandshake(msg)) {
        LOG_DEBUG("Handshake ok. Unlocking.");
        bus.sendUnicast(std::make_shared<locks::UnlockPhone>(), service::name::service_desktop);
        responseContext.setResponseStatus(parserFSM::http::Code::OK);
    }

    parserFSM::MessageHandler::putToSendQueue(responseContext.createSimpleResponse());
}

void ServiceDesktop::prepareRestoreData(const std::filesystem::path &restoreLocation)
{
    backupRestoreStatus.operation = ServiceDesktop::Operation::Restore;

M module-services/service-desktop/USBSecurityModel.cpp => module-services/service-desktop/USBSecurityModel.cpp +17 -80
@@ 15,105 15,42 @@ namespace sdesktop
    USBSecurityModel::USBSecurityModel(sys::Service *ownerSrv, settings::Settings *srvSettings)
    {
        settings = srvSettings;

        settings->registerValueChange(
            settings::SystemProperties::usbDevices,
            [this](const std::string &value) { bound = parseDevices(value); },
            ::settings::SettingsScope::Global);

        settings->registerValueChange(
            ::settings::SystemProperties::lockPassHash,
            [this](const std::string &value) {
                // test
                lockPassHash = utils::getNumericValue<unsigned int>(value);
            },
            ::settings::SettingsScope::Global);

        if (isSecurityEnabled()) {
            setEndpointSecurity(EndpointSecurity::Block);
        }
        else {
            setEndpointSecurity(EndpointSecurity::Allow);
        }
        phoneLocked = PhoneLockState::Locked;
    }

    auto USBSecurityModel::isBound(DeviceID id) const -> bool
    auto USBSecurityModel::isPasscodeEnabled() const -> bool
    {
        return bound.find(id) != bound.end();
        return utils::getNumericValue<bool>(
            settings->getValue(settings::SystemProperties::lockScreenPasscodeIsOn, settings::SettingsScope::Global));
    }

    auto USBSecurityModel::addDevice(DeviceID id, Passcode passcode) -> bool
    auto USBSecurityModel::setPhoneLocked() -> void
    {
        if (endpointSecurity == EndpointSecurity::Block && !checkPasscode(passcode)) {
            return false;
        }

        bound.insert(id);
        settings->setValue(settings::SystemProperties::usbDevices, dumpDevices(bound));

        return true;
        phoneLocked = PhoneLockState::Locked;
    }

    bool USBSecurityModel::checkPasscode(const Passcode &passcode)
    auto USBSecurityModel::setPhoneUnlocked() -> void
    {
        static std::hash<unsigned int> hashEngine;
        auto hash = hashEngine(passcode);
        return hash == lockPassHash;
        phoneLocked = PhoneLockState::Unlocked;
    }

    auto USBSecurityModel::isSecurityEnabled() const -> bool
    auto USBSecurityModel::isPhoneLocked() const -> bool
    {
        return utils::getNumericValue<bool>(
            settings->getValue(settings::SystemProperties::usbSecurity, settings::SettingsScope::Global));
        return phoneLocked == PhoneLockState::Locked;
    }

    void USBSecurityModel::enableEndpointSecurity(bool securityEnabled)
    auto USBSecurityModel::isSecurityEnabled() const -> bool
    {
        settings->setValue(settings::SystemProperties::usbSecurity,
                           utils::to_string(securityEnabled),
                           settings::SettingsScope::Global);
        return isPasscodeEnabled() && isPhoneLocked();
    }

    bool USBSecurityModel::processHandshake(const sdesktop::usb::USBHandshake *handshake)
    auto USBSecurityModel::getEndpointSecurity() const -> EndpointSecurity
    {
        auto id  = handshake->getId();
        auto pwd = handshake->getPasscode();

        LOG_DEBUG("Process handshake: id=%s; pwd=%d;", id.c_str(), pwd);

        if (isBound(id)) {
            LOG_DEBUG("Bounded device, handshake successfull");
            return true;
        if (isSecurityEnabled()) {
            return EndpointSecurity::Block;
        }

        if (addDevice(id, pwd)) {
            LOG_DEBUG("Bounding device successfull");
            return true;
        else {
            return EndpointSecurity::Allow;
        }

        LOG_DEBUG("Handshake failed");
        return false;
    }

    void USBSecurityModel::setEndpointSecurity(EndpointSecurity security)
    {
        endpointSecurity = security;
    }

    auto USBSecurityModel::getEndpointSecurity() const -> EndpointSecurity
    {
        return endpointSecurity;
    }

    std::set<DeviceID> USBSecurityModel::parseDevices(const std::string &value) const
    {
        std::istringstream iss{value};
        return {std::istream_iterator<std::string>{iss}, std::istream_iterator<std::string>()};
    }
    std::string USBSecurityModel::dumpDevices(const std::set<DeviceID> &devices) const
    {
        std::stringstream ss;
        std::copy(devices.begin(), devices.end(), std::ostream_iterator<DeviceID>(ss, " "));
        return ss.str();
    }
} // namespace sdesktop
\ No newline at end of file

M module-services/service-desktop/WorkerDesktop.cpp => module-services/service-desktop/WorkerDesktop.cpp +1 -1
@@ 11,7 11,7 @@
#include "Timers/TimerFactory.hpp"

#include <bsp/usb/usb.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <map>
#include <vector>

R module-services/service-desktop/endpoints/developerMode/Mode/BaseHelper.cpp => module-services/service-desktop/endpoints/BaseHelper.cpp +0 -0
R module-services/service-desktop/endpoints/developerMode/Mode/BaseHelper.hpp => module-services/service-desktop/endpoints/BaseHelper.hpp +0 -0
M module-services/service-desktop/endpoints/Context.hpp => module-services/service-desktop/endpoints/Context.hpp +1 -1
@@ 92,7 92,7 @@ namespace parserFSM

        auto setResponse(endpoint::ResponseContext r)
        {
            r = responseContext;
            responseContext = r;
        }

        auto setResponseStatus(http::Code status)

M module-services/service-desktop/endpoints/Endpoint.hpp => module-services/service-desktop/endpoints/Endpoint.hpp +1 -1
@@ 7,7 7,7 @@
#include <parser/ParserUtils.hpp>
#include <parser/MessageHandler.hpp>

#include <json/json11.hpp>
#include <json11.hpp>
#include <Common/Query.hpp>
#include <Service/Service.hpp>
#include <string>

M module-services/service-desktop/endpoints/EndpointFactory.hpp => module-services/service-desktop/endpoints/EndpointFactory.hpp +1 -7
@@ 19,7 19,7 @@
#include "restore/RestoreEndpoint.hpp"
#include "update/UpdateEndpoint.hpp"
#include <endpoints/bluetooth/BluetoothEndpoint.hpp>
#include <module-services/service-desktop/endpoints/security/SecurityEndpoint.hpp>
#include "security/SecurityEndpoint.hpp"

class EndpointFactory
{


@@ 62,12 62,6 @@ class EndpointFactory
    }
};

enum class EndpointSecurity
{
    Allow = 0,
    Block = 1
};

class SecuredEndpointFactory : public EndpointFactory
{
    static constexpr auto Whitelist = {parserFSM::EndpointType::developerMode, parserFSM::EndpointType::usbSecurity};

M module-services/service-desktop/endpoints/ResponseContext.hpp => module-services/service-desktop/endpoints/ResponseContext.hpp +1 -1
@@ 3,7 3,7 @@

#pragma once

#include <json/json11.hpp>
#include <json11.hpp>
#include <parser/HttpEnums.hpp>

namespace parserFSM::endpoint

M module-services/service-desktop/endpoints/backup/BackupEndpoint.cpp => module-services/service-desktop/endpoints/backup/BackupEndpoint.cpp +1 -1
@@ 9,7 9,7 @@
#include <service-desktop/DesktopMessages.hpp>
#include <service-desktop/ServiceDesktop.hpp>

#include <json/json11.hpp>
#include <json11.hpp>
#include <purefs/filesystem_paths.hpp>

#include <filesystem>

M module-services/service-desktop/endpoints/backup/BackupRestore.cpp => module-services/service-desktop/endpoints/backup/BackupRestore.cpp +1 -1
@@ 4,7 4,7 @@
#include "BackupRestore.hpp"

#include <SystemManager/SystemManager.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <microtar.hpp>
#include <purefs/filesystem_paths.hpp>
#include <service-db/DBServiceAPI.hpp>

M module-services/service-desktop/endpoints/backup/BackupRestore.hpp => module-services/service-desktop/endpoints/backup/BackupRestore.hpp +1 -1
@@ 5,7 5,7 @@

#include <Service/Service.hpp>
#include <filesystem>
#include <json/json11.hpp>
#include <json11.hpp>

namespace sys
{

M module-services/service-desktop/endpoints/calendarEvents/CalendarEventsHelper.cpp => module-services/service-desktop/endpoints/calendarEvents/CalendarEventsHelper.cpp +1 -2
@@ 7,8 7,7 @@
#include <parser/ParserUtils.hpp>
#include "Service/Common.hpp"
#include <service-db/DBServiceAPI.hpp>
#include "log/log.hpp"
#include "json/json11.hpp"
#include <log.hpp>
#include <queries/calendar/QueryEventsGetAll.hpp>
#include <queries/calendar/QueryEventsGet.hpp>
#include <queries/calendar/QueryEventsAdd.hpp>

M module-services/service-desktop/endpoints/calllog/CalllogHelper.hpp => module-services/service-desktop/endpoints/calllog/CalllogHelper.hpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 11,7 11,7 @@
#include <Service/Common.hpp>
#include <Service/Service.hpp>
#include <application-phonebook/models/PhonebookModel.hpp>
#include <json/json11.hpp>
#include <json11.hpp>

#include <string>


M module-services/service-desktop/endpoints/contacts/ContactHelper.cpp => module-services/service-desktop/endpoints/contacts/ContactHelper.cpp +2 -3
@@ 1,4 1,4 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ContactHelper.hpp"


@@ 16,8 16,7 @@
#include <ContactRecord.hpp>
#include <PhoneNumber.hpp>
#include <Service/Common.hpp>
#include <json/json11.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <queries/RecordQuery.hpp>
#include <queries/phonebook/QueryContactGetByID.hpp>
#include <queries/phonebook/QueryContactUpdate.hpp>

M module-services/service-desktop/endpoints/contacts/ContactHelper.hpp => module-services/service-desktop/endpoints/contacts/ContactHelper.hpp +1 -1
@@ 11,7 11,7 @@
#include <Service/Common.hpp>
#include <Service/Service.hpp>
#include <application-phonebook/models/PhonebookModel.hpp>
#include <json/json11.hpp>
#include <json11.hpp>

#include <string>


M module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.cpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeEndpoint.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "DeveloperModeEndpoint.hpp"
#include "log/log.hpp"
#include <log.hpp>

#include <endpoints/Context.hpp>
#include <service-desktop/parser/MessageHandler.hpp>

M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.cpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.cpp +5 -7
@@ 71,7 71,7 @@ auto DeveloperModeHelper::processPut(Context &context) -> ProcessResult
        code       = toCode(owner->bus.sendUnicast(std::move(msg), service::name::evt_manager));
        return {sent::delayed, std::nullopt};
    }
    else if (body[json::developerMode::isLocked].bool_value()) {
    else if (body[json::developerMode::phoneLocked].bool_value()) {
        auto event = std::make_unique<sdesktop::developerMode::ScreenlockCheckEvent>();
        auto msg   = std::make_shared<sdesktop::developerMode::DeveloperModeRequest>(std::move(event));
        code       = toCode(owner->bus.sendUnicast(std::move(msg), "ApplicationManager"));


@@ 115,12 115,10 @@ auto DeveloperModeHelper::processPut(Context &context) -> ProcessResult
                               service::name::system_manager);
        return {sent::delayed, std::nullopt};
    }
    else if (body[json::developerMode::usbSecurityStatus].is_string()) {
        std::shared_ptr<sys::DataMessage> msg = std::make_shared<sdesktop::usb::USBConfigured>();
        if (body[json::developerMode::usbSecurityStatus].string_value() == json::developerMode::usbUnlocked) {
            msg = std::make_shared<locks::UnlockedPhone>();
        }
        code = toCode(owner->bus.sendUnicast(std::move(msg), "ServiceDesktop"));
    else if (body[json::developerMode::phoneLockCodeEnabled].is_bool()) {
        auto phoneLockState = body[json::developerMode::phoneLockCodeEnabled].bool_value();
        auto msg            = std::make_shared<locks::ExternalPhoneLockAvailabilityChange>(phoneLockState);
        code                = toCode(owner->bus.sendUnicast(std::move(msg), "ApplicationManager"));
    }
    else if (auto switchData = body[json::developerMode::switchApplication].object_items(); !switchData.empty()) {
        auto msg = std::make_shared<app::manager::SwitchRequest>(

M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.hpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.hpp +5 -7
@@ 11,7 11,7 @@
#include <bsp/keyboard/key_codes.hpp>
#include <input/InputEvent.hpp>
#include <module-db/Interface/SMSRecord.hpp>
#include "Mode/BaseHelper.hpp"
#include <endpoints/BaseHelper.hpp>

namespace sys
{


@@ 50,21 50,23 @@ namespace parserFSM
        inline constexpr auto AT                     = "AT";
        inline constexpr auto timeout                = "timeout";
        inline constexpr auto focus                  = "focus";
        inline constexpr auto isLocked               = "isLocked";
        inline constexpr auto phoneLocked            = "phoneLocked";
        inline constexpr auto changeSim              = "changeSim";
        inline constexpr auto changeAutoLockTimeout  = "changeAutoLockTimeout";
        inline constexpr auto smsCommand             = "smsCommand";
        inline constexpr auto changeCellularStateCmd = "changeCellularStateCmd";
        inline constexpr auto getInfo                = "getInfo";
        inline constexpr auto tethering              = "tethering";
        inline constexpr auto usbSecurityStatus      = "usbSecurityStatus";
        inline constexpr auto switchApplication      = "switchApplication";
        inline constexpr auto switchWindow           = "switchWindow";
        inline constexpr auto phoneLockCodeEnabled   = "phoneLockCodeEnabled";

        namespace switchData
        {
            inline constexpr auto applicationName = "applicationName";
            inline constexpr auto windowName      = "windowName";
        } // namespace switchData

        /// values for getInfo cmd
        inline constexpr auto simStateInfo      = "simState";
        inline constexpr auto cellularStateInfo = "cellularState";


@@ 77,10 79,6 @@ namespace parserFSM
        inline constexpr auto tetheringOn  = "on";
        inline constexpr auto tetheringOff = "off";

        // values for usb security
        inline constexpr auto usbLocked   = "locked";
        inline constexpr auto usbUnlocked = "unlocked";

    } // namespace json::developerMode

} // namespace parserFSM

M module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.cpp => module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "UI_Helper.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "service-desktop/Constants.hpp"
#include "service-desktop/DeveloperModeMessage.hpp"
#include <variant>

M module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.hpp => module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.hpp +1 -1
@@ 5,7 5,7 @@

#include <endpoints/Context.hpp>
#include <Service/Common.hpp>
#include "BaseHelper.hpp"
#include <endpoints/BaseHelper.hpp>

namespace parserFSM
{

M module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp => module-services/service-desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp +2 -3
@@ 1,4 1,4 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "DeviceInfoEndpoint.hpp"


@@ 6,8 6,7 @@
#include <endpoints/update/UpdateMuditaOS.hpp>
#include <parser/MessageHandler.hpp>

#include <common_data/EventStore.hpp>
#include <json/json11.hpp>
#include <EventStore.hpp>
#include <source/version.hpp>
#include <service-desktop/service-desktop/ServiceDesktop.hpp>
#include <version.hpp>

M module-services/service-desktop/endpoints/factoryReset/FactoryReset.cpp => module-services/service-desktop/endpoints/factoryReset/FactoryReset.cpp +1 -1
@@ 3,7 3,7 @@

#include "FactoryReset.hpp"
#include <SystemManager/SystemManager.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <service-db/DBServiceName.hpp>
#include <Utils.hpp>


M module-services/service-desktop/endpoints/factoryReset/FactoryResetEndpoint.cpp => module-services/service-desktop/endpoints/factoryReset/FactoryResetEndpoint.cpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "FactoryResetEndpoint.hpp"


@@ 8,7 8,7 @@
#include <service-desktop/DesktopMessages.hpp>
#include <service-desktop/ServiceDesktop.hpp>

#include <json/json11.hpp>
#include <json11.hpp>

#include <memory>


M module-services/service-desktop/endpoints/messages/MessageHelper.cpp => module-services/service-desktop/endpoints/messages/MessageHelper.cpp +0 -1
@@ 13,7 13,6 @@
#include <SMSTemplateRecord.hpp>
#include <Service/Common.hpp>
#include <ThreadRecord.hpp>
#include <json/json11.hpp>
#include <queries/messages/sms/QuerySMSGet.hpp>
#include <queries/messages/sms/QuerySMSGetByID.hpp>
#include <queries/messages/sms/QuerySMSGetByThreadID.hpp>

M module-services/service-desktop/endpoints/messages/MessageHelper.hpp => module-services/service-desktop/endpoints/messages/MessageHelper.hpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 12,7 12,7 @@
#include <Service/Common.hpp>
#include <Service/Service.hpp>
#include <ThreadRecord.hpp>
#include <json/json11.hpp>
#include <json11.hpp>

namespace sys
{

M module-services/service-desktop/endpoints/restore/RestoreEndpoint.cpp => module-services/service-desktop/endpoints/restore/RestoreEndpoint.cpp +0 -2
@@ 10,8 10,6 @@
#include <service-desktop/ServiceDesktop.hpp>
#include <service-desktop/endpoints/backup/BackupRestore.hpp>

#include <json/json11.hpp>

#include <memory>

using namespace parserFSM;

M module-services/service-desktop/endpoints/security/SecurityEndpoint.cpp => module-services/service-desktop/endpoints/security/SecurityEndpoint.cpp +16 -61
@@ 1,74 1,29 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "SecurityEndpoint.hpp"

#include <endpoints/Context.hpp>
#include <parser/MessageHandler.hpp>
#include <service-desktop/service-desktop/ServiceDesktop.hpp>
#include <service-desktop/DesktopMessages.hpp>
#include <json/json11.hpp>

#include <string>

using namespace parserFSM;

auto SecurityEndpoint::handle(parserFSM::Context &context) -> void
{
    http::Code responseCode;
    switch (context.getMethod()) {
    case http::Method::get:
        responseCode = processStatus(context);
        context.setResponseStatus(responseCode);
        parserFSM::MessageHandler::putToSendQueue(context.createSimpleResponse());
        break;
    case http::Method::put:
        responseCode = processConfiguration(context);
        context.setResponseStatus(responseCode);
        parserFSM::MessageHandler::putToSendQueue(context.createSimpleResponse());
        break;
    case http::Method::post:
        processHandshake(context);
        break;
    default:
        responseCode = http::Code::BadRequest;
        context.setResponseStatus(responseCode);
        parserFSM::MessageHandler::putToSendQueue(context.createSimpleResponse());
        break;
    }
}
    auto [sent, response] = helper->process(context.getMethod(), context);

auto SecurityEndpoint::processHandshake(Context &context) -> http::Code
{
    auto body = context.getBody();
    if (!body[json::usb::id].is_string()) {
        return http::Code::BadRequest;
    if (sent == sent::delayed) {
        LOG_DEBUG("There is no proper delayed serving mechanism - depend on invisible context caching");
    }

    auto msg = std::make_shared<sdesktop::usb::USBHandshake>(body[json::usb::id].string_value(),
                                                             body[json::usb::passcode].int_value());
    return toCode(ownerServicePtr->bus.sendUnicast(msg, service::name::service_desktop));
}

auto SecurityEndpoint::processStatus(Context &context) -> http::Code
{
    auto desktopService = dynamic_cast<ServiceDesktop *>(ownerServicePtr);
    auto security       = desktopService->getSecurity()->getEndpointSecurity();
    return security == EndpointSecurity::Allow ? http::Code::OK : http::Code::Forbidden;
}

auto SecurityEndpoint::processConfiguration(Context &context) -> http::Code
{
    auto body = context.getBody();

    std::shared_ptr<sys::DataMessage> msg;

    if (body[json::usb::status].string_value() == json::usb::on) {
        msg = std::make_shared<sdesktop::usb::USBSecurityOn>();
    if (sent == sent::no) {
        if (not response) {
            LOG_ERROR("Response not sent & response not created : respond with error");
            context.setResponseStatus(http::Code::NotAcceptable);
        }
        else {
            context.setResponse(response.value());
        }

        MessageHandler::putToSendQueue(context.createSimpleResponse());
    }
    if (body[json::usb::status].string_value() == json::usb::off) {
        msg = std::make_shared<sdesktop::usb::USBSecurityOff>();
    if (sent == sent::yes and response) {
        LOG_ERROR("Response set when we already handled response in handler");
    }

    return toCode(ownerServicePtr->bus.sendUnicast(std::move(msg), service::name::service_desktop));
}

M module-services/service-desktop/endpoints/security/SecurityEndpoint.hpp => module-services/service-desktop/endpoints/security/SecurityEndpoint.hpp +12 -10
@@ 3,11 3,8 @@

#pragma once

#include <Service/Service.hpp>
#include <endpoints/Endpoint.hpp>
#include <parser/ParserUtils.hpp>

#include <string>
#include "SecurityEndpointHelper.hpp"

namespace parserFSM
{


@@ 19,17 16,22 @@ namespace sys
    class Service;
} // namespace sys

enum class EndpointSecurity
{
    Allow,
    Block
};

class SecurityEndpoint : public parserFSM::Endpoint
{
    const std::unique_ptr<parserFSM::SecurityEndpointHelper> helper;

  public:
    explicit SecurityEndpoint(sys::Service *ownerServicePtr) : Endpoint(ownerServicePtr)
    explicit SecurityEndpoint(sys::Service *ownerServicePtr)
        : Endpoint(ownerServicePtr), helper(std::make_unique<parserFSM::SecurityEndpointHelper>(ownerServicePtr))
    {
        debugName = "SecurityEndpoint";
    }
    auto handle(parserFSM::Context &context) -> void override;

  private:
    auto processHandshake(parserFSM::Context &context) -> parserFSM::http::Code;
    auto processConfiguration(parserFSM::Context &context) -> parserFSM::http::Code;
    auto processStatus(parserFSM::Context &context) -> parserFSM::http::Code;
    auto handle(parserFSM::Context &context) -> void override;
};

A module-services/service-desktop/endpoints/security/SecurityEndpointHelper.cpp => module-services/service-desktop/endpoints/security/SecurityEndpointHelper.cpp +84 -0
@@ 0,0 1,84 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "SecurityEndpointHelper.hpp"
#include <parser/ParserUtils.hpp>
#include <service-appmgr/model/ApplicationManager.hpp>
#include <service-appmgr/messages/PreventBlockingRequest.hpp>
#include <service-desktop/service-desktop/ServiceDesktop.hpp>
#include <module-apps/locks/data/PhoneLockMessages.hpp>
#include <json11.hpp>

namespace parserFSM
{
    class Context;
} // namespace parserFSM

using namespace parserFSM;

auto SecurityEndpointHelper::preventBlockingDevice() -> bool
{
    auto desktopService = dynamic_cast<ServiceDesktop *>(owner);
    auto msg            = std::make_shared<app::manager::PreventBlockingRequest>(desktopService->GetName());
    return desktopService->bus.sendUnicast(std::move(msg), "ApplicationManager");
}

auto SecurityEndpointHelper::processPut(Context &context) -> ProcessResult
{
    auto code = processConfiguration(context);
    return {sent::no, endpoint::ResponseContext{.status = code}};
}

auto SecurityEndpointHelper::processGet(Context &context) -> ProcessResult
{
    auto code = processStatus(context);
    return {sent::no, endpoint::ResponseContext{.status = code}};
}

auto SecurityEndpointHelper::processStatus(Context &context) -> http::Code
{
    auto desktopService = dynamic_cast<ServiceDesktop *>(owner);
    auto security       = desktopService->getSecurity()->getEndpointSecurity();

    if (security == EndpointSecurity::Allow) {
        preventBlockingDevice();
    }

    return security == EndpointSecurity::Allow ? http::Code::OK : http::Code::Forbidden;
}

auto SecurityEndpointHelper::passCodeArrayToVecOfInts(const json11::Json::array &passCode) -> std::vector<unsigned int>
{
    std::vector<unsigned int> passCodeAsInts(0, 0);

    for (const auto &value : passCode) {
        if (value.is_number()) {
            auto v = value.number_value();
            passCodeAsInts.push_back(v);
        }
        else {
            throw std::invalid_argument("value not a digit");
        }
    }

    return passCodeAsInts;
}

auto SecurityEndpointHelper::processConfiguration(Context &context) -> http::Code
{
    auto body     = context.getBody();
    auto passCode = body[json::usb::phoneLockCode].array_items();
    http::Code status{http::Code::BadRequest};

    if (passCode.size() == PasscodeLength) {
        try {
            auto msg = std::make_shared<locks::ExternalUnLockPhone>(passCodeArrayToVecOfInts(passCode));
            status   = toCode(owner->bus.sendUnicast(std::move(msg), app::manager::ApplicationManager::ServiceName));
        }
        catch (const std::exception &e) {
            LOG_ERROR("Passcode decoding exception: %s", e.what());
        }
    }

    return status;
}

A module-services/service-desktop/endpoints/security/SecurityEndpointHelper.hpp => module-services/service-desktop/endpoints/security/SecurityEndpointHelper.hpp +37 -0
@@ 0,0 1,37 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <endpoints/Context.hpp>

#include <Service/Common.hpp>
#include <Service/Service.hpp>
#include <endpoints/BaseHelper.hpp>

namespace sys
{
    class Service;
} // namespace sys

namespace parserFSM
{
    class SecurityEndpointHelper : public BaseHelper
    {
      public:
        explicit SecurityEndpointHelper(sys::Service *p) : BaseHelper(p)
        {}

        static constexpr auto PasscodeLength = 4;

      private:
        auto preventBlockingDevice() -> bool;
        auto processPut(Context &context) -> ProcessResult final;
        auto processGet(Context &context) -> ProcessResult final;

        auto processStatus(Context &context) -> http::Code;
        auto processConfiguration(Context &context) -> http::Code;

        auto passCodeArrayToVecOfInts(const json11::Json::array &passCode) -> std::vector<unsigned int>;
    };
} // namespace parserFSM

M module-services/service-desktop/endpoints/update/UpdateEndpoint.cpp => module-services/service-desktop/endpoints/update/UpdateEndpoint.cpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "UpdateEndpoint.hpp"


@@ 9,7 9,7 @@
#include <endpoints/Context.hpp>
#include <endpoints/messages/MessageHelper.hpp>

#include <json/json11.hpp>
#include <json11.hpp>
#include <purefs/filesystem_paths.hpp>

#include <filesystem>

M module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp => module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp +1 -1
@@ 6,7 6,7 @@
#include <service-desktop/DesktopMessages.hpp>
#include <SystemManager/SystemManager.hpp>
#include <crc32.h>
#include <json/json11.hpp>
#include <json11.hpp>
#include <log/log.hpp>
#include <application-desktop/Constants.hpp>
#include <service-db/service-db/Settings.hpp>

M module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp => module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp +1 -1
@@ 3,7 3,7 @@

#pragma once

#include <json/json11.hpp>
#include <json11.hpp>
#include <microtar.hpp>
#include <boot/bootconfig.hpp>
#include <purefs/filesystem_paths.hpp>

M module-services/service-desktop/parser/HttpEnums.cpp => module-services/service-desktop/parser/HttpEnums.cpp +1 -1
@@ 3,7 3,7 @@

#include "HttpEnums.hpp"

#include <log/log.hpp>
#include <log.hpp>

using namespace parserFSM;


M module-services/service-desktop/parser/MessageHandler.cpp => module-services/service-desktop/parser/MessageHandler.cpp +1 -1
@@ 7,7 7,7 @@
#include <endpoints/EndpointFactory.hpp>

#include <FreeRTOS.h>
#include <log/log.hpp>
#include <log.hpp>

#include <bits/exception.h>
#include <memory>

M module-services/service-desktop/parser/MessageHandler.hpp => module-services/service-desktop/parser/MessageHandler.hpp +3 -3
@@ 1,11 1,11 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <Service/Service.hpp>
#include <json/json11.hpp>
#include <log/log.hpp>
#include <json11.hpp>
#include <log.hpp>

#include <string>


M module-services/service-desktop/parser/ParserFSM.cpp => module-services/service-desktop/parser/ParserFSM.cpp +2 -3
@@ 1,4 1,4 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "MessageHandler.hpp"


@@ 10,8 10,7 @@ namespace sys
} // namespace sys

#include <service-desktop/ServiceDesktop.hpp>
#include <log/log.hpp>
#include <json/json11.hpp>
#include <log.hpp>
#include <memory>
#include <string>


M module-services/service-desktop/parser/ParserFSM.hpp => module-services/service-desktop/parser/ParserFSM.hpp +1 -1
@@ 6,7 6,7 @@
#include "MessageHandler.hpp"
#include "ParserUtils.hpp"

#include <json/json11.hpp>
#include <json11.hpp>

#include <string>


M module-services/service-desktop/parser/ParserUtils.hpp => module-services/service-desktop/parser/ParserUtils.hpp +2 -7
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include <log/log.hpp>      // for LOG_ERROR
#include <log.hpp>          // for LOG_ERROR
#include <bits/exception.h> // for exception
#include <cstddef>          // for size_t
#include <string>           // for string, allocator, basic_string, stol


@@ 171,16 171,11 @@ namespace parserFSM

        namespace usb
        {
            inline constexpr auto passcode = "passcode";
            inline constexpr auto id       = "uniqueId";
            inline constexpr auto config   = "config";
            inline constexpr auto status   = "usbSecurityStatus";
            inline constexpr auto on       = "on";
            inline constexpr auto off      = "off";
            inline constexpr auto locked   = "locked";
            inline constexpr auto unlocked = "unlocked";
            inline constexpr auto security = "usbSecurity";

            inline constexpr auto phoneLockCode = "phoneLockCode";
        } // namespace usb

    } // namespace json

M module-services/service-desktop/service-desktop/DesktopMessages.hpp => module-services/service-desktop/service-desktop/DesktopMessages.hpp +0 -41
@@ 101,46 101,6 @@ namespace sdesktop
            USBDisconnected() : sys::DataMessage(MessageType::USBDisconnected)
            {}
            ~USBDisconnected() override = default;
        };

        class USBSecurityOn : public sys::DataMessage
        {
          public:
            USBSecurityOn() : sys::DataMessage(MessageType::USBSecurityOn)
            {}
            ~USBSecurityOn() override = default;
        };

        class USBSecurityOff : public sys::DataMessage
        {
          public:
            USBSecurityOff() : sys::DataMessage(MessageType::USBSecurityOff)
            {}
            ~USBSecurityOff() override = default;
        };

        class USBHandshake : public sys::DataMessage
        {
          public:
            USBHandshake() : sys::DataMessage(MessageType::USBHandshake)
            {}
            USBHandshake(const std::string &id, unsigned int passcode)
                : sys::DataMessage(MessageType::USBHandshake), id(id), passcode(passcode)
            {}
            ~USBHandshake() override = default;

            auto getId() const -> std::string
            {
                return id;
            }
            auto getPasscode() const
            {
                return passcode;
            }

          private:
            const std::string id;
            const unsigned int passcode = 0;
        }; // namespace usb

    } // namespace usb


@@ 179,7 139,6 @@ namespace sdesktop
        };
    } // namespace developerMode


    namespace transfer
    {
        class TransferTimerState : public sys::DataMessage

M module-services/service-desktop/service-desktop/ServiceDesktop.hpp => module-services/service-desktop/service-desktop/ServiceDesktop.hpp +0 -3
@@ 110,9 110,6 @@ class ServiceDesktop : public sys::Service
    }

  private:
    void processUSBHandshake(sdesktop::usb::USBHandshake *msg);

  private:
    std::unique_ptr<sdesktop::USBSecurityModel> usbSecurityModel;
    std::unique_ptr<settings::Settings> settings;
    sys::TimerHandle transferTimer;

M module-services/service-desktop/service-desktop/USBSecurityModel.hpp => module-services/service-desktop/service-desktop/USBSecurityModel.hpp +11 -22
@@ 17,40 17,29 @@ namespace sys

namespace sdesktop
{
    namespace usb
    {
        class USBHandshake;
    };

    using DeviceID = std::string;
    using Passcode = unsigned int;

    class USBSecurityModel
    {
      public:
        enum PhoneLockState : bool
        {
            Unlocked = false,
            Locked
        };
        explicit USBSecurityModel(sys::Service *ownerSrv, settings::Settings *srvSettings);

        auto isBound(DeviceID id) const -> bool;
        auto addDevice(DeviceID id, Passcode passcode) -> bool;
        bool checkPasscode(const Passcode &passcode);
        auto isPasscodeEnabled() const -> bool;

        auto isSecurityEnabled() const -> bool;
        void enableEndpointSecurity(bool securityEnabled);
        auto setPhoneLocked() -> void;
        auto setPhoneUnlocked() -> void;

        bool processHandshake(const sdesktop::usb::USBHandshake *handshake);
        auto isPhoneLocked() const -> bool;

        void setEndpointSecurity(EndpointSecurity security);
        auto isSecurityEnabled() const -> bool;

        auto getEndpointSecurity() const -> EndpointSecurity;

      private:
        std::set<DeviceID> parseDevices(const std::string &value) const;
        std::string dumpDevices(const std::set<DeviceID> &devices) const;

      private:
        unsigned int lockPassHash = 0;
        EndpointSecurity endpointSecurity;
        std::set<DeviceID> bound;
        PhoneLockState phoneLocked;
        settings::Settings *settings;
    };
}; // namespace sdesktop

M module-services/service-desktop/tests/test-contacts.cpp => module-services/service-desktop/tests/test-contacts.cpp +1 -1
@@ 5,7 5,7 @@
#include <endpoints/EndpointFactory.hpp>

#include <catch2/catch.hpp>
#include <json/json11.hpp>
#include <json11.hpp>
#include <purefs/filesystem_paths.hpp>
#include <utf8/UTF8.hpp>


M module-services/service-desktop/tests/unittest.cpp => module-services/service-desktop/tests/unittest.cpp +1 -1
@@ 16,7 16,7 @@
#include <SMSRecord.hpp>
#include <SMSTemplateRecord.hpp>
#include <catch2/catch.hpp>
#include <json/json11.hpp>
#include <json11.hpp>
#include <purefs/filesystem_paths.hpp>
#include <utf8/UTF8.hpp>
#include <memory>

M module-services/service-eink/ServiceEink.cpp => module-services/service-eink/ServiceEink.cpp +1 -1
@@ 9,7 9,7 @@
#include <time/ScopedTime.hpp>
#include <Timers/TimerFactory.hpp>

#include <log/log.hpp>
#include <log.hpp>
#include <messages/EinkMessage.hpp>
#include <messages/ImageMessage.hpp>
#include <SystemManager/messages/DeviceRegistrationMessage.hpp>

M module-services/service-evtmgr/CMakeLists.txt => module-services/service-evtmgr/CMakeLists.txt +1 -0
@@ 35,6 35,7 @@ target_link_libraries(${PROJECT_NAME}
        service-desktop
        sml::sml
        Microsoft.GSL::GSL
        eventstore
)

if (${ENABLE_TESTS})

M module-services/service-evtmgr/EventManager.cpp => module-services/service-evtmgr/EventManager.cpp +3 -4
@@ 25,9 25,8 @@
#include <bsp/torch/torch.hpp>
#include <bsp/battery-charger/battery_charger.hpp>
#include <common_data/RawKey.hpp>
#include <log/log.hpp>
#include <log/Logger.hpp>
#include <module-utils/time/time_conversion.hpp>
#include <log.hpp>
#include <Logger.hpp>
#include <service-appmgr/Controller.hpp>
#include <service-audio/AudioMessage.hpp>
#include <service-audio/AudioServiceAPI.hpp>


@@ 44,7 43,7 @@
#include <ctime>
#include <module-apps/messages/AppMessage.hpp>
#include <SystemManager/messages/CpuFrequencyMessage.hpp>
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>
#include <SystemManager/messages/PhoneModeRequest.hpp>
#include <vibra/Vibra.hpp>


M module-services/service-evtmgr/WorkerEvent.cpp => module-services/service-evtmgr/WorkerEvent.cpp +3 -1
@@ 21,9 21,11 @@
#include <bsp/light_sensor/light_sensor.hpp>
#include <bsp/vibrator/vibrator.hpp>
#include <bsp/eink_frontlight/eink_frontlight.hpp>
#include <EventStore.hpp>

#include <common_data/RawKey.hpp>
#include <headset.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <service-audio/AudioMessage.hpp>
#include <service-desktop/Constants.hpp>
#include <service-desktop/DesktopMessages.hpp>

M module-services/service-evtmgr/backlight-handler/BacklightHandler.cpp => module-services/service-evtmgr/backlight-handler/BacklightHandler.cpp +2 -2
@@ 28,7 28,7 @@ namespace backlight
          screenLightTimer{sys::TimerFactory::createSingleShotTimer(
              parent, timers::screenLightTimerName, timers::keypadLightTimerTimeout, [this](sys::Timer &t) {
                  if (getScreenLightState() &&
                      getScreenAutoModeState() == screen_light_control::ScreenLightMode::Manual &&
                      getScreenAutoModeState() == screen_light_control::ScreenLightMode::Automatic &&
                      screenLightControl->isLightOn()) {
                      screenLightControl->processRequest(screen_light_control::Action::turnOff);
                  }


@@ 190,7 190,7 @@ namespace backlight

    void Handler::handleScreenLightRefresh()
    {
        if (getScreenLightState() && getScreenAutoModeState() == screen_light_control::ScreenLightMode::Manual) {
        if (getScreenLightState() && getScreenAutoModeState() == screen_light_control::ScreenLightMode::Automatic) {
            if (!screenLightControl->isLightOn()) {
                screenLightControl->processRequest(screen_light_control::Action::turnOn);
            }

M module-services/service-evtmgr/battery-level-check/BatteryLevelCheck.cpp => module-services/service-evtmgr/battery-level-check/BatteryLevelCheck.cpp +1 -1
@@ 5,7 5,7 @@
#include "service-evtmgr/BatteryMessages.hpp"
#include "SystemManager/Constants.hpp"
#include <agents/settings/SystemSettings.hpp>
#include <common_data/EventStore.hpp>
#include <EventStore.hpp>
#include <Utils.hpp>

#define BOOST_SML_CFG_DISABLE_MIN_SIZE // GCC10 fix

M module-services/service-evtmgr/vibra/Vibra.cpp => module-services/service-evtmgr/vibra/Vibra.cpp +0 -2
@@ 5,8 5,6 @@
#include "SystemManager/Constants.hpp"
#include <module-sys/Timers/TimerFactory.hpp>

#include <common_data/EventStore.hpp>

namespace vibra_handle
{
    Vibra::Vibra(sys::Service *parent) : parent{parent}

M module-services/service-fileindexer/CMakeLists.txt => module-services/service-fileindexer/CMakeLists.txt +11 -3
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

project(service-fileindexer VERSION 1.0
	DESCRIPTION "File indexer service ")



@@ 23,4 21,14 @@ target_sources( ${PROJECT_NAME}
)


target_link_libraries(${PROJECT_NAME} module-bsp module-os module-utils module-vfs module-sys tag )
target_link_libraries(${PROJECT_NAME} 
	PUBLIC
		module-bsp 
		module-os 
		module-utils 
		module-vfs 
		module-sys 
		tag
	PRIVATE
		utf8
)

M module-services/service-fileindexer/notesIndexer.cpp => module-services/service-fileindexer/notesIndexer.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <log/log.hpp>
#include <log.hpp>
#include "notesIndexer.hpp"
#include <cwctype>
#include <cstdio>

M module-services/service-fota/FotaServiceAPI.cpp => module-services/service-fota/FotaServiceAPI.cpp +1 -1
@@ 6,7 6,7 @@
#include "service-fota/ServiceFota.hpp"

#include <MessageType.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <memory>
#include <sstream>

M module-services/service-fota/ServiceFota.cpp => module-services/service-fota/ServiceFota.cpp +11 -15
@@ 12,7 12,7 @@
#include <Service/Message.hpp>
#include <Service/Service.hpp>
#include <Timers/TimerFactory.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <at/Result.hpp>
#include <at/UrcFactory.hpp>
#include <portmacro.h>


@@ 81,7 81,8 @@ namespace FotaService
        using std::placeholders::_1;
        connect(CellularGetChannelResponseMessage(),
                std::bind(&Service::handleCellularGetChannelResponseMessage, this, _1));
        connect(cellular::StateChange(), std::bind(&Service::handleServiceCellularNotifications, this, _1));
        connect(typeid(cellular::msg::notification::SimReady),
                std::bind(&Service::handleSimReadyNotification, this, _1));
        connect(ConfigureAPNMessage(), std::bind(&Service::handleConfigureAPN, this, _1));
        connect(ConnectMessage(), std::bind(&Service::handleConnect, this, _1));
        connect(HTTPRequestMessage(), std::bind(&Service::handleHttpGet, this, _1));


@@ 102,20 103,15 @@ namespace FotaService
        return sys::MessageNone{};
    }

    sys::MessagePointer Service::handleServiceCellularNotifications(sys::Message *req)
    sys::MessagePointer Service::handleSimReadyNotification(sys::Message *)
    {
        if (auto msg = dynamic_cast<cellular::StateChange *>(req)) {
            LOG_DEBUG("cellular::StageChange: %s", cellular::service::State::c_str(msg->request));
            if (msg->request == cellular::service::State::ST::Ready) {
                LOG_DEBUG("Modem is \"Ready\"");
                if (dataChannel == nullptr) {
                    LOG_DEBUG("Requesting channel");
                    CellularServiceAPI::GetDataChannel(this);
                }
                else {
                    LOG_DEBUG("Channel already present: %p", dataChannel);
                }
            }
        LOG_DEBUG("Modem is \"Ready\"");
        if (dataChannel == nullptr) {
            LOG_DEBUG("Requesting channel");
            CellularServiceAPI::GetDataChannel(this);
        }
        else {
            LOG_DEBUG("Channel already present: %p", dataChannel);
        }
        return std::make_shared<sys::ResponseMessage>();
    }

M module-services/service-fota/service-fota/ServiceFota.hpp => module-services/service-fota/service-fota/ServiceFota.hpp +1 -1
@@ 71,7 71,7 @@ namespace FotaService
        sys::MessagePointer handleCellularGetChannelResponseMessage(sys::Message *req);
        /** Do nothing until celular finishes it's startup
         */
        sys::MessagePointer handleServiceCellularNotifications(sys::Message *req);
        sys::MessagePointer handleSimReadyNotification(sys::Message *req);
        sys::MessagePointer handleConfigureAPN(sys::Message *req);
        sys::MessagePointer handleConnect(sys::Message *req);
        sys::MessagePointer handleHttpGet(sys::Message *req);

M module-services/service-gui/ServiceGUI.cpp => module-services/service-gui/ServiceGUI.cpp +1 -1
@@ 12,7 12,7 @@
#include <DrawCommand.hpp>
#include <FontManager.hpp>
#include <gui/core/ImageManager.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <service-eink/Common.hpp>
#include <service-eink/messages/ImageMessage.hpp>
#include <service-eink/messages/EinkMessage.hpp>

M module-services/service-gui/WorkerGUI.cpp => module-services/service-gui/WorkerGUI.cpp +2 -3
@@ 1,16 1,15 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "WorkerGUI.hpp"

#include <DrawCommand.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <Renderer.hpp>
#include <Service/Worker.hpp>
#include <service-gui/ServiceGUI.hpp>

#include <memory>
#include <module-utils/time/ScopedTime.hpp>
#include "messages/RenderingFinished.hpp"

namespace service::gui

M module-services/service-lwip/ServiceLwIP.cpp => module-services/service-lwip/ServiceLwIP.cpp +1 -1
@@ 6,7 6,7 @@
#include <MessageType.hpp>
#include <Service/Message.hpp>
#include <Service/Service.hpp>
#include <log/log.hpp>
#include <log.hpp>

extern "C"
{

M module-services/service-time/ServiceTime.cpp => module-services/service-time/ServiceTime.cpp +1 -1
@@ 9,7 9,7 @@
#include <BaseInterface.hpp>
#include <Common/Query.hpp>
#include <MessageType.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <module-db/queries/calendar/QueryEventsSelectFirstUpcoming.hpp>
#include <service-db/DBNotificationMessage.hpp>
#include <service-db/QueryMessage.hpp>

M module-services/service-time/TimezoneHandler.cpp => module-services/service-time/TimezoneHandler.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "service-time/TimezoneHandler.hpp"
#include <module-utils/time/time_conversion.hpp>
#include <time/time_conversion.hpp>
#include <iomanip>

auto TimezoneHandler::getTimezone() -> std::string const

M module-services/service-time/tests/CMakeLists.txt => module-services/service-time/tests/CMakeLists.txt +0 -2
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

add_catch2_executable(
        NAME
        timezone-handler

M module-sys/CMakeLists.txt => module-sys/CMakeLists.txt +2 -3
@@ 1,6 1,4 @@
cmake_minimum_required(VERSION 3.14)

project(module-sys VERSION 1.0
project(module-sys VERSION 1.0
        DESCRIPTION "Core module library")

module_is_test_entity()


@@ 60,6 58,7 @@ target_link_libraries(module-sys
        service-evtmgr
        messagetype
        magic_enum
        eventstore
    PUBLIC
        module-os
    )

M module-sys/Service/Service.cpp => module-sys/Service/Service.cpp +1 -1
@@ 11,7 11,7 @@
#include "module-sys/Timers/TimerHandle.hpp"  // for Timer
#include "module-sys/Timers/TimerMessage.hpp" // for TimerMessage
#include "log/debug.hpp"       // for DEBUG_SERVICE_MESSAGES
#include "log/log.hpp"         // for LOG_ERROR, LOG_DEBUG, LOG_FATAL
#include <log.hpp>             // for LOG_ERROR, LOG_DEBUG, LOG_FATAL
#include "mutex.hpp"           // for cpp_freertos
#include "portmacro.h"         // for UBaseType_t
#include "thread.hpp"          // for Thread

M module-sys/SystemManager/CpuGovernor.cpp => module-sys/SystemManager/CpuGovernor.cpp +1 -1
@@ 3,7 3,7 @@

#include "CpuGovernor.hpp"
#include <algorithm>
#include <log/log.hpp>
#include <log.hpp>

namespace sys
{

M module-sys/SystemManager/CpuStatistics.cpp => module-sys/SystemManager/CpuStatistics.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "CpuStatistics.hpp"
#include <log/log.hpp>
#include <log.hpp>
#include <FreeRTOS.h>
#include <task.h>
#include <limits>

M module-sys/SystemManager/DeviceManager.cpp => module-sys/SystemManager/DeviceManager.cpp +1 -1
@@ 3,7 3,7 @@

#include "DeviceManager.hpp"
#include <algorithm>
#include <log/log.hpp>
#include <log.hpp>

namespace sys
{

M module-sys/SystemManager/PowerManager.cpp => module-sys/SystemManager/PowerManager.cpp +1 -1
@@ 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 <log/log.hpp>
#include <log.hpp>

#include "PowerManager.hpp"


M module-sys/SystemManager/SystemManager.cpp => module-sys/SystemManager/SystemManager.cpp +1 -1
@@ 6,7 6,7 @@
#include "DependencyGraph.hpp"
#include "graph/TopologicalSort.hpp"

#include <common_data/EventStore.hpp>
#include <EventStore.hpp>
#include "thread.hpp"
#include "ticks.hpp"
#include "critical.hpp"

M module-sys/SystemWatchdog/SystemWatchdog.cpp => module-sys/SystemWatchdog/SystemWatchdog.cpp +1 -1
@@ 6,7 6,7 @@
#include "critical.hpp"
#include "ticks.hpp"
#include "bsp/watchdog/watchdog.hpp"
#include "log/log.hpp"
#include <log.hpp>

namespace sys
{

M module-sys/Timers/SystemTimer.cpp => module-sys/Timers/SystemTimer.cpp +1 -1
@@ 4,7 4,7 @@
#include "SystemTimer.hpp"
#include "module-sys/Service/Service.hpp"
#include "TimerMessage.hpp"
#include <log/log.hpp>
#include <log.hpp>
#include <projdefs.h>
#include <memory>


M module-utils/CMakeLists.txt => module-utils/CMakeLists.txt +19 -38
@@ 1,11 1,4 @@
cmake_minimum_required(VERSION 3.12)

if(NOT WIN32)
    include(Colours)
endif()

project(module-utils VERSION 1.0
       DESCRIPTION "Library for processing utf8 strings.")
project(module-utils VERSION 1.0)

if(${CMAKE_VERSION} VERSION_LESS 3.12)
    cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})


@@ 13,64 6,46 @@ endif()

module_is_test_entity()

if(${PROJECT_TARGET} STREQUAL "TARGET_Linux")
	include(targets/Target_Linux.cmake)
else()
	include(targets/Target_Cross.cmake)
endif()
add_subdirectory(Clipboard)
add_subdirectory(EventStore)

set (SOURCES
        ${CMAKE_CURRENT_SOURCE_DIR}/i18n/i18n.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/json/json11.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/utf8/UTF8.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/time/time_conversion.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/common_data/EventStore.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/common_data/Clipboard.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/ucs2/UCS2.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/time/time_date_validation.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/PhoneNumber.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/PhoneNumber.hpp
        ${CMAKE_CURRENT_SOURCE_DIR}/NumberHolderMatcher.hpp
        ${CMAKE_CURRENT_SOURCE_DIR}/country.hpp
        ${CMAKE_CURRENT_SOURCE_DIR}/state/ServiceState.hpp
        ${CMAKE_CURRENT_SOURCE_DIR}/ical/ParserICS.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/time/TimeRangeParser.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/time/DateAndTimeSettings.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/Utils.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/log/Logger.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/log/log.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/log/LoggerBuffer.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/circular_buffer/StringCircularBuffer.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/generators/RandomStringGenerator.cpp
)

add_library(${PROJECT_NAME} STATIC ${SOURCES} ${BOARD_SOURCES})
add_library(${PROJECT_NAME} STATIC ${SOURCES})

include(segger/rtt/CMakeLists.txt)

# add third party libs
include(third-party/libphonenumber.cmake)

# link against libphonenumber
target_link_libraries (${PROJECT_NAME} PUBLIC ${LIBPHONENUMBER_TARGET})

target_link_libraries(${PROJECT_NAME} PRIVATE crc32 )

# link against tinyexpr
target_link_libraries (${PROJECT_NAME} PUBLIC ${TINYEXPR_TARGET})

target_link_libraries(${PROJECT_NAME} 
target_link_libraries(${PROJECT_NAME}
PUBLIC 
    board
    log
    magic_enum
    module-os 
    module-vfs
    magic_enum
    ${LIBPHONENUMBER_TARGET}
PRIVATE
    json::json
    crc32
    time
)

# Board specific compilation definitions,options,include directories and features
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_CONFIG_DEFINITIONS})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_TARGET})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${TARGET_COMPILE_DEFINITIONS})
target_include_directories(${PROJECT_NAME} PUBLIC ${BOARD_DIR_INCLUDES} )
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_INCLUDES})
target_compile_features(${PROJECT_NAME} PUBLIC ${TARGET_COMPILE_FEATURES})
target_compile_options(${PROJECT_NAME} PUBLIC ${TARGET_COMPILE_OPTIONS})


@@ 90,4 65,10 @@ if (${ENABLE_TESTS})
    add_subdirectory( test )
endif()

add_subdirectory(board)
add_subdirectory(bootconfig)
add_subdirectory(log)
add_subdirectory(time)
add_subdirectory(ucs2)
add_subdirectory(utf8)


A module-utils/Clipboard/CMakeLists.txt => module-utils/Clipboard/CMakeLists.txt +20 -0
@@ 0,0 1,20 @@
add_library(clipboard STATIC)
target_sources(clipboard
   PRIVATE
      ${CMAKE_CURRENT_SOURCE_DIR}/Clipboard.hpp
      ${CMAKE_CURRENT_SOURCE_DIR}/Clipboard.cpp
)

target_include_directories(clipboard
   PUBLIC
     $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

target_link_libraries(clipboard
   PUBLIC
       module-os
)

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

R module-utils/common_data/Clipboard.cpp => module-utils/Clipboard/Clipboard.cpp +0 -0
R module-utils/common_data/Clipboard.hpp => module-utils/Clipboard/Clipboard.hpp +0 -0
A module-utils/Clipboard/test/CMakeLists.txt => module-utils/Clipboard/test/CMakeLists.txt +9 -0
@@ 0,0 1,9 @@
# Clipboard tests
add_catch2_executable(
    NAME
        utils-clipboard
    SRCS
        unittest_clipboard.cpp
    LIBS
        clipboard
)

R module-utils/test/unittest_clipboard.cpp => module-utils/Clipboard/test/unittest_clipboard.cpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <cstring>


@@ 10,7 10,7 @@

#include <catch2/catch.hpp>

#include "common_data/Clipboard.hpp"
#include <Clipboard.hpp>

TEST_CASE("Clipboard")
{

A module-utils/EventStore/CMakeLists.txt => module-utils/EventStore/CMakeLists.txt +17 -0
@@ 0,0 1,17 @@
add_library(eventstore STATIC)
target_sources(eventstore
   PRIVATE
      ${CMAKE_CURRENT_SOURCE_DIR}/EventStore.hpp
      ${CMAKE_CURRENT_SOURCE_DIR}/EventStore.cpp
)

target_include_directories(eventstore
   PUBLIC
      $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

target_link_libraries(eventstore
   PRIVATE
      module-os
)


R module-utils/common_data/EventStore.cpp => module-utils/EventStore/EventStore.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "EventStore.hpp"
#include <log/log.hpp>
#include <log.hpp>
#include <memory>
#include <mutex.hpp>


R module-utils/common_data/EventStore.hpp => module-utils/EventStore/EventStore.hpp +0 -0
M module-utils/PhoneNumber.cpp => module-utils/PhoneNumber.cpp +1 -1
@@ 4,7 4,7 @@
#include "PhoneNumber.hpp"

#include "country.hpp"
#include "log/log.hpp"
#include <log.hpp>

#include <phonenumbers/phonenumberutil.h>
#include <phonenumbers/asyoutypeformatter.h>

M module-utils/PhoneNumber.hpp => module-utils/PhoneNumber.hpp +2 -2
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 8,7 8,7 @@
#include <phonenumbers/phonenumberutil.h>

#include <exception>
#include <module-utils/utf8/UTF8.hpp>
#include <utf8/UTF8.hpp>

namespace utils
{

M module-utils/Utils.hpp => module-utils/Utils.hpp +1 -1
@@ 4,7 4,7 @@
#pragma once
#include "Split.hpp"
#include <i18n/i18n.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <magic_enum.hpp>


A module-utils/board/CMakeLists.txt => module-utils/board/CMakeLists.txt +29 -0
@@ 0,0 1,29 @@
add_library(board STATIC)

if(${PROJECT_TARGET} STREQUAL "TARGET_Linux")
    target_sources(board
    PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/linux/log_linux.cpp)

elseif(${PROJECT_TARGET} STREQUAL "TARGET_RT1051")
    target_sources(board
    PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/cross/log_rt1051.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/cross/time_syscalls.cpp)

    if (${LOG_REDIRECT} STREQUAL "RTT_JLINK")
        target_sources(board
        PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/cross/log_writeRTT.cpp)
    elseif (${LOG_REDIRECT} STREQUAL "RTT_LUART")
        target_sources(board
        PRIVATE    
        ${CMAKE_CURRENT_SOURCE_DIR}/cross/log_writeLUART.cpp)
    elseif ((${LOG_REDIRECT} STREQUAL "RTT_SYSTEMVIEW") AND (${SYSTEM_VIEW_ENABLED} EQUAL 1))
        target_sources(board
        PRIVATE
            ${CMAKE_CURRENT_SOURCE_DIR}/cross/log_writeSYSTEMVIEW.cpp)
    endif ()
endif()

target_link_libraries(board PUBLIC module-bsp)
\ No newline at end of file

M module-utils/board/cross/log_rt1051.cpp => module-utils/board/cross/log_rt1051.cpp +2 -2
@@ 4,8 4,8 @@
#include <board.h>
#include <critical.hpp>
#include <macros.h>
#include "log/log.hpp"
#include "log/Logger.hpp"
#include <log.hpp>
#include <Logger.hpp>
#include "segger/rtt/SEGGER_RTT.h"
#include <ticks.hpp>


M module-utils/board/cross/log_writeLUART.cpp => module-utils/board/cross/log_writeLUART.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "../../log/log.hpp"
#include <log.hpp>
#include "fsl_lpuart.h"

#define LOG_UART_DEV LPUART3

M module-utils/board/cross/log_writeRTT.cpp => module-utils/board/cross/log_writeRTT.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "../../log/log.hpp"
#include <log.hpp>
#include "../../segger/rtt/SEGGER_RTT.h"

#define LOG_RTT_BUFF_INDEX 0

M module-utils/board/cross/log_writeSYSTEMVIEW.cpp => module-utils/board/cross/log_writeSYSTEMVIEW.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "../../log/log.hpp"
#include <log.hpp>
#include "../../segger/systemview/SEGGER/SEGGER_SYSVIEW.h"

void log_WriteToDevice(const uint8_t *pBuffer, unsigned NumBytes)

M module-utils/board/linux/log_linux.cpp => module-utils/board/linux/log_linux.cpp +2 -2
@@ 1,8 1,8 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "log/log.hpp"
#include "log/Logger.hpp"
#include <log.hpp>
#include <Logger.hpp>
#include <iostream>
#include <string_view>
#include <ticks.hpp>

M module-utils/bootconfig/CMakeLists.txt => module-utils/bootconfig/CMakeLists.txt +1 -2
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

project( utils-bootconfig VERSION 1.0
        DESCRIPTION "Library for processing boot config"
)


@@ 22,4 20,5 @@ target_link_libraries( ${PROJECT_NAME}
      module-vfs
      crc32
      Microsoft.GSL::GSL
      json::json
)

M module-utils/bootconfig/include/boot/bootconfig.hpp => module-utils/bootconfig/include/boot/bootconfig.hpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include <module-utils/json/json11.hpp>
#include <json11.hpp>
#include <string>
#include <filesystem>


M module-utils/bootconfig/src/bootconfig.cpp => module-utils/bootconfig/src/bootconfig.cpp +1 -1
@@ 10,7 10,7 @@
#include <time/time_conversion.hpp>
#include <ticks.hpp>
#include <cstdio>
#include <log/log.hpp>
#include <log.hpp>
#include <crc32.h>
#include <array>
#include <Utils.hpp>

M module-utils/i18n/i18n.cpp => module-utils/i18n/i18n.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "i18nImpl.hpp"
#include <log/log.hpp>
#include <log.hpp>
#include <Utils.hpp>
#include <cstdio>
#include <purefs/filesystem_paths.hpp>

M module-utils/i18n/i18nImpl.hpp => module-utils/i18n/i18nImpl.hpp +1 -1
@@ 4,7 4,7 @@
#pragma once

#include <mutex.hpp>
#include <json/json11.hpp>
#include <json11.hpp>
#include "i18n.hpp"

namespace utils

M module-utils/ical/ParserICS.cpp => module-utils/ical/ParserICS.cpp +2 -2
@@ 1,9 1,9 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ParserICS.hpp"
#include <cmath>
#include <module-utils/time/time_date_validation.hpp>
#include <time/time_date_validation.hpp>

namespace ical
{

M module-utils/ical/ParserICS.hpp => module-utils/ical/ParserICS.hpp +2 -2
@@ 1,9 1,9 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
#include <module-apps/application-calendar/data/dateCommon.hpp>
#include "json/json11.hpp"
#include <json11.hpp>
#include <memory>

/**

A module-utils/log/CMakeLists.txt => module-utils/log/CMakeLists.txt +9 -0
@@ 0,0 1,9 @@
add_library(log STATIC)
target_sources(log
   PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/Logger.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/log.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/LoggerBuffer.cpp
)
target_include_directories(log PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(log PRIVATE module-bsp)

M module-utils/log/Logger.cpp => module-utils/log/Logger.cpp +1 -1
@@ 5,7 5,7 @@
#include <fstream>
#include <gsl/util>
#include "LockGuard.hpp"
#include "Logger.hpp"
#include <Logger.hpp>
#include "macros.h"

namespace Log

M module-utils/log/Logger.hpp => module-utils/log/Logger.hpp +1 -1
@@ 5,7 5,7 @@

#include <assert.h>
#include <board.h>
#include "log.hpp"
#include <log.hpp>
#include "LoggerBuffer.hpp"
#include "log_colors.hpp"
#include <map>

M module-utils/log/log.cpp => module-utils/log/log.cpp +2 -2
@@ 1,8 1,8 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "log.hpp"
#include "Logger.hpp"
#include <log.hpp>
#include <Logger.hpp>
#include <ticks.hpp>
#include <macros.h>


D module-utils/targets/Target_Cross.cmake => module-utils/targets/Target_Cross.cmake +0 -27
@@ 1,27 0,0 @@
set(BOARD_SOURCES ${BOARD_SOURCES}

        ${CMAKE_CURRENT_SOURCE_DIR}/board/cross/log_rt1051.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/board/cross/time_syscalls.cpp
        CACHE INTERNAL ""
        )

if (${LOG_REDIRECT} STREQUAL "RTT_JLINK")
    set(BOARD_SOURCES ${BOARD_SOURCES}
            ${CMAKE_CURRENT_SOURCE_DIR}/board/cross/log_writeRTT.cpp
            CACHE INTERNAL ""
            )
elseif (${LOG_REDIRECT} STREQUAL "RTT_LUART")
    set(BOARD_SOURCES ${BOARD_SOURCES}
            ${CMAKE_CURRENT_SOURCE_DIR}/board/cross/log_writeLUART.cpp
            CACHE INTERNAL ""
            )
elseif ((${LOG_REDIRECT} STREQUAL "RTT_SYSTEMVIEW") AND (${SYSTEM_VIEW_ENABLED} EQUAL 1))
    set(BOARD_SOURCES ${BOARD_SOURCES}
            ${CMAKE_CURRENT_SOURCE_DIR}/board/cross/log_writeSYSTEMVIEW.cpp
            CACHE INTERNAL ""
            )
endif ()

set(BOARD_DIR_INCLUDES CACHE INTERNAL "")



D module-utils/targets/Target_Linux.cmake => module-utils/targets/Target_Linux.cmake +0 -7
@@ 1,7 0,0 @@
set(BOARD_SOURCES

        ${CMAKE_CURRENT_SOURCE_DIR}/board/linux/log_linux.cpp

        CACHE INTERNAL "")

set(BOARD_DIR_INCLUDES  CACHE INTERNAL "")

M module-utils/test/CMakeLists.txt => module-utils/test/CMakeLists.txt +1 -48
@@ 1,6 1,4 @@
cmake_minimum_required(VERSION 3.12)

add_catch2_executable(
add_catch2_executable(
    NAME
        utils-conditional-invoke-tests
    SRCS


@@ 20,40 18,6 @@ add_catch2_executable(
        module-utils
)

# Clipboard tests
add_catch2_executable(
    NAME
        utils-clipboard
    SRCS
        unittest_clipboard.cpp
    LIBS
        module-utils
)

# UCS2 tests
add_catch2_executable(
    NAME
        utils-ucs2
    SRCS
        unittest_ucs2.cpp
        ../ucs2/UCS2.cpp
        ../ucs2/UCS2.hpp
    LIBS
        module-utils
)

# UTF8 tests
add_catch2_executable(
    NAME
        utils-utf8
    SRCS
        unittest_utf8.cpp
        ../utf8/UTF8.cpp
        ../utf8/UTF8.hpp
    LIBS
        module-utils
)

# duration tests
add_catch2_executable(
    NAME


@@ 120,17 84,6 @@ add_catch2_executable(
#        module-utils
#)

#  time display tests
add_catch2_executable(
    NAME
        utils-time_display
    SRCS
        unittest_TimeRangeParser.cpp
    LIBS
        module-utils
        module-db
)

#  i18n language change tests
add_catch2_executable(
    NAME

M module-utils/test/test_LoggerBuffer.cpp => module-utils/test/test_LoggerBuffer.cpp +1 -1
@@ 5,7 5,7 @@
#include <catch2/catch.hpp>

#include "generators/RandomStringGenerator.hpp"
#include "log/LoggerBuffer.hpp"
#include "LoggerBuffer.hpp"
#include <string>
#include <vector>


M module-utils/test/test_log.cpp => module-utils/test/test_log.cpp +1 -1
@@ 4,7 4,7 @@
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <catch2/catch.hpp>

#include "log/log.hpp"
#include <log.hpp>
#include <string>

using namespace std;

D module-utils/test/unittest_TimeRangeParser.cpp => module-utils/test/unittest_TimeRangeParser.cpp +0 -143
@@ 1,143 0,0 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include "time/TimeRangeParser.hpp"
#include <module-apps/application-calendar/data/dateCommon.hpp>
#include <module-db/Interface/EventsRecord.hpp>

#include <cstdint>
#include <cstring>
#include <iostream>

TEST_CASE("Time display parser")
{
    using utils::time::Version;
    SECTION("After noon time input (mode12h)")
    {
        auto event      = EventsRecord();
        event.date_from = TimePointFromString("2020-10-10 14:24:00");
        event.date_till = TimePointFromString("2020-10-10 15:36:00");

        auto returnString = utils::time::TimeRangeParser().getCalendarTimeString(
            event.date_from, event.date_till, Version::normal, false);
        REQUIRE("2020-10-10 14:24:00" == TimePointToString(event.date_from));
        REQUIRE("2020-10-10 15:36:00" == TimePointToString(event.date_till));
        REQUIRE("2" == TimePointToHourString12H(event.date_from));
        REQUIRE("24" == TimePointToMinutesString(event.date_from));
        REQUIRE("3" == TimePointToHourString12H(event.date_till));
        REQUIRE("36" == TimePointToMinutesString(event.date_till));
        REQUIRE(returnString == "2:24 - 3:36 " + utils::translate(utils::time::Locale::getPM()));
    }

    SECTION("Before noon time input (mode12h)")
    {
        auto event      = EventsRecord();
        event.date_from = TimePointFromString("2020-12-31 05:59:00");
        event.date_till = TimePointFromString("2020-12-31 07:45:00");

        auto returnString = utils::time::TimeRangeParser().getCalendarTimeString(
            event.date_from, event.date_till, Version::normal, false);
        REQUIRE("2020-12-31 05:59:00" == TimePointToString(event.date_from));
        REQUIRE("2020-12-31 07:45:00" == TimePointToString(event.date_till));
        REQUIRE("5" == TimePointToHourString12H(event.date_from));
        REQUIRE("59" == TimePointToMinutesString(event.date_from));
        REQUIRE("7" == TimePointToHourString12H(event.date_till));
        REQUIRE("45" == TimePointToMinutesString(event.date_till));
        REQUIRE(returnString == "5:59 - 7:45 " + utils::translate(utils::time::Locale::getAM()));
    }

    SECTION("Mixed time input (mode12h)")
    {
        auto event      = EventsRecord();
        event.date_from = TimePointFromString("2021-01-01 01:05:00");
        event.date_till = TimePointFromString("2021-01-01 19:55:00");

        auto returnString = utils::time::TimeRangeParser().getCalendarTimeString(
            event.date_from, event.date_till, Version::normal, false);
        REQUIRE("2021-01-01 01:05:00" == TimePointToString(event.date_from));
        REQUIRE("2021-01-01 19:55:00" == TimePointToString(event.date_till));
        REQUIRE("1" == TimePointToHourString12H(event.date_from));
        REQUIRE("05" == TimePointToMinutesString(event.date_from));
        REQUIRE("7" == TimePointToHourString12H(event.date_till));
        REQUIRE("55" == TimePointToMinutesString(event.date_till));
        REQUIRE(returnString == "1:05 " + utils::translate(utils::time::Locale::getAM()) + " - 7:55 " +
                                    utils::translate(utils::time::Locale::getPM()));
    }

    SECTION("Before noon time input - short version (mode12h)")
    {
        auto event      = EventsRecord();
        event.date_from = TimePointFromString("2020-12-31 00:05:00");
        event.date_till = TimePointFromString("2020-12-31 19:55:00");

        auto returnString = utils::time::TimeRangeParser().getCalendarTimeString(
            event.date_from, event.date_till, Version::abbrev, false);
        REQUIRE("2020-12-31 00:05:00" == TimePointToString(event.date_from));
        REQUIRE("2020-12-31 19:55:00" == TimePointToString(event.date_till));
        REQUIRE("12" == TimePointToHourString12H(event.date_from));
        REQUIRE("05" == TimePointToMinutesString(event.date_from));
        REQUIRE(returnString == "12:05 " + utils::translate(utils::time::Locale::getAM()));
    }

    SECTION("After noon time input - short version (mode12h)")
    {
        auto event      = EventsRecord();
        event.date_from = TimePointFromString("2020-12-31 12:05:00");
        event.date_till = TimePointFromString("2020-12-31 19:55:00");

        auto returnString = utils::time::TimeRangeParser().getCalendarTimeString(
            event.date_from, event.date_till, Version::abbrev, false);
        REQUIRE("2020-12-31 12:05:00" == TimePointToString(event.date_from));
        REQUIRE("2020-12-31 19:55:00" == TimePointToString(event.date_till));
        REQUIRE("12" == TimePointToHourString12H(event.date_from));
        REQUIRE("05" == TimePointToMinutesString(event.date_from));
        REQUIRE(returnString == "12:05 " + utils::translate(utils::time::Locale::getPM()));
    }

    SECTION("Time input (mode24h)")
    {
        auto event      = EventsRecord();
        event.date_from = TimePointFromString("2021-01-01 01:05:00");
        event.date_till = TimePointFromString("2021-01-01 19:55:00");

        auto returnString = utils::time::TimeRangeParser().getCalendarTimeString(
            event.date_from, event.date_till, Version::normal, true);
        REQUIRE("2021-01-01 01:05:00" == TimePointToString(event.date_from));
        REQUIRE("2021-01-01 19:55:00" == TimePointToString(event.date_till));
        REQUIRE("1" == TimePointToHourString24H(event.date_from));
        REQUIRE("05" == TimePointToMinutesString(event.date_from));
        REQUIRE("19" == TimePointToHourString24H(event.date_till));
        REQUIRE("55" == TimePointToMinutesString(event.date_till));
        REQUIRE(returnString == "1:05 - 19:55");
    }

    SECTION("Time input - short version (mode24h)")
    {
        auto event      = EventsRecord();
        event.date_from = TimePointFromString("2021-01-01 18:05:00");
        event.date_till = TimePointFromString("2021-01-01 19:55:00");

        auto returnString = utils::time::TimeRangeParser().getCalendarTimeString(
            event.date_from, event.date_till, Version::abbrev, true);
        REQUIRE("2021-01-01 18:05:00" == TimePointToString(event.date_from));
        REQUIRE("2021-01-01 19:55:00" == TimePointToString(event.date_till));
        REQUIRE("18" == TimePointToHourString24H(event.date_from));
        REQUIRE("05" == TimePointToMinutesString(event.date_from));
        REQUIRE(returnString == "18:05");
    }

    SECTION("All day time input")
    {
        auto event      = EventsRecord();
        event.date_from = TimePointFromString("2020-10-20 00:00:00");
        event.date_till = TimePointFromString("2020-10-20 23:59:00");

        auto returnString = utils::time::TimeRangeParser().getCalendarTimeString(
            event.date_from, event.date_till, Version::normal, false);
        REQUIRE("2020-10-20 00:00:00" == TimePointToString(event.date_from));
        REQUIRE("2020-10-20 23:59:00" == TimePointToString(event.date_till));
        REQUIRE(returnString == utils::translate("app_calendar_all_day"));
    }
}

A module-utils/time/CMakeLists.txt => module-utils/time/CMakeLists.txt +24 -0
@@ 0,0 1,24 @@
add_library(time)

module_is_test_entity(time)

target_sources(time
    PRIVATE
        time/DateAndTimeSettings.cpp
        time/time_conversion.cpp
        time/time_date_validation.cpp
        time/TimeRangeParser.cpp
)

target_include_directories(time PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)

target_link_libraries(time 
    PRIVATE 
        log
        module-utils
        utf8
)

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

A module-utils/time/test/CMakeLists.txt => module-utils/time/test/CMakeLists.txt +9 -0
@@ 0,0 1,9 @@
add_catch2_executable(
    NAME
        utils-time_display
    SRCS
        unittest_TimeRangeParser.cpp
    LIBS
        module-utils
        time
)

A module-utils/time/test/unittest_TimeRangeParser.cpp => module-utils/time/test/unittest_TimeRangeParser.cpp +134 -0
@@ 0,0 1,134 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include "time/TimeRangeParser.hpp"
#include <module-apps/application-calendar/data/dateCommon.hpp>

#include <cstdint>
#include <cstring>
#include <iostream>

TEST_CASE("Time display parser")
{
    using utils::time::Version;
    SECTION("After noon time input (mode12h)")
    {
        TimePoint date_from = TimePointFromString("2020-10-10 14:24:00");
        TimePoint date_till = TimePointFromString("2020-10-10 15:36:00");

        auto returnString =
            utils::time::TimeRangeParser().getCalendarTimeString(date_from, date_till, Version::normal, false);
        REQUIRE("2020-10-10 14:24:00" == TimePointToString(date_from));
        REQUIRE("2020-10-10 15:36:00" == TimePointToString(date_till));
        REQUIRE("2" == TimePointToHourString12H(date_from));
        REQUIRE("24" == TimePointToMinutesString(date_from));
        REQUIRE("3" == TimePointToHourString12H(date_till));
        REQUIRE("36" == TimePointToMinutesString(date_till));
        REQUIRE(returnString == "2:24 - 3:36 " + utils::translate(utils::time::Locale::getPM()));
    }

    SECTION("Before noon time input (mode12h)")
    {
        TimePoint date_from = TimePointFromString("2020-12-31 05:59:00");
        TimePoint date_till = TimePointFromString("2020-12-31 07:45:00");

        auto returnString =
            utils::time::TimeRangeParser().getCalendarTimeString(date_from, date_till, Version::normal, false);
        REQUIRE("2020-12-31 05:59:00" == TimePointToString(date_from));
        REQUIRE("2020-12-31 07:45:00" == TimePointToString(date_till));
        REQUIRE("5" == TimePointToHourString12H(date_from));
        REQUIRE("59" == TimePointToMinutesString(date_from));
        REQUIRE("7" == TimePointToHourString12H(date_till));
        REQUIRE("45" == TimePointToMinutesString(date_till));
        REQUIRE(returnString == "5:59 - 7:45 " + utils::translate(utils::time::Locale::getAM()));
    }

    SECTION("Mixed time input (mode12h)")
    {
        TimePoint date_from = TimePointFromString("2021-01-01 01:05:00");
        TimePoint date_till = TimePointFromString("2021-01-01 19:55:00");

        auto returnString =
            utils::time::TimeRangeParser().getCalendarTimeString(date_from, date_till, Version::normal, false);
        REQUIRE("2021-01-01 01:05:00" == TimePointToString(date_from));
        REQUIRE("2021-01-01 19:55:00" == TimePointToString(date_till));
        REQUIRE("1" == TimePointToHourString12H(date_from));
        REQUIRE("05" == TimePointToMinutesString(date_from));
        REQUIRE("7" == TimePointToHourString12H(date_till));
        REQUIRE("55" == TimePointToMinutesString(date_till));
        REQUIRE(returnString == "1:05 " + utils::translate(utils::time::Locale::getAM()) + " - 7:55 " +
                                    utils::translate(utils::time::Locale::getPM()));
    }

    SECTION("Before noon time input - short version (mode12h)")
    {
        TimePoint date_from = TimePointFromString("2020-12-31 00:05:00");
        TimePoint date_till = TimePointFromString("2020-12-31 19:55:00");

        auto returnString =
            utils::time::TimeRangeParser().getCalendarTimeString(date_from, date_till, Version::abbrev, false);
        REQUIRE("2020-12-31 00:05:00" == TimePointToString(date_from));
        REQUIRE("2020-12-31 19:55:00" == TimePointToString(date_till));
        REQUIRE("12" == TimePointToHourString12H(date_from));
        REQUIRE("05" == TimePointToMinutesString(date_from));
        REQUIRE(returnString == "12:05 " + utils::translate(utils::time::Locale::getAM()));
    }

    SECTION("After noon time input - short version (mode12h)")
    {
        TimePoint date_from = TimePointFromString("2020-12-31 12:05:00");
        TimePoint date_till = TimePointFromString("2020-12-31 19:55:00");

        auto returnString =
            utils::time::TimeRangeParser().getCalendarTimeString(date_from, date_till, Version::abbrev, false);
        REQUIRE("2020-12-31 12:05:00" == TimePointToString(date_from));
        REQUIRE("2020-12-31 19:55:00" == TimePointToString(date_till));
        REQUIRE("12" == TimePointToHourString12H(date_from));
        REQUIRE("05" == TimePointToMinutesString(date_from));
        REQUIRE(returnString == "12:05 " + utils::translate(utils::time::Locale::getPM()));
    }

    SECTION("Time input (mode24h)")
    {
        TimePoint date_from = TimePointFromString("2021-01-01 01:05:00");
        TimePoint date_till = TimePointFromString("2021-01-01 19:55:00");

        auto returnString =
            utils::time::TimeRangeParser().getCalendarTimeString(date_from, date_till, Version::normal, true);
        REQUIRE("2021-01-01 01:05:00" == TimePointToString(date_from));
        REQUIRE("2021-01-01 19:55:00" == TimePointToString(date_till));
        REQUIRE("1" == TimePointToHourString24H(date_from));
        REQUIRE("05" == TimePointToMinutesString(date_from));
        REQUIRE("19" == TimePointToHourString24H(date_till));
        REQUIRE("55" == TimePointToMinutesString(date_till));
        REQUIRE(returnString == "1:05 - 19:55");
    }

    SECTION("Time input - short version (mode24h)")
    {
        TimePoint date_from = TimePointFromString("2021-01-01 18:05:00");
        TimePoint date_till = TimePointFromString("2021-01-01 19:55:00");

        auto returnString =
            utils::time::TimeRangeParser().getCalendarTimeString(date_from, date_till, Version::abbrev, true);
        REQUIRE("2021-01-01 18:05:00" == TimePointToString(date_from));
        REQUIRE("2021-01-01 19:55:00" == TimePointToString(date_till));
        REQUIRE("18" == TimePointToHourString24H(date_from));
        REQUIRE("05" == TimePointToMinutesString(date_from));
        REQUIRE(returnString == "18:05");
    }

    SECTION("All day time input")
    {
        TimePoint date_from = TimePointFromString("2020-10-20 00:00:00");
        TimePoint date_till = TimePointFromString("2020-10-20 23:59:00");

        auto returnString =
            utils::time::TimeRangeParser().getCalendarTimeString(date_from, date_till, Version::normal, false);
        REQUIRE("2020-10-20 00:00:00" == TimePointToString(date_from));
        REQUIRE("2020-10-20 23:59:00" == TimePointToString(date_till));
        REQUIRE(returnString == utils::translate("app_calendar_all_day"));
    }
}

R module-utils/time/DateAndTimeSettings.cpp => module-utils/time/time/DateAndTimeSettings.cpp +0 -0
R module-utils/time/DateAndTimeSettings.hpp => module-utils/time/time/DateAndTimeSettings.hpp +0 -0
R module-utils/time/FromTillDate.hpp => module-utils/time/time/FromTillDate.hpp +0 -0
R module-utils/time/README.md => module-utils/time/time/README.md +0 -0
R module-utils/time/ScopedTime.hpp => module-utils/time/time/ScopedTime.hpp +1 -1
@@ 4,7 4,7 @@
#pragma once

#include <FreeRTOS.h>
#include <log/log.hpp>
#include <log.hpp>
#include <string>
#include <ticks.hpp>


R module-utils/time/TimeRangeParser.cpp => module-utils/time/time/TimeRangeParser.cpp +0 -0
R module-utils/time/TimeRangeParser.hpp => module-utils/time/time/TimeRangeParser.hpp +0 -0
R module-utils/time/time_conversion.cpp => module-utils/time/time/time_conversion.cpp +0 -0
R module-utils/time/time_conversion.hpp => module-utils/time/time/time_conversion.hpp +1 -1
@@ 8,7 8,7 @@

#include "time/time_locale.hpp"
#include <bsp/rtc/rtc.hpp>
#include <log/log.hpp>
#include <log.hpp>

#include <vector>
#include <string>

R module-utils/time/time_date_validation.cpp => module-utils/time/time/time_date_validation.cpp +1 -1
@@ 8,7 8,7 @@
 *      Author: kuba
 */
#include "time_date_validation.hpp"
#include "log/log.hpp"
#include <log.hpp>
namespace utils
{
    namespace time

R module-utils/time/time_date_validation.hpp => module-utils/time/time/time_date_validation.hpp +0 -0
R module-utils/time/time_locale.hpp => module-utils/time/time/time_locale.hpp +1 -1
@@ 6,7 6,7 @@
#include <array>
#include <utf8/UTF8.hpp>
#include "i18n/i18n.hpp"
#include <log/log.hpp>
#include <log.hpp>

namespace utils
{

R module-utils/time/time_syscalls.hpp => module-utils/time/time/time_syscalls.hpp +0 -0
A module-utils/ucs2/CMakeLists.txt => module-utils/ucs2/CMakeLists.txt +25 -0
@@ 0,0 1,25 @@
add_library(ucs2 STATIC)

module_is_test_entity(ucs2)

target_sources(ucs2
    PRIVATE
       ucs2/UCS2.cpp
)

target_include_directories(ucs2
    PUBLIC
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

target_link_libraries(ucs2
    PUBLIC
        utf8

    PRIVATE
        log
)

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

A module-utils/ucs2/test/CMakeLists.txt => module-utils/ucs2/test/CMakeLists.txt +8 -0
@@ 0,0 1,8 @@
add_catch2_executable(
    NAME
        ucs2
    SRCS
        unittest_ucs2.cpp
    LIBS
        ucs2
)

R module-utils/test/unittest_ucs2.cpp => module-utils/ucs2/test/unittest_ucs2.cpp +2 -2
@@ 1,10 1,10 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <catch2/catch.hpp>

#include "ucs2/UCS2.hpp"
#include <ucs2/UCS2.hpp>

TEST_CASE("UCS2 to UTF8 conversion")
{

R module-utils/ucs2/UCS2.cpp => module-utils/ucs2/ucs2/UCS2.cpp +2 -3
@@ 7,7 7,7 @@
#include <sstream>

#include <iomanip>
#include "log/log.hpp"
#include <log.hpp>
#include <iterator>
#include <locale>
#include <codecvt>


@@ 18,8 18,7 @@ namespace ucs2
} // namespace ucs2

UCS2::UCS2() : sizeAllocated{ucs2::bufferExt}, buffer{std::make_unique<uint32_t[]>(ucs2::bufferExt)}
{
}
{}

UCS2::UCS2(const UTF8 &string)
{

R module-utils/ucs2/UCS2.hpp => module-utils/ucs2/ucs2/UCS2.hpp +1 -1
@@ 5,7 5,7 @@

#include <cstdint>
#include <memory>
#include "utf8/UTF8.hpp"
#include <utf8/UTF8.hpp>

class UCS2
{

A module-utils/utf8/CMakeLists.txt => module-utils/utf8/CMakeLists.txt +19 -0
@@ 0,0 1,19 @@
add_library(utf8 STATIC)

module_is_test_entity(utf8)

target_sources(utf8
    PRIVATE
        utf8/UTF8.cpp
)

target_include_directories(utf8
    PUBLIC
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

target_link_libraries(utf8 PRIVATE log)

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

A module-utils/utf8/test/CMakeLists.txt => module-utils/utf8/test/CMakeLists.txt +9 -0
@@ 0,0 1,9 @@
add_catch2_executable(
    NAME
        utf8
    SRCS
        unittest_utf8.cpp
    LIBS
        log
        utf8
)

R module-utils/test/unittest_utf8.cpp => module-utils/utf8/test/unittest_utf8.cpp +0 -0
R module-utils/utf8/UTF8.cpp => module-utils/utf8/utf8/UTF8.cpp +5 -7
@@ 6,8 6,8 @@
#include <cstdint>
#include <ostream>

#include "UTF8.hpp"
#include "log/log.hpp"
#include <log.hpp>
#include "utf8/UTF8.hpp"

#define debug_utf(...)



@@ 115,8 115,7 @@ void U8char::set(char *val, unsigned int size)
UTF8::UTF8()
    : data{std::make_unique<char[]>(stringExpansion)},
      sizeAllocated{stringExpansion}, sizeUsed{1}, strLength{0}, lastIndex{0}, lastIndexData{data.get()}
{
}
{}

UTF8::UTF8(const char *str)
{


@@ 166,7 165,7 @@ UTF8::UTF8(const UTF8 &utf)
    else {
        sizeAllocated = stringExpansion;
        data          = std::make_unique<char[]>(sizeAllocated);
        sizeUsed = 1;
        sizeUsed      = 1;
    }
    lastIndex     = 0;
    lastIndexData = data.get();


@@ 175,8 174,7 @@ UTF8::UTF8(const UTF8 &utf)
UTF8::UTF8(UTF8 &&utf)
    : data{std::move(utf.data)}, sizeAllocated{utf.sizeAllocated}, sizeUsed{utf.sizeUsed}, strLength{utf.strLength},
      lastIndex{0}, lastIndexData{data.get()}
{
}
{}

UTF8::UTF8(const char *data, const uint32_t allocated, const uint32_t used, const uint32_t len)
    : sizeAllocated{allocated}, sizeUsed{used}, strLength{len}, lastIndex{0}

R module-utils/utf8/UTF8.hpp => module-utils/utf8/utf8/UTF8.hpp +1 -0
@@ 63,6 63,7 @@ class UTF8
     */
    uint32_t getDataBufferSize(uint32_t dataBytes);
    bool expand(uint32_t size = stringExpansion);

  public:
    UTF8();
    UTF8(const char *str);

M module-vfs/CMakeLists.txt => module-vfs/CMakeLists.txt +1 -2
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

project(module-vfs VERSION 1.0
        DESCRIPTION "VFS module library")



@@ 80,6 78,7 @@ target_link_libraries(${PROJECT_NAME}
        module-utils
    PRIVATE 
        littlefs::littlefs
        json::json
)

if (${ENABLE_TESTS})

M module-vfs/drivers/src/purefs/fs/filesystem_littlefs.cpp => module-vfs/drivers/src/purefs/fs/filesystem_littlefs.cpp +1 -1
@@ 10,7 10,7 @@
#include <purefs/blkdev/disk_handle.hpp>
#include <purefs/fs/mount_flags.hpp>
#include <lfs.h>
#include <log/log.hpp>
#include <log.hpp>

#include <climits>
#include <syslimits.h>

M module-vfs/drivers/src/purefs/fs/filesystem_vfat.cpp => module-vfs/drivers/src/purefs/fs/filesystem_vfat.cpp +1 -1
@@ 8,7 8,7 @@
#include <purefs/fs/drivers/file_handle_vfat.hpp>
#include <purefs/fs/drivers/directory_handle_vfat.hpp>
#include <purefs/fs/mount_flags.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <fatfs/volume_mapper.hpp>
#include <ff.h>
#include <sys/statvfs.h>

M module-vfs/drivers/src/thirdparty/littlefs/lfs_glue.cpp => module-vfs/drivers/src/thirdparty/littlefs/lfs_glue.cpp +1 -1
@@ 4,7 4,7 @@
#include <lfs.h>
#include <purefs/blkdev/disk_handle.hpp>
#include <purefs/blkdev/disk_manager.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <mutex.hpp>
#include <errno.h>


M module-vfs/src/purefs/blkdev/disk_handle.cpp => module-vfs/src/purefs/blkdev/disk_handle.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <purefs/blkdev/disk_handle.hpp>
#include <purefs/blkdev/disk.hpp>
#include <log/log.hpp>
#include <log.hpp>

namespace purefs::blkdev::internal
{

M module-vfs/src/purefs/blkdev/disk_manager.cpp => module-vfs/src/purefs/blkdev/disk_manager.cpp +1 -1
@@ 3,7 3,7 @@

#include <purefs/blkdev/disk_manager.hpp>
#include <purefs/blkdev/disk.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <mutex.hpp>
#include <errno.h>
#include <charconv>

M module-vfs/src/purefs/blkdev/partition_parser.cpp => module-vfs/src/purefs/blkdev/partition_parser.cpp +1 -1
@@ 3,7 3,7 @@

#include <purefs/blkdev/partition_parser.hpp>
#include <purefs/blkdev/disk.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <errno.h>
#include <limits>


M module-vfs/src/purefs/fs/filesystem_syscalls.cpp => module-vfs/src/purefs/fs/filesystem_syscalls.cpp +1 -1
@@ 2,7 2,7 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <purefs/fs/filesystem.hpp>
#include <errno.h>
#include <log/log.hpp>
#include <log.hpp>
#include <purefs/fs/filesystem_operations.hpp>
#include <purefs/fs/file_handle.hpp>
#include <purefs/fs/directory_handle.hpp>

M module-vfs/src/purefs/vfs_subsystem.cpp => module-vfs/src/purefs/vfs_subsystem.cpp +2 -2
@@ 8,9 8,9 @@
#include <purefs/vfs_subsystem.hpp>
#include <purefs/vfs_subsystem_internal.hpp>
#include <purefs/fs/thread_local_cwd.hpp>
#include <log/log.hpp>
#include <log.hpp>
#include <purefs/filesystem_paths.hpp>
#include <module-utils/json/json11.hpp>
#include <json11.hpp>
#include <sys/stat.h>
#include <fcntl.h>


M module-vfs/tests/CMakeLists.txt => module-vfs/tests/CMakeLists.txt +0 -2
@@ 1,5 1,3 @@
cmake_minimum_required(VERSION 3.12)

add_custom_target("test_disk_image")
add_custom_command(
        PRE_BUILD

M products/PurePhone/CMakeLists.txt => products/PurePhone/CMakeLists.txt +4 -0
@@ 82,3 82,7 @@ add_hex_target(PurePhone)
add_standalone_image(PurePhone)
add_update_package(PurePhone)

include(GitHubWorkerMessages)
github_message_standalone()
github_message_update()


M products/PurePhone/PurePhoneMain.cpp => products/PurePhone/PurePhoneMain.cpp +2 -2
@@ 46,8 46,8 @@
#include <bsp/bsp.hpp>
#include <Application.hpp>
#include <ApplicationLauncher.hpp>
#include <log/log.hpp>
#include <log/Logger.hpp>
#include <log.hpp>
#include <Logger.hpp>
#include <phonenumbers/phonenumberutil.h>
#include <source/version.hpp>
#include <SystemManager/SystemManager.hpp>

M source/MessageType.hpp => source/MessageType.hpp +0 -3
@@ 122,9 122,6 @@ enum class MessageType
    USBConnected,
    USBConfigured,
    USBDisconnected,
    USBSecurityOn,
    USBSecurityOff,
    USBHandshake,

    // FOTA messages
    HttpRequest,

M test/CMakeLists.txt => test/CMakeLists.txt +2 -2
@@ 51,7 51,7 @@ function(add_gtest_executable)
        target_sources(${_TESTNAME} PRIVATE ${ROOT_TEST_DIR}/mock-freertos-tls.cpp)
    endif (NOT ${ENABLE_TEST_LOGS})

    target_link_libraries(${_TESTNAME} PRIVATE gtest_main gmock)
    target_link_libraries(${_TESTNAME} PRIVATE gtest_main gmock log)
    foreach(lib ${_TEST_ARGS_LIBS})
        target_link_libraries(${_TESTNAME} PRIVATE ${lib})
    endforeach(lib)


@@ 112,7 112,7 @@ function(add_catch2_executable)
        target_sources(${_TESTNAME} PRIVATE ${ROOT_TEST_DIR}/mock-freertos-tls.cpp)
    endif (NOT ${ENABLE_TEST_LOGS} AND NOT ${_TESTNAME} STREQUAL "catch2-utils-log")

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

M test/firmware_update_test/update.py => test/firmware_update_test/update.py +1 -1
@@ 80,7 80,7 @@ def update(harness, update_filepath: str):


def get_update_list(harness):
    harness.unlock_usb()
    harness.unlock_phone()
    ret = harness.endpoint_request("deviceInfo", "get", {})
    device_info = ret["body"]
    update_history = device_info["updateHistory"]

M test/harness => test/harness +1 -1
@@ 1,1 1,1 @@
Subproject commit 5e89897197e210f9fec418b0765d6234275d4069
Subproject commit 9093212fd71f9741fb3dbc6d95a604d8f67f04cb

M test/make_a_call.py => test/make_a_call.py +1 -1
@@ 46,7 46,7 @@ def main():
        port_name = sys.argv[1]

    harness = Harness(sys.argv[1])
    harness. unlock_usb()
    harness.unlock_phone()
    number = str(sys.argv[2])
    duration = int(sys.argv[3])
    count_before = get_calllog_count(harness)

M test/mock-logs.cpp => test/mock-logs.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <log/log.hpp>
#include <log.hpp>
#include <cstdarg>
__attribute__((weak)) int log_Log(
    logger_level level, const char *file, int line, const char *function, const char *fmt, ...)

M test/phone_modem_clear_sms_queue.py => test/phone_modem_clear_sms_queue.py +0 -1
@@ 8,7 8,6 @@ import sys


harness = Harness(sys.argv[1])
harness.unlock_usb()

harness.connection.send_at("at+cmgl=\"all\"", 10000)
harness.connection.send_at("at+cmgd=1,4", 10000)

M test/phone_off.py => test/phone_off.py +0 -1
@@ 28,7 28,6 @@ def main():
        port_name = sys.argv[1]

    harness = Harness(port_name)
    harness.unlock_usb()
    harness.unlock_phone()
    harness.turn_phone_off()


M test/phone_sim_check.py => test/phone_sim_check.py +0 -2
@@ 7,8 7,6 @@ from harness.harness import Harness
import sys

harness = Harness(sys.argv[1])
harness.unlock_usb()


results = harness.connection.send_at("AT+CPIN?", 10000)
for result in results:

M test/phone_sim_detection_on.py => test/phone_sim_detection_on.py +0 -1
@@ 6,7 6,6 @@ from harness.harness import Harness
import sys

harness = Harness(sys.argv[1])
harness.unlock_usb()

harness.connection.send_at("at+qsimdet=1,0", 10000)
harness.connection.send_at("AT+QSIMSTAT=1", 10000)

M test/phone_unlock.py => test/phone_unlock.py +2 -1
@@ 6,7 6,8 @@
from harness.harness import Harness

harness = Harness.from_detect()
harness. unlock_usb()


@harness.with_phone_unlocked
def done(connection):
    pass

M test/pytest/conftest.py => test/pytest/conftest.py +5 -8
@@ 131,21 131,18 @@ def harnesses():
@pytest.fixture(scope='session')
def phone_unlocked(harness):
    harness.unlock_phone()
    assert harness.is_phone_unlocked
    assert not harness.is_phone_locked()

@pytest.fixture(scope='session')
def usb_unlocked(harness):
    harness.unlock_usb()

@pytest.fixture(scope='session')
def usb_locked(harness):
    harness.lock_usb()
def phone_locked(harness):
    harness.lock_phone()
    assert harness.is_phone_locked()

@pytest.fixture(scope='session')
def phones_unlocked(harnesses):
    for harness in harnesses:
        harness.unlock_phone()
        assert harness.is_phone_unlocked
        assert not harness.is_phone_locked()


@pytest.fixture(scope='session')

M test/pytest/service-bluetooth/test_basic_control_dev_perspective.py => test/pytest/service-bluetooth/test_basic_control_dev_perspective.py +2 -2
@@ 10,7 10,7 @@ from bt_utils import *

@pytest.mark.rt1051
@pytest.mark.usefixtures("bt_state_off")
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_bt_turning_on_off(harness):
    state = bt_get_state(harness)
    assert state["power"] == "off"


@@ 30,7 30,7 @@ def test_bt_turning_on_off(harness):

@pytest.mark.rt1051
@pytest.mark.usefixtures("bt_state_on")
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_bt_visibility_on_off(harness):
    state = bt_get_state(harness)
    assert state["power"] == "on"

M test/pytest/service-bluetooth/test_pairing_dev_perspective.py => test/pytest/service-bluetooth/test_pairing_dev_perspective.py +2 -2
@@ 9,7 9,7 @@ from bt_utils import *

@pytest.mark.rt1051
@pytest.mark.usefixtures("bt_state_on")
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.skipif("not config.getvalue('--bt_device')", reason='--bt_device was not specified')
def test_bt_pairing_dev(harness, bt_device):
    time.sleep(1)


@@ 47,7 47,7 @@ def test_bt_pairing_dev(harness, bt_device):

@pytest.mark.rt1051
@pytest.mark.usefixtures("bt_state_on")
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.skipif("not config.getvalue('--bt_device')", reason='--bt_device was not specified')
def test_bt_connection_dev(harness, bt_device):
    time.sleep(1)

M test/pytest/service-bluetooth/test_pairing_hmi_perspective.py => test/pytest/service-bluetooth/test_pairing_hmi_perspective.py +0 -1
@@ 14,7 14,6 @@ from bt_fixtures import *
@pytest.mark.usefixtures("bt_main_window")
@pytest.mark.usefixtures("phone_in_desktop")
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.skipif("not config.getvalue('--bt_device')", reason='--bt_device was not specified')
def test_bt_pairing_hmi(harness, bt_device):
    if not bt_device:

M test/pytest/service-desktop/test_backup.py => test/pytest/service-desktop/test_backup.py +1 -1
@@ 9,7 9,7 @@ from harness.interface.defs import status

@pytest.mark.service_desktop_test
@pytest.mark.rt1051
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.backup
def test_backup(harness):
    body = { "request": True }

M test/pytest/service-desktop/test_battery_file.py => test/pytest/service-desktop/test_battery_file.py +1 -1
@@ 6,7 6,7 @@ from harness.interface.defs import status

@pytest.mark.rt1051
@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_battery_file(harness):
    body = {"command" : "checkFile" , "fileName" : "/sys/user/batteryFuelGaugeConfig.cfg"}
    ret = harness.endpoint_request("filesystemUpload", "post", body)

M test/pytest/service-desktop/test_calendar.py => test/pytest/service-desktop/test_calendar.py +1 -1
@@ 7,7 7,7 @@ import copy

@pytest.mark.rt1051
@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_calendar(harness):
    # add events
    add_body = {

M test/pytest/service-desktop/test_calendar_events.py => test/pytest/service-desktop/test_calendar_events.py +1 -1
@@ 6,7 6,7 @@ import copy
import time

@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_calendar(harness):
    # add events
    add_body = {

M test/pytest/service-desktop/test_calllog.py => test/pytest/service-desktop/test_calllog.py +2 -2
@@ 1,11 1,11 @@
# Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
import pytest
from harness.interface.defs import status


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_calllog(harness):
    # checking call log count
    body = {"count": True}

M test/pytest/service-desktop/test_contacts.py => test/pytest/service-desktop/test_contacts.py +2 -2
@@ 1,11 1,11 @@
# Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
import pytest
from harness.interface.defs import status


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_contacts(harness):
    # getting the contacts count
    body = {"count": True}

M test/pytest/service-desktop/test_device_info.py => test/pytest/service-desktop/test_device_info.py +1 -1
@@ 5,7 5,7 @@ from harness.interface.defs import status


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_device_info(harness):
    body = {}
    ret = harness.endpoint_request("deviceInfo", "get", body)

M test/pytest/service-desktop/test_factory_reset.py => test/pytest/service-desktop/test_factory_reset.py +1 -1
@@ 6,7 6,7 @@ from harness.interface.defs import status

@pytest.mark.service_desktop_test
@pytest.mark.rt1051
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_factory_reset(harness):
    body = {"factoryRequest": True}
    ret = harness.endpoint_request("factory", "post", body)

M test/pytest/service-desktop/test_messages.py => test/pytest/service-desktop/test_messages.py +8 -8
@@ 8,7 8,7 @@ MESSAGES_PAGE_SIZE = 4


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_messages_without_pagination(harness):
    limit = MESSAGES_PAGE_SIZE - 1
    get_body = {"category": "message", "limit": limit, "offset": 0}


@@ 30,7 30,7 @@ def test_get_messages_without_pagination(harness):


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_messages_with_pagination(harness):
    limit = MESSAGES_PAGE_SIZE + 1
    body = {"category": "message", "limit": limit, "offset": 0}


@@ 43,7 43,7 @@ def test_get_messages_with_pagination(harness):


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_all_messages(harness):
    # get messages count
    body = {"category": "message", "count": True}


@@ 85,7 85,7 @@ def test_get_all_messages(harness):


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_messages_by_thread_id_without_pagination(harness):
    thread_id = 1
    limit = MESSAGES_PAGE_SIZE - 1


@@ 101,7 101,7 @@ def test_get_messages_by_thread_id_without_pagination(harness):


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_messages_by_thread_id_with_pagination(harness):
    thread_id = 1
    limit = MESSAGES_PAGE_SIZE + 1


@@ 117,7 117,7 @@ def test_get_messages_by_thread_id_with_pagination(harness):


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_all_messages_by_thread_id(harness):
    thread_id = 1
    # get messages count


@@ 160,7 160,7 @@ def test_get_all_messages_by_thread_id(harness):


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_remove_message(harness):
    # get messages count
    body = {"category": "message", "count": True}


@@ 194,7 194,7 @@ def test_remove_message(harness):


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_message_by_id(harness):
    message_id = 1
    get_body = {"category": "message", "messageID": message_id}

M test/pytest/service-desktop/test_restore.py => test/pytest/service-desktop/test_restore.py +1 -1
@@ 8,7 8,7 @@ from harness import log

@pytest.mark.service_desktop_test
@pytest.mark.rt1051
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.restore
def test_restore(harness):
    # this requests the list of available files

M test/pytest/service-desktop/test_security.py => test/pytest/service-desktop/test_security.py +96 -7
@@ 2,12 2,14 @@
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

import pytest
import time

from harness.interface.defs import status


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
def test_security_usb_unlocked(harness):
@pytest.mark.usefixtures("phone_unlocked")
def test_security_phone_unlocked(harness):
    body = {}

    ret = harness.endpoint_request("deviceInfo", "get", body)


@@ 15,8 17,8 @@ def test_security_usb_unlocked(harness):


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_locked")
def test_security_usb_locked(harness):
@pytest.mark.usefixtures("phone_locked")
def test_security_phone_locked_with_code(harness):
    body = {}

    ret = harness.endpoint_request("usbSecurity", "get", body)


@@ 24,8 26,8 @@ def test_security_usb_locked(harness):


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_locked")
def test_all_other_endpoints_usb_locked(harness):
@pytest.mark.usefixtures("phone_locked")
def test_all_other_endpoints_phone_locked_with_code(harness):
    body = {}
    endpoints_list = ["deviceInfo",
                      "update",


@@ 52,7 54,94 @@ def test_all_other_endpoints_usb_locked(harness):
        ret = harness.endpoint_request(endpoint_name, "del", body)
        assert ret["status"] == status["Forbidden"]

    body = {"getInfo": "simState"}
    ret = harness.endpoint_request("developerMode", "get", body)
    assert ret["status"] == status["OK"]

    harness.unlock_usb()

@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("phone_locked")
def test_security_phone_locked_without_code(harness):

    body = {"phoneLockCodeEnabled": False}
    ret = harness.endpoint_request("developerMode", "put", body)
    assert ret["status"] == status["OK"]

    time.sleep(.1)

    body = {}
    ret = harness.endpoint_request("usbSecurity", "get", body)
    assert ret["status"] == status["OK"]

    body = {"phoneLockCodeEnabled": True}
    ret = harness.endpoint_request("developerMode", "put", body)
    assert ret["status"] == status["OK"]

    harness.lock_phone()
    time.sleep(.1)

    body = {}
    ret = harness.endpoint_request("usbSecurity", "get", body)
    assert ret["status"] == status["Forbidden"]


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("phone_locked")
def test_security_unlock_phone(harness):

    """
    Attempt unlocking with wrong passcode: 1111
    Assuming 1111 is not the actual passcode :-)
    """
    body = {"phoneLockCode": [1, 1, 1, 1]}
    ret = harness.endpoint_request("usbSecurity", "put", body)
    assert ret["status"] == status["OK"]

    time.sleep(.1)

    body = {}
    ret = harness.endpoint_request("usbSecurity", "get", body)
    assert ret["status"] == status["Forbidden"]

    time.sleep(.1)

    body = {"phoneLockCode": ['a', 'a', 'a', 'a']}
    ret = harness.endpoint_request("usbSecurity", "put", body)
    assert ret["status"] == status["BadRequest"]

    time.sleep(.1)

    body = {}
    ret = harness.endpoint_request("usbSecurity", "get", body)
    assert ret["status"] == status["Forbidden"]

    time.sleep(.1)

    """
    Attempt unlocking with too short passcode: 1
    """
    body = {"phoneLockCode": [1]}
    ret = harness.endpoint_request("usbSecurity", "put", body)
    assert ret["status"] == status["BadRequest"]

    time.sleep(.1)

    body = {}
    ret = harness.endpoint_request("usbSecurity", "get", body)
    assert ret["status"] == status["Forbidden"]

    time.sleep(.1)

    """
    Attempt unlocking with correct passcode: 3333
    Assuming 3333 is the actual passcode :-)
    """
    body = {"phoneLockCode": [3, 3, 3, 3]}
    ret = harness.endpoint_request("usbSecurity", "put", body)
    assert ret["status"] == status["OK"]

    time.sleep(.1)

    body = {}
    ret = harness.endpoint_request("deviceInfo", "get", body)
    assert ret["status"] == status["OK"]

M test/pytest/service-desktop/test_templates.py => test/pytest/service-desktop/test_templates.py +4 -4
@@ 145,28 145,28 @@ class TemplatesTester:


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_template_by_id(harness):
    templates_tester = TemplatesTester(harness)
    templates_tester.test_getting_template_by_id()


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_templates_without_pagination(harness):
    templates_tester = TemplatesTester(harness)
    templates_tester.test_getting_templates_without_pagination()

@pytest.mark.rt1051
@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_change_template(harness):
    templates_tester = TemplatesTester(harness)
    templates_tester.test_changing_template_body()

@pytest.mark.rt1051
@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_get_templates_with_pagination(harness):
    templates_tester = TemplatesTester(harness)
    templates_tester.test_getting_templates_with_pagination()

M test/pytest/service-desktop/test_threads.py => test/pytest/service-desktop/test_threads.py +1 -1
@@ 5,7 5,7 @@ from harness.interface.defs import status


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_threads(harness):
    # getting all threads
    body = {"category": "thread"}

M test/pytest/service-desktop/test_update.py => test/pytest/service-desktop/test_update.py +1 -1
@@ 5,7 5,7 @@ from harness.interface.defs import status


@pytest.mark.service_desktop_test
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.rt1051
def test_update(harness):
    body = {}

M test/pytest/test_call.py => test/pytest/test_call.py +0 -1
@@ 8,7 8,6 @@ from module_apps.call_utils import get_calllog_count, select_call_button
@pytest.mark.rt1051
@pytest.mark.usefixtures("phone_ends_test_in_desktop")
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.usefixtures("usb_unlocked")
def test_call(harness, phone_number, call_duration):
    count_before = get_calllog_count(harness)
    # enter number

M test/pytest/test_call_back.py => test/pytest/test_call_back.py +0 -1
@@ 10,7 10,6 @@ from module_apps.call_utils import get_calllog_count, select_call_button
@pytest.mark.usefixtures("phone_ends_test_in_desktop")
@pytest.mark.usefixtures("phone_in_desktop")
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.usefixtures("usb_unlocked")
def test_call(harness, call_duration):
    count_before = get_calllog_count(harness)


M test/pytest/test_cellular_sleep.py => test/pytest/test_cellular_sleep.py +2 -3
@@ 26,8 26,7 @@ def wait_for_cellular_sleep(harness, max_attempts):


@pytest.mark.rt1051
@pytest.mark.usefixtures("usb_unlocked")

@pytest.mark.usefixtures("phone_unlocked")
def test_call_during_cellular_sleep_mode(harness, phone_number, call_duration, max_attempts = 10):
    cellular_sleep_mode = wait_for_cellular_sleep(harness, max_attempts)
    if (cellular_sleep_mode == False):


@@ 43,7 42,7 @@ def test_call_during_cellular_sleep_mode(harness, phone_number, call_duration, m
    assert ret["body"]["cellularSleepMode"] == False

@pytest.mark.rt1051
@pytest.mark.usefixtures("usb_unlocked")
@pytest.mark.usefixtures("phone_unlocked")
def test_sms_during_cellular_sleep_mode(harness, phone_number, sms_text, max_attempts = 10):
    cellular_sleep_mode = wait_for_cellular_sleep(harness, max_attempts)
    if (cellular_sleep_mode == False):

M test/pytest/test_cellular_start.py => test/pytest/test_cellular_start.py +0 -4
@@ 42,8 42,6 @@ def wait_for_cellular_state(harness, state, max_attempts = 10):

@pytest.mark.rt1051
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.usefixtures("usb_unlocked")

def test_cellular_cold_start(harness, phone_number, sms_text):
    ret = request_cellular_state_info(harness)
    assert ret["status"] == status["OK"]


@@ 72,8 70,6 @@ def test_cellular_cold_start(harness, phone_number, sms_text):

@pytest.mark.rt1051
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.usefixtures("usb_unlocked")

def test_cellular_hot_start(harness, phone_number, sms_text):
    time.sleep(2)
    request_cellular_power_state_change(harness, cellular_states["HotStart"])

M test/pytest/test_send_message.py => test/pytest/test_send_message.py +0 -1
@@ 174,7 174,6 @@ def remove_added_messages(harness, diff_messages):
@pytest.mark.rt1051
@pytest.mark.usefixtures("phone_unlocked")
@pytest.mark.usefixtures("phone_in_desktop")
@pytest.mark.usefixtures("usb_unlocked")
def test_send_message(harness, phone_number, sms_text):
    old_messages = get_message_by_text(harness, sms_text, str(phone_number))


M test/search_sms.py => test/search_sms.py +1 -1
@@ 37,7 37,7 @@ def main():
        port_name = sys.argv[1]

    harness = Harness(port_name)
    harness. unlock_usb()
    harness.unlock_phone()
    message = str(sys.argv[2])
    phone_number = str(sys.argv[3])


M test/set_tethering.py => test/set_tethering.py +0 -1
@@ 26,7 26,6 @@ def main():
        port_name = sys.argv[1]

    harness = Harness(port_name)
    harness. unlock_usb()
    state = int(sys.argv[2])

    harness.unlock_phone()

M test/version_check.py => test/version_check.py +1 -1
@@ 50,7 50,7 @@ def main():
        exit()

    harness = Harness(port_name)
    harness.unlock_usb()
    harness.unlock_phone()
    [rev, branch, tag] = get_version(harness)

    if args.git_tag != tag or args.git_branch != branch or args.git_revision != rev:

M third-party/CMakeLists.txt => third-party/CMakeLists.txt +1 -0
@@ 10,6 10,7 @@ add_subdirectory(tinyexpr)
add_subdirectory(parallel-hashmap)
add_subdirectory(protobuf)
add_subdirectory(littlefs)
add_subdirectory(json)
add_subdirectory(gsl)
add_subdirectory(re2)
if (${PROJECT_TARGET} STREQUAL "TARGET_RT1051")

A third-party/json/CMakeLists.txt => third-party/json/CMakeLists.txt +13 -0
@@ 0,0 1,13 @@
add_library(json)
add_library(json::json ALIAS json)
target_sources(json
    PRIVATE
        json11.cpp
    PUBLIC
        json11.hpp
    )

target_include_directories(json
    PUBLIC
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
    )

R module-utils/json/json11.cpp => third-party/json/json11.cpp +0 -0
R module-utils/json/json11.hpp => third-party/json/json11.hpp +0 -0
M third-party/re2/CMakeLists.txt => third-party/re2/CMakeLists.txt +1 -1
@@ 4,4 4,4 @@ target_compile_definitions(re2 PUBLIC RE2_USE_RTOS_WRAPPER)

target_compile_options (re2 PRIVATE -Wno-missing-field-initializers)

target_link_libraries(re2 PUBLIC module-os)
target_link_libraries(re2 PUBLIC module-os log)

M tools/run_unittests.sh => tools/run_unittests.sh +15 -3
@@ 1,4 1,4 @@
#!/bin/bash -e
#!/bin/bash
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md



@@ 27,6 27,8 @@ if [[ $# -ne 1 ]]; then
    exit 1
fi

source ${root_dir}/config/common_scripsts_lib

TESTS_FILE=$1

if [[ ! -r ${TESTS_FILE} ]]; then


@@ 50,8 52,18 @@ do
    do
        CUR_TEST=$( trim ${TESTS[$I]}) 
        if [[ -n "${CUR_TEST}" ]]; then
            echo ${TEST_BINARY} \"${CUR_TEST}\"
            ./${TEST_BINARY} "${CUR_TEST}" | tee ${run_logs}
            echo -en "${TEST_BINARY} \"${CUR_TEST}\":"
            ./${TEST_BINARY} "${CUR_TEST}" --use-colour=yes > ${run_logs}
            RESULT=$?

            if [[ ${RESULT} -eq 0 ]]; then
                echo -e "${OK}"
            else
                echo -e "${ERROR}"
                cat ${run_logs}
                exit 1
            fi

            CHK_IF_RUN=`cat ${run_logs} | grep "No tests ran" || true` 
            echo "---$CHK_IF_RUN---"
            if [[ -n "${CHK_IF_RUN}" ]]; then