M module-apps/application-alarm-clock/models/AlarmsRepository.cpp => module-apps/application-alarm-clock/models/AlarmsRepository.cpp +1 -1
@@ 3,7 3,7 @@
#include "AlarmsRepository.hpp"
#include <service-time/include/service-time/AlarmMessage.hpp>
-#include <service-time/Constants.hpp>
+#include <service-time/ServiceTimeName.hpp>
#include "AsyncTask.hpp"
#include "log/log.hpp"
M module-apps/application-call/include/application-call/ApplicationCall.hpp => module-apps/application-call/include/application-call/ApplicationCall.hpp +1 -1
@@ 7,7 7,7 @@
#include <application-call/presenter/CallPresenter.hpp>
#include <Timers/TimerHandle.hpp>
#include <service-cellular/CellularMessage.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-evtmgr/EVMessages.hpp>
#include <Service/Message.hpp>
#include <service-audio/AudioMessage.hpp>
M module-apps/application-call/model/CallModel.cpp => module-apps/application-call/model/CallModel.cpp +1 -1
@@ 5,7 5,7 @@
#include <service-cellular/service-cellular/CellularServiceAPI.hpp>
#include <service-evtmgr/service-evtmgr/EVMessages.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
namespace app::call
{
M module-apps/application-desktop/models/ActiveNotificationsListPresenter.cpp => module-apps/application-desktop/models/ActiveNotificationsListPresenter.cpp +3 -3
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ActiveNotificationsListPresenter.hpp"
@@ 10,12 10,12 @@
#include <gsl/assert>
#include <module-db/queries/notifications/QueryNotificationsClear.hpp>
#include <queries/messages/threads/QueryThreadGetByNumber.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/Controller.hpp>
#include <service-appmgr/messages/SwitchRequest.hpp>
#include <service-time/include/service-time/AlarmServiceAPI.hpp>
#include <service-time/AlarmMessage.hpp>
-#include <service-time/Constants.hpp>
+#include <service-time/ServiceTimeName.hpp>
#include <apps-common/popups/data/AlarmPopupRequestParams.hpp>
using namespace gui;
M module-apps/application-onboarding/ApplicationOnBoarding.cpp => module-apps/application-onboarding/ApplicationOnBoarding.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ApplicationOnBoarding.hpp"
@@ 20,7 20,7 @@
#include <application-settings/windows/system/ChangeTimeZone.hpp>
#include <apps-common/locks/data/PhoneLockMessages.hpp>
#include <apps-common/locks/data/SimLockMessages.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/messages/GetCurrentDisplayLanguageResponse.hpp>
#include <service-db/agents/settings/SystemSettings.hpp>
#include <EventStore.hpp>
M module-apps/application-settings/ApplicationSettings.cpp => module-apps/application-settings/ApplicationSettings.cpp +3 -3
@@ 67,6 67,7 @@
#include <service-audio/AudioServiceAPI.hpp>
#include <service-bluetooth/BluetoothMessage.hpp>
#include <service-bluetooth/Constants.hpp>
+#include <service-bluetooth/ServiceBluetoothName.hpp>
#include <service-bluetooth/messages/BondedDevices.hpp>
#include <service-bluetooth/messages/BluetoothModeChanged.hpp>
#include <service-bluetooth/messages/Connect.hpp>
@@ 76,12 77,11 @@
#include <service-bluetooth/messages/Status.hpp>
#include <service-bluetooth/messages/Unpair.hpp>
#include <service-bluetooth/messages/Disconnect.hpp>
-#include <service-cellular/Constans.hpp>
#include <service-db/Settings.hpp>
#include <service-db/agents/settings/SystemSettings.hpp>
-#include <module-services/service-appmgr/include/service-appmgr/Constants.hpp>
+#include <module-services/service-appmgr/include/service-appmgr/ServiceApplicationManagerName.hpp>
#include <module-services/service-evtmgr/service-evtmgr/ScreenLightControlMessage.hpp>
-#include <module-services/service-evtmgr/service-evtmgr/Constants.hpp>
+#include <module-services/service-evtmgr/service-evtmgr/ServiceEventManagerName.hpp>
#include <module-services/service-evtmgr/service-evtmgr/EVMessages.hpp>
#include <service-appmgr/messages/Message.hpp>
#include <service-appmgr/model/ApplicationManagerCommon.hpp>
M module-apps/application-settings/models/bluetooth/BluetoothSettingsModel.cpp => module-apps/application-settings/models/bluetooth/BluetoothSettingsModel.cpp +2 -4
@@ 1,18 1,16 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "BluetoothSettingsModel.hpp"
-#include <service-bluetooth/Constants.hpp>
+#include <service-bluetooth/ServiceBluetoothName.hpp>
#include <service-bluetooth/messages/BondedDevices.hpp>
#include <service-bluetooth/messages/Connect.hpp>
#include <service-bluetooth/messages/DeviceName.hpp>
#include <service-bluetooth/messages/Disconnect.hpp>
#include <service-bluetooth/messages/SetStatus.hpp>
#include <service-bluetooth/messages/SetDeviceName.hpp>
-#include <service-bluetooth/messages/Authenticate.hpp>
#include <service-bluetooth/messages/Unpair.hpp>
-#include <service-bluetooth/messages/SyncDevices.hpp>
BluetoothSettingsModel::BluetoothSettingsModel(sys::Service *service) : service{service}
{}
M module-apps/application-settings/models/display-keypad/DisplayModeModel.cpp => module-apps/application-settings/models/display-keypad/DisplayModeModel.cpp +2 -2
@@ 1,11 1,11 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "DisplayModeModel.hpp"
#include <AsyncTask.hpp>
-#include <service-eink/Common.hpp>
+#include <service-eink/ServiceEinkName.hpp>
#include <service-eink/api/ServiceEinkApi.hpp>
#include <service-eink/messages/EinkModeMessage.hpp>
M module-apps/application-settings/models/network/ApnSettingsModel.cpp => module-apps/application-settings/models/network/ApnSettingsModel.cpp +3 -3
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ApnSettingsModel.hpp"
@@ 9,7 9,7 @@ ApnSettingsModel::ApnSettingsModel(app::ApplicationCommon *application) : applic
void ApnSettingsModel::requestAPNList()
{
- application->bus.sendUnicast(std::make_shared<cellular::GetAPNMessage>(), ServiceCellular::serviceName);
+ application->bus.sendUnicast(std::make_shared<cellular::GetAPNMessage>(), service::name::cellular);
}
void ApnSettingsModel::saveAPN(const std::shared_ptr<packet_data::APN::Config> &apn)
@@ 30,5 30,5 @@ void ApnSettingsModel::removeAPN(const std::shared_ptr<packet_data::APN::Config>
void ApnSettingsModel::setAsDefaultAPN(const std::shared_ptr<packet_data::APN::Config> &apn)
{
apn->apnType = packet_data::APN::APNType::Default;
- application->bus.sendUnicast(std::make_shared<cellular::SetAPNMessage>(apn), ServiceCellular::serviceName);
+ application->bus.sendUnicast(std::make_shared<cellular::SetAPNMessage>(apn), service::name::cellular);
}
M module-apps/application-settings/models/network/SimContactsRepository.cpp => module-apps/application-settings/models/network/SimContactsRepository.cpp +1 -1
@@ 111,7 111,7 @@ void SimContactsRepository::read(AbstractSimContactsRepository::OnReadCallback r
[&](const std::vector<cellular::SimContact> &simData) { updateImportedRecords(simData); };
auto msg = std::make_unique<cellular::GetSimContactsRequest>();
- auto task = app::AsyncRequest::createFromMessage(std::move(msg), cellular::service::name);
+ auto task = app::AsyncRequest::createFromMessage(std::move(msg), ::service::name::cellular);
auto cb = [callback, readDoneCallback](auto response) {
auto result = dynamic_cast<cellular::GetSimContactsResponse *>(response);
if (result != nullptr && result->retCode == sys::ReturnCodes::Success) {
M module-apps/application-settings/models/system/TechnicalInformationRepository.cpp => module-apps/application-settings/models/system/TechnicalInformationRepository.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "TechnicalInformationRepository.hpp"
@@ 15,7 15,7 @@ void TechnicalInformationRepository::readImei(AbstractTechnicalInformationReposi
std::function<void(const std::string &imei)> callback = [&](const std::string &imei) { imeiStr = imei; };
auto msg = std::make_unique<cellular::GetImeiRequest>();
- auto task = app::AsyncRequest::createFromMessage(std::move(msg), cellular::service::name);
+ auto task = app::AsyncRequest::createFromMessage(std::move(msg), ::service::name::cellular);
auto cb = [callback, readDoneCallback](auto response) {
auto result = dynamic_cast<cellular::GetImeiResponse *>(response);
if (result != nullptr && result->retCode == sys::ReturnCodes::Success) {
M module-apps/application-settings/windows/advanced/ColorTestWindow.cpp => module-apps/application-settings/windows/advanced/ColorTestWindow.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ColorTestWindow.hpp"
@@ 6,7 6,7 @@
#include <application-settings/widgets/advanced/ColorTestListStyle.hpp>
#include <application-settings/windows/WindowNames.hpp>
-#include <service-gui/Common.hpp>
+#include <service-gui/ServiceGUIName.hpp>
#include <service-gui/messages/ChangeColorScheme.hpp>
namespace gui
M module-apps/application-settings/windows/system/ChangeDateAndTimeWindow.cpp => module-apps/application-settings/windows/system/ChangeDateAndTimeWindow.cpp +2 -2
@@ 1,11 1,11 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ChangeDateAndTimeWindow.hpp"
#include <InputEvent.hpp>
#include <ListView.hpp>
-#include <service-time/Constants.hpp>
+#include <service-time/ServiceTimeName.hpp>
#include <service-time/service-time/TimeMessage.hpp>
#include <widgets/DateAndTimeStyle.hpp>
M module-apps/application-settings/windows/system/ChangeTimeZone.cpp => module-apps/application-settings/windows/system/ChangeTimeZone.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ChangeTimeZone.hpp"
@@ 6,7 6,7 @@
#include <application-settings/windows/WindowNames.hpp>
#include <OptionSetting.hpp>
-#include <service-time/Constants.hpp>
+#include <service-time/ServiceTimeName.hpp>
#include <service-time/api/TimeSettingsApi.hpp>
#include <service-time/service-time/TimeMessage.hpp>
#include <time/TimeZone.hpp>
M module-apps/application-settings/windows/system/DateAndTimeMainWindow.cpp => module-apps/application-settings/windows/system/DateAndTimeMainWindow.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "DateAndTimeMainWindow.hpp"
@@ 6,7 6,7 @@
#include <application-settings/windows/WindowNames.hpp>
#include <OptionSetting.hpp>
-#include <service-time/Constants.hpp>
+#include <service-time/ServiceTimeName.hpp>
#include <service-time/api/TimeSettingsApi.hpp>
#include <service-time/service-time/TimeMessage.hpp>
M module-apps/apps-common/ApplicationCommon.cpp => module-apps/apps-common/ApplicationCommon.cpp +2 -2
@@ 10,7 10,7 @@
#include "actions/AlarmClockStatusChangeParams.hpp"
#include <service-cellular/CellularMessage.hpp>
#include <service-desktop/DesktopMessages.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-evtmgr/EVMessages.hpp>
#include <service-appmgr/messages/DOMRequest.hpp>
#include <service-appmgr/data/NotificationsChangedActionsParams.hpp>
@@ 19,7 19,7 @@
#include "DOMResponder.hpp"
#include <WindowsStack.hpp>
#include <WindowsPopupFilter.hpp>
-#include <service-gui/Common.hpp>
+#include <service-gui/ServiceGUIName.hpp>
#include <service-db/Settings.hpp>
#include <service-db/agents/settings/SystemSettings.hpp>
M module-apps/apps-common/locks/handlers/PhoneLockSubject.cpp => module-apps/apps-common/locks/handlers/PhoneLockSubject.cpp +2 -2
@@ 1,11 1,11 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "PhoneLockSubject.hpp"
#include "AlarmEventRecord.hpp"
#include "time/dateCommon.hpp"
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <locks/data/PhoneLockMessages.hpp>
namespace locks
M module-apps/apps-common/locks/handlers/SimLockSubject.cpp => module-apps/apps-common/locks/handlers/SimLockSubject.cpp +2 -2
@@ 1,11 1,11 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "SimLockSubject.hpp"
#include <apps-common/locks/data/PhoneLockMessages.hpp>
#include <apps-common/locks/data/SimLockMessages.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
namespace locks
{
M => +2 -2
@@ 1,8 1,8 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "BluetoothAuthenticatePopup.hpp"
#include <service-bluetooth/ServiceBluetoothName.hpp>
#include <ApplicationCommon.hpp>
#include <i18n/i18n.hpp>
M => +1 -1
@@ 3,7 3,7 @@
#include "AlarmPresenter.hpp"
#include "Constants.hpp"
#include "service-time/Constants.hpp"
#include "service-time/ServiceTimeName.hpp"
#include "service-time/AlarmMessage.hpp"
#include "time/dateCommon.hpp"
M => +2 -2
@@ 1,8 1,8 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "WallpaperPresenter.hpp"
#include <service-appmgr/Constants.hpp>
#include <service-appmgr/ServiceApplicationManagerName.hpp>
namespace gui
{
M module-bluetooth/Bluetooth/CommandHandler.cpp => module-bluetooth/Bluetooth/CommandHandler.cpp +1 -1
@@ 10,7 10,7 @@
#include "Device.hpp"
-#include <service-desktop/Constants.hpp>
+#include <service-desktop/ServiceDesktopName.hpp>
#include <service-bluetooth/messages/ResponseVisibleDevices.hpp>
#include "GAP/GAP.hpp"
M module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DP.cpp => module-bluetooth/Bluetooth/interface/profiles/A2DP/A2DP.cpp +2 -2
@@ 10,10 10,10 @@
#include <log/log.hpp>
#include <Audio/AudioCommon.hpp>
#include <service-audio/AudioMessage.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include "service-bluetooth/messages/Connect.hpp"
#include "service-bluetooth/messages/Disconnect.hpp"
-#include "service-bluetooth/Constants.hpp"
+#include "service-bluetooth/ServiceBluetoothName.hpp"
#include <audio/BluetoothAudioDevice.hpp>
extern "C"
M module-bluetooth/Bluetooth/interface/profiles/A2DP/AVRCP.cpp => module-bluetooth/Bluetooth/interface/profiles/A2DP/AVRCP.cpp +1 -1
@@ 4,7 4,7 @@
#include "AVRCP.hpp"
#include <service-audio/AudioServiceName.hpp>
-#include <service-bluetooth/Constants.hpp>
+#include <service-bluetooth/ServiceBluetoothName.hpp>
#include <service-bluetooth/messages/AudioVolume.hpp>
#include <service-bluetooth/messages/AudioNotify.hpp>
M module-bluetooth/Bluetooth/interface/profiles/GAP/GAP.cpp => module-bluetooth/Bluetooth/interface/profiles/GAP/GAP.cpp +1 -0
@@ 11,6 11,7 @@
#include <service-bluetooth/messages/Unpair.hpp>
#include <service-bluetooth/messages/Authenticate.hpp>
#include <service-bluetooth/Constants.hpp>
+#include <service-bluetooth/ServiceBluetoothName.hpp>
#include <log/log.hpp>
#include <memory>
extern "C"
M module-bluetooth/Bluetooth/interface/profiles/HFP/HFP.cpp => module-bluetooth/Bluetooth/interface/profiles/HFP/HFP.cpp +2 -1
@@ 6,12 6,13 @@
#include <Bluetooth/Result.hpp>
#include <log/log.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-audio/AudioMessage.hpp>
#include <service-bluetooth/messages/AudioVolume.hpp>
#include <service-bluetooth/messages/Connect.hpp>
#include <service-bluetooth/messages/Disconnect.hpp>
#include <service-bluetooth/messages/RequestStatusIndicatorData.hpp>
+#include <service-bluetooth/ServiceBluetoothName.hpp>
#include <BluetoothWorker.hpp>
#include "SCO/ScoUtils.hpp"
M module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp => module-bluetooth/Bluetooth/interface/profiles/HSP/HSP.cpp +2 -2
@@ 6,11 6,11 @@
#include "HSP.hpp"
#include <Bluetooth/Result.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <BluetoothWorker.hpp>
#include <module-bluetooth/Bluetooth/interface/profiles/SCO/ScoUtils.hpp>
#include <service-audio/AudioMessage.hpp>
-#include <service-bluetooth/Constants.hpp>
+#include <service-bluetooth/ServiceBluetoothName.hpp>
#include <service-bluetooth/messages/AudioVolume.hpp>
#include <service-bluetooth/messages/Connect.hpp>
#include <service-bluetooth/messages/Disconnect.hpp>
M module-bluetooth/Bluetooth/interface/profiles/PhoneInterface.cpp => module-bluetooth/Bluetooth/interface/profiles/PhoneInterface.cpp +1 -2
@@ 1,7 1,6 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
-#include <service-cellular/Constans.hpp>
#include "PhoneInterface.hpp"
#include "service-audio/AudioServiceAPI.hpp"
#include "service-cellular/CellularServiceAPI.hpp"
M module-bluetooth/Bluetooth/interface/profiles/SCO/SCO.cpp => module-bluetooth/Bluetooth/interface/profiles/SCO/SCO.cpp +1 -1
@@ 4,7 4,7 @@
#include "SCO.hpp"
#include <cstdio>
#include <Audio/AudioCommon.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-audio/AudioMessage.hpp>
#include <cassert>
extern "C"
M module-services/service-antenna/CMakeLists.txt => module-services/service-antenna/CMakeLists.txt +1 -0
@@ 9,6 9,7 @@ target_sources(service-antenna
include/service-antenna/AntennaServiceAPI.hpp
include/service-antenna/ServiceAntenna.hpp
include/service-antenna/ServiceState.hpp
+ include/service-antenna/ServiceAntennaName.hpp
)
target_link_libraries(service-antenna
M module-services/service-antenna/include/service-antenna/ServiceAntenna.hpp => module-services/service-antenna/include/service-antenna/ServiceAntenna.hpp +3 -8
@@ 1,20 1,15 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include "ServiceState.hpp"
-
+#include "ServiceAntennaDependencies.hpp"
#include <bsp/cellular/bsp_cellular.hpp>
#include <Timers/TimerHandle.hpp>
#include <service-db/DBServiceName.hpp>
#include <PhoneModes/Observer.hpp>
-namespace service::name
-{
- constexpr inline auto antenna = "ServiceAntenna";
-} // namespace service::name
-
namespace antenna
{
enum class State
@@ 101,7 96,7 @@ namespace sys
{
ServiceManifest manifest;
manifest.name = service::name::antenna;
- manifest.dependencies = {service::name::db};
+ manifest.dependencies = sys::dependencies::getDependenciesFor<ServiceAntenna>();
return manifest;
}
};
A module-services/service-antenna/include/service-antenna/ServiceAntennaDependencies.hpp => module-services/service-antenna/include/service-antenna/ServiceAntennaDependencies.hpp +29 -0
@@ 0,0 1,29 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include <service-evtmgr/ServiceEventManagerDependencies.hpp>
+#include <service-antenna/ServiceAntennaName.hpp>
+#include <string>
+#include <vector>
+
+class ServiceAntenna;
+
+namespace sys::dependencies
+{
+
+ template <>
+ inline std::vector<std::string> getDependenciesFor<ServiceAntenna>()
+ {
+ return sys::dependencies::getDependenciesTo<EventManager>();
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesTo<ServiceAntenna>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<ServiceAntenna>();
+ dependencies.push_back(service::name::antenna);
+ return dependencies;
+ }
+} // namespace sys::dependencies
R module-services/service-cellular/service-cellular/Constans.hpp => module-services/service-antenna/include/service-antenna/ServiceAntennaName.hpp +3 -5
@@ 1,11 1,9 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
-#include <service-cellular/api/common.hpp>
-
namespace service::name
{
- inline constexpr auto cellular = cellular::service::name;
-};
+ constexpr inline auto antenna = "ServiceAntenna";
+} // namespace service::name
M module-services/service-appmgr/CMakeLists.txt => module-services/service-appmgr/CMakeLists.txt +1 -1
@@ 32,7 32,7 @@ target_sources(service-appmgr
PUBLIC
include/service-appmgr/Actions.hpp
include/service-appmgr/ApplicationManifest.hpp
- include/service-appmgr/Constants.hpp
+ include/service-appmgr/ServiceApplicationManagerName.hpp
include/service-appmgr/Controller.hpp
include/service-appmgr/StartupType.hpp
include/service-appmgr/data/CallActionsParams.hpp
M module-services/service-appmgr/Controller.cpp => module-services/service-appmgr/Controller.cpp +1 -1
@@ 7,7 7,7 @@
#include "GetAllNotificationsRequest.hpp"
#include <Service/Service.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <utility>
R module-services/service-appmgr/include/service-appmgr/Constants.hpp => module-services/service-appmgr/include/service-appmgr/ServiceApplicationManagerName.hpp +0 -0
M module-services/service-appmgr/include/service-appmgr/model/ApplicationManagerCommon.hpp => module-services/service-appmgr/include/service-appmgr/model/ApplicationManagerCommon.hpp +2 -2
@@ 24,8 24,8 @@
#include <service-db/DBServiceName.hpp>
#include <service-db/Settings.hpp>
-#include <service-gui/Common.hpp>
-#include <service-eink/Common.hpp>
+#include <service-gui/ServiceGUIName.hpp>
+#include <service-eink/ServiceEinkName.hpp>
#include <notifications/NotificationProvider.hpp>
#include <apps-common/notifications/NotificationsHandler.hpp>
M module-services/service-appmgr/model/ApplicationManagerCommon.cpp => module-services/service-appmgr/model/ApplicationManagerCommon.cpp +2 -2
@@ 19,8 19,8 @@
#include <service-audio/AudioMessage.hpp>
#include <service-db/agents/settings/SystemSettings.hpp>
#include <Utils.hpp>
-#include <service-appmgr/Constants.hpp>
-#include <service-desktop/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
+#include <service-desktop/ServiceDesktopName.hpp>
#include <service-eink/ServiceEink.hpp>
#include <service-evtmgr/EventManagerCommon.hpp>
#include <AppWindowConstants.hpp>
M module-services/service-audio/ServiceAudio.cpp => module-services/service-audio/ServiceAudio.cpp +1 -1
@@ 9,7 9,7 @@
#include <module-audio/Audio/VolumeScaler.hpp>
#include <system/messages/SentinelRegistrationMessage.hpp>
#include <service-bluetooth/BluetoothMessage.hpp>
-#include <service-bluetooth/Constants.hpp>
+#include <service-bluetooth/ServiceBluetoothName.hpp>
#include <service-bluetooth/messages/AudioNotify.hpp>
#include <service-db/Settings.hpp>
#include <service-evtmgr/EventManagerServiceAPI.hpp>
M module-services/service-audio/include/service-audio/ServiceAudio.hpp => module-services/service-audio/include/service-audio/ServiceAudio.hpp +2 -2
@@ 4,7 4,7 @@
#pragma once
#include "AudioMessage.hpp"
-#include "service-audio/AudioServiceName.hpp"
+#include "service-audio/ServiceAudioDependencies.hpp"
#include <Audio/Audio.hpp>
#include <Audio/AudioMux.hpp>
@@ 144,7 144,7 @@ namespace sys
{
ServiceManifest manifest;
manifest.name = service::name::audio;
- manifest.dependencies = {service::name::db};
+ manifest.dependencies = sys::dependencies::getDependenciesFor<ServiceAudio>();
return manifest;
}
};
A module-services/service-audio/include/service-audio/ServiceAudioDependencies.hpp => module-services/service-audio/include/service-audio/ServiceAudioDependencies.hpp +47 -0
@@ 0,0 1,47 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include "service-audio/AudioServiceName.hpp"
+#include <service-db/ServiceDBDependencies.hpp>
+#include <string>
+#include <vector>
+
+class ServiceAudio;
+namespace service
+{
+ class Audio;
+}
+
+namespace sys::dependencies
+{
+
+ template <>
+ inline std::vector<std::string> getDependenciesFor<ServiceAudio>()
+ {
+ return sys::dependencies::getDependenciesTo<ServiceDB>();
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesTo<ServiceAudio>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<ServiceAudio>();
+ dependencies.push_back(service::name::audio);
+ return dependencies;
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesFor<service::Audio>()
+ {
+ return sys::dependencies::getDependenciesTo<ServiceDB>();
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesTo<service::Audio>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<service::Audio>();
+ dependencies.push_back(service::name::audio);
+ return dependencies;
+ }
+} // namespace sys::dependencies
M module-services/service-bluetooth/Constants.hpp => module-services/service-bluetooth/Constants.hpp +1 -6
@@ 1,13 1,8 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
-namespace service::name
-{
- inline constexpr auto bluetooth = "ServiceBluetooth";
-} // namespace service::name
-
namespace sys::bluetooth
{
enum class BluetoothMode
M module-services/service-bluetooth/ServiceBluetooth.cpp => module-services/service-bluetooth/ServiceBluetooth.cpp +1 -1
@@ 521,7 521,7 @@ void ServiceBluetooth::handleTurnOn()
auto ServiceBluetooth::handle(message::bluetooth::RequestStatusIndicatorData *msg) -> std::shared_ptr<sys::Message>
{
- bus.sendUnicast(std::make_shared<cellular::RequestCurrentOperatorNameMessage>(), cellular::service::name);
+ bus.sendUnicast(std::make_shared<cellular::RequestCurrentOperatorNameMessage>(), service::name::cellular);
// just to execute proper handle method and sending it back to worker
bus.sendUnicast(std::make_shared<cellular::SignalStrengthUpdateNotification>(), service::name::bluetooth);
M module-services/service-bluetooth/service-bluetooth/ServiceBluetooth.hpp => module-services/service-bluetooth/service-bluetooth/ServiceBluetooth.hpp +2 -1
@@ 10,6 10,7 @@
#include "Service/Mailbox.hpp"
#include "service-bluetooth/SettingsHolder.hpp"
#include "service-bluetooth/WorkerLock.hpp"
+#include "service-bluetooth/ServiceBluetoothDependencies.hpp"
#include <service-db/DBServiceName.hpp>
#include <service-audio/ServiceAudio.hpp>
#include <module-bluetooth/Bluetooth/CommandHandler.hpp>
@@ 158,7 159,7 @@ namespace sys
{
ServiceManifest manifest;
manifest.name = service::name::bluetooth;
- manifest.dependencies = {service::name::db, service::name::audio};
+ manifest.dependencies = sys::dependencies::getDependenciesFor<ServiceBluetooth>();
return manifest;
}
};
A module-services/service-bluetooth/service-bluetooth/ServiceBluetoothDependencies.hpp => module-services/service-bluetooth/service-bluetooth/ServiceBluetoothDependencies.hpp +29 -0
@@ 0,0 1,29 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include <service-audio/ServiceAudioDependencies.hpp>
+#include <service-bluetooth/ServiceBluetoothName.hpp>
+#include <string>
+#include <vector>
+
+class ServiceBluetooth;
+
+namespace sys::dependencies
+{
+
+ template <>
+ inline std::vector<std::string> getDependenciesFor<ServiceBluetooth>()
+ {
+ return sys::dependencies::getDependenciesTo<ServiceAudio>();
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesTo<ServiceBluetooth>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<ServiceBluetooth>();
+ dependencies.push_back(service::name::bluetooth);
+ return dependencies;
+ }
+} // namespace sys::dependencies
A module-services/service-bluetooth/service-bluetooth/ServiceBluetoothName.hpp => module-services/service-bluetooth/service-bluetooth/ServiceBluetoothName.hpp +9 -0
@@ 0,0 1,9 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+namespace service::name
+{
+ inline constexpr auto bluetooth = "ServiceBluetooth";
+} // namespace service::name
M module-services/service-cellular/CellularRequestHandler.cpp => module-services/service-cellular/CellularRequestHandler.cpp +1 -1
@@ 25,7 25,7 @@
#include <service-cellular/src/ServiceCellularPriv.hpp>
#include <service-cellular/src/ussd/USSDHandler.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-audio/AudioServiceAPI.hpp>
M module-services/service-cellular/CellularServiceAPI.cpp => module-services/service-cellular/CellularServiceAPI.cpp +36 -36
@@ 24,20 24,20 @@ namespace sys
bool CellularServiceAPI::DialNumber(sys::Service *serv, const utils::PhoneNumber &number)
{
auto msg = std::make_shared<cellular::CallRequestMessage>(number.getView());
- return serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(msg, service::name::cellular);
}
bool CellularServiceAPI::DialEmergencyNumber(sys::Service *serv, const utils::PhoneNumber &number)
{
auto msg = std::make_shared<cellular::CallRequestMessage>(number.getView(), cellular::api::CallMode::Emergency);
- return serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(msg, service::name::cellular);
}
bool CellularServiceAPI::AnswerIncomingCall(sys::Service *serv)
{
auto msg = std::make_shared<cellular::AnswerIncomingCallMessage>();
- return serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(msg, service::name::cellular);
}
bool CellularServiceAPI::HangupCall(sys::Service *serv)
@@ 52,7 52,7 @@ std::string CellularServiceAPI::GetIMSI(sys::Service *serv, bool getFullIMSINumb
auto msg = std::make_shared<cellular::GetIMSIMessage>();
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 5000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 5000);
cellular::ResponseMessage *response = dynamic_cast<cellular::ResponseMessage *>(ret.second.get());
if (response == nullptr) {
@@ 86,31 86,31 @@ void CellularServiceAPI::SubscribeForOwnNumber(sys::Service *serv, std::function
void CellularServiceAPI::RequestForOwnNumber(sys::Service *serv)
{
- serv->bus.sendUnicast(std::make_shared<cellular::GetOwnNumberMessage>(), ServiceCellular::serviceName);
+ serv->bus.sendUnicast(std::make_shared<cellular::GetOwnNumberMessage>(), service::name::cellular);
}
void CellularServiceAPI::GetNetworkInfo(sys::Service *serv)
{
auto msg = std::make_shared<cellular::GetNetworkInfoMessage>();
- serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ serv->bus.sendUnicast(msg, service::name::cellular);
}
void CellularServiceAPI::RequestCurrentOperatorName(sys::Service *serv)
{
auto msg = std::make_shared<cellular::RequestCurrentOperatorNameMessage>();
- serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ serv->bus.sendUnicast(msg, service::name::cellular);
}
void CellularServiceAPI::StartOperatorsScan(sys::Service *serv, bool fullInfo)
{
auto msg = std::make_shared<cellular::StartOperatorsScanMessage>(fullInfo);
- serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ serv->bus.sendUnicast(msg, service::name::cellular);
}
void CellularServiceAPI::SetOperatorAutoSelect(sys::Service *serv)
{
auto msg = std::make_shared<cellular::SetOperatorAutoSelectMessage>();
- serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ serv->bus.sendUnicast(msg, service::name::cellular);
}
void CellularServiceAPI::SetOperator(sys::Service *serv,
@@ 119,14 119,14 @@ void CellularServiceAPI::SetOperator(sys::Service *serv,
const std::string &name)
{
auto msg = std::make_shared<cellular::SetOperatorMessage>(mode, format, name);
- serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ serv->bus.sendUnicast(msg, service::name::cellular);
}
bool CellularServiceAPI::SelectAntenna(sys::Service *serv, bsp::cellular::antenna antenna)
{
auto msg = std::make_shared<cellular::AntennaRequestMessage>();
msg->antenna = antenna;
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 5000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 5000);
auto *response = dynamic_cast<cellular::ResponseMessage *>(ret.second.get());
@@ 142,7 142,7 @@ bool CellularServiceAPI::SelectAntenna(sys::Service *serv, bsp::cellular::antenn
bool CellularServiceAPI::SetScanMode(sys::Service *serv, std::string mode)
{
auto msg = std::make_shared<cellular::SetScanModeMessage>(mode);
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 5000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 5000);
auto *response = dynamic_cast<cellular::ResponseMessage *>(ret.second.get());
@@ 156,7 156,7 @@ bool CellularServiceAPI::SetScanMode(sys::Service *serv, std::string mode)
bool CellularServiceAPI::GetScanMode(sys::Service *serv)
{
auto msg = std::make_shared<cellular::GetScanModeMessage>();
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 1000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 1000);
auto *response = dynamic_cast<cellular::ResponseMessage *>(ret.second.get());
@@ 171,7 171,7 @@ bool CellularServiceAPI::GetScanMode(sys::Service *serv)
bool CellularServiceAPI::GetFirmwareVersion(sys::Service *serv, std::string &response)
{
auto msg = std::make_shared<cellular::GetFirmwareVersionMessage>();
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 1000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 1000);
if (ret.first == sys::ReturnCodes::Success) {
auto celResponse = std::dynamic_pointer_cast<cellular::ResponseMessage>(ret.second);
if ((celResponse != nullptr) && (celResponse->retCode == true)) {
@@ 187,7 187,7 @@ bool CellularServiceAPI::GetCSQ(sys::Service *serv, std::string &response)
{
auto msg = std::make_shared<cellular::GetCsqMessage>();
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 5000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 5000);
if (ret.first == sys::ReturnCodes::Success) {
auto responseMsg = std::dynamic_pointer_cast<cellular::ResponseMessage>(ret.second);
if ((responseMsg != nullptr) && (responseMsg->retCode == true)) {
@@ 200,7 200,7 @@ bool CellularServiceAPI::GetCSQ(sys::Service *serv, std::string &response)
bool CellularServiceAPI::GetCREG(sys::Service *serv, std::string &response)
{
auto msg = std::make_shared<cellular::GetCregMessage>();
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 5000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 5000);
if (ret.first == sys::ReturnCodes::Success) {
auto responseMsg = std::dynamic_pointer_cast<cellular::ResponseMessage>(ret.second);
if ((responseMsg != nullptr) && (responseMsg->retCode == true)) {
@@ 213,7 213,7 @@ bool CellularServiceAPI::GetCREG(sys::Service *serv, std::string &response)
bool CellularServiceAPI::GetQNWINFO(sys::Service *serv, std::string &response)
{
auto msg = std::make_shared<cellular::GetNwinfoMessage>();
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 5000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 5000);
if (ret.first == sys::ReturnCodes::Success) {
auto responseMsg = std::dynamic_pointer_cast<cellular::ResponseMessage>(ret.second);
if ((responseMsg != nullptr) && (responseMsg->retCode == true)) {
@@ 227,7 227,7 @@ bool CellularServiceAPI::GetQNWINFO(sys::Service *serv, std::string &response)
bool CellularServiceAPI::GetAntenna(sys::Service *serv, bsp::cellular::antenna &response)
{
auto msg = std::make_shared<cellular::GetAntennaMessage>();
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 5000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 5000);
if (ret.first == sys::ReturnCodes::Success) {
auto responseMsg = std::dynamic_pointer_cast<cellular::AntennaResponseMessage>(ret.second);
if ((responseMsg != nullptr) && (responseMsg->retCode == true)) {
@@ 241,7 241,7 @@ bool CellularServiceAPI::GetAntenna(sys::Service *serv, bsp::cellular::antenna &
bool CellularServiceAPI::IsCallInProgress(sys::Service *serv, bool &response)
{
auto msg = std::make_shared<cellular::IsCallActive>();
- auto ret = serv->bus.sendUnicastSync(msg, ServiceCellular::serviceName, 1000);
+ auto ret = serv->bus.sendUnicastSync(msg, service::name::cellular, 1000);
if (ret.first == sys::ReturnCodes::Success) {
auto celResponse = std::dynamic_pointer_cast<cellular::IsCallActiveResponse>(ret.second);
if ((celResponse != nullptr) && (celResponse->retCode == sys::ReturnCodes::Success)) {
@@ 256,101 256,101 @@ bool CellularServiceAPI::IsCallInProgress(sys::Service *serv, bool &response)
bool CellularServiceAPI::TransmitDtmfTones(sys::Service *serv, DTMFCode code)
{
auto msg = std::make_shared<cellular::DtmfRequestMessage>(code);
- return serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(msg, service::name::cellular);
}
bool CellularServiceAPI::USSDRequest(sys::Service *serv, cellular::USSDMessage::RequestType type, std::string data)
{
auto msg = std::make_shared<cellular::USSDMessage>(type, data);
- return serv->bus.sendUnicast(msg, ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(msg, service::name::cellular);
;
}
bool CellularServiceAPI::GetAPN(sys::Service *serv)
{
- return serv->bus.sendUnicast(std::make_shared<cellular::GetAPNMessage>(), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::make_shared<cellular::GetAPNMessage>(), service::name::cellular);
}
bool CellularServiceAPI::GetAPN(sys::Service *serv, std::uint8_t contextId)
{
- return serv->bus.sendUnicast(std::make_shared<cellular::GetAPNMessage>(contextId), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::make_shared<cellular::GetAPNMessage>(contextId), service::name::cellular);
}
bool CellularServiceAPI::GetAPN(sys::Service *serv, packet_data::APN::APNType type)
{
- return serv->bus.sendUnicast(std::make_shared<cellular::GetAPNMessage>(type), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::make_shared<cellular::GetAPNMessage>(type), service::name::cellular);
}
bool CellularServiceAPI::SetAPN(sys::Service *serv, packet_data::APN::Config apnConfig)
{
auto apn = std::make_shared<packet_data::APN::Config>(std::move(apnConfig));
- return serv->bus.sendUnicast(std::make_shared<cellular::SetAPNMessage>(apn), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::make_shared<cellular::SetAPNMessage>(apn), service::name::cellular);
}
bool CellularServiceAPI::NewAPN(sys::Service *serv, packet_data::APN::Config apnConfig)
{
auto apn = std::make_shared<packet_data::APN::Config>(std::move(apnConfig));
- return serv->bus.sendUnicast(std::make_shared<cellular::NewAPNMessage>(apn), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::make_shared<cellular::NewAPNMessage>(apn), service::name::cellular);
}
bool CellularServiceAPI::DeleteAPN(sys::Service *serv, std::uint8_t contextId)
{
auto emptyApn = std::make_shared<packet_data::APN::Config>();
emptyApn->contextId = contextId;
- return serv->bus.sendUnicast(std::make_shared<cellular::SetAPNMessage>(emptyApn), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::make_shared<cellular::SetAPNMessage>(emptyApn), service::name::cellular);
}
bool CellularServiceAPI::SetDataTransfer(sys::Service *serv, packet_data::DataTransfer dt)
{
- return serv->bus.sendUnicast(std::make_shared<cellular::SetDataTransferMessage>(dt), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::make_shared<cellular::SetDataTransferMessage>(dt), service::name::cellular);
}
bool CellularServiceAPI::GetDataTransfer(sys::Service *serv)
{
- return serv->bus.sendUnicast(std::make_shared<cellular::GetDataTransferMessage>(), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::make_shared<cellular::GetDataTransferMessage>(), service::name::cellular);
}
bool CellularServiceAPI::ChangeModulePowerState(sys::Service *serv, cellular::service::State::PowerState newState)
{
- return serv->bus.sendUnicast(std::make_shared<cellular::PowerStateChange>(newState), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::make_shared<cellular::PowerStateChange>(newState), service::name::cellular);
}
bool CellularServiceAPI::SetFlightMode(sys::Service *serv, bool flightModeOn)
{
return serv->bus.sendUnicast(std::make_shared<cellular::SetFlightModeMessage>(flightModeOn),
- ServiceCellular::serviceName);
+ service::name::cellular);
}
bool CellularServiceAPI::SetConnectionFrequency(sys::Service *serv, uint8_t connectionFrequency)
{
return serv->bus.sendUnicast(std::make_shared<cellular::SetConnectionFrequencyMessage>(connectionFrequency),
- ServiceCellular::serviceName);
+ service::name::cellular);
}
bool CellularServiceAPI::CallAudioMuteEvent(sys::Service *serv)
{
return serv->bus.sendUnicast(
std::make_shared<cellular::CallAudioEventRequest>(cellular::CallAudioEventRequest::EventType::Mute),
- ServiceCellular::serviceName);
+ service::name::cellular);
}
bool CellularServiceAPI::CallAudioUnmuteEvent(sys::Service *serv)
{
return serv->bus.sendUnicast(
std::make_shared<cellular::CallAudioEventRequest>(cellular::CallAudioEventRequest::EventType::Unmute),
- ServiceCellular::serviceName);
+ service::name::cellular);
}
bool CellularServiceAPI::CallAudioLoudspeakerOnEvent(sys::Service *serv)
{
return serv->bus.sendUnicast(
std::make_shared<cellular::CallAudioEventRequest>(cellular::CallAudioEventRequest::EventType::LoudspeakerOn),
- ServiceCellular::serviceName);
+ service::name::cellular);
}
bool CellularServiceAPI::CallAudioLoudspeakerOffEvent(sys::Service *serv)
{
return serv->bus.sendUnicast(
std::make_shared<cellular::CallAudioEventRequest>(cellular::CallAudioEventRequest::EventType::LoudspeakerOff),
- ServiceCellular::serviceName);
+ service::name::cellular);
}
M module-services/service-cellular/CellularUrcHandler.cpp => module-services/service-cellular/CellularUrcHandler.cpp +2 -2
@@ 8,8 8,8 @@
#include "service-cellular/src/ussd/USSDHandler.hpp"
#include <service-antenna/AntennaServiceAPI.hpp>
-#include <service-appmgr/Constants.hpp>
-#include <service-time/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
+#include <service-time/ServiceTimeName.hpp>
using namespace at::urc;
M module-services/service-cellular/ServiceCellular.cpp => module-services/service-cellular/ServiceCellular.cpp +7 -9
@@ 64,13 64,13 @@
#include <service-antenna/AntennaMessage.hpp>
#include <service-antenna/AntennaServiceAPI.hpp>
#include <service-antenna/ServiceAntenna.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/Controller.hpp>
#include <service-db/agents/settings/SystemSettings.hpp>
#include <service-db/DBServiceAPI.hpp>
#include <service-db/DBNotificationMessage.hpp>
#include <service-db/QueryMessage.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-evtmgr/EventManagerServiceAPI.hpp>
#include <service-evtmgr/EVMessages.hpp>
#include <service-desktop/DesktopMessages.hpp>
@@ 93,7 93,7 @@
#include <utility>
#include <vector>
#include "checkSmsCenter.hpp"
-#include <service-desktop/Constants.hpp>
+#include <service-desktop/ServiceDesktopName.hpp>
#include <gsl/util>
#include <ticks.hpp>
@@ 105,8 105,6 @@
#include <at/cmd/QCFGUsbnet.hpp>
-const char *ServiceCellular::serviceName = cellular::service::name;
-
using namespace cellular;
using namespace cellular::msg;
using cellular::service::State;
@@ 123,7 121,7 @@ namespace constants
} // namespace constants
ServiceCellular::ServiceCellular()
- : sys::Service(serviceName, "", constants::cellularStack, sys::ServicePriority::Idle),
+ : sys::Service(::service::name::cellular, "", constants::cellularStack, sys::ServicePriority::Idle),
phoneModeObserver{std::make_unique<sys::phone_modes::Observer>()},
priv{std::make_unique<internal::ServiceCellularPriv>(this)}
{
@@ 223,7 221,7 @@ void ServiceCellular::CallStateTimerHandler()
{
LOG_DEBUG("CallStateTimerHandler");
auto msg = std::make_shared<cellular::ListCallsMessage>();
- bus.sendUnicast(std::move(msg), ServiceCellular::serviceName);
+ bus.sendUnicast(std::move(msg), ::service::name::cellular);
}
sys::ReturnCodes ServiceCellular::InitHandler()
@@ 260,7 258,7 @@ sys::ReturnCodes ServiceCellular::InitHandler()
settings->setValue(settings::Cellular::volteEnabled, "0", settings::SettingsScope::Global);
}
- cpuSentinel = std::make_shared<sys::CpuSentinel>(serviceName, this);
+ cpuSentinel = std::make_shared<sys::CpuSentinel>(::service::name::cellular, this);
ongoingCall =
std::make_unique<call::Call>(this,
@@ 551,7 549,7 @@ void ServiceCellular::registerMessageHandlers()
connect(typeid(cellular::SignalStrengthUpdateNotification), [&](sys::Message *request) -> sys::MessagePointer {
csqCounter.count();
auto message = std::make_shared<cellular::URCCounterMessage>(csqCounter.getCounter());
- bus.sendUnicast(std::move(message), serviceName);
+ bus.sendUnicast(std::move(message), ::service::name::cellular);
return handleSignalStrengthUpdateNotification(request);
});
M module-services/service-cellular/connection-manager/ConnectionManagerCellularCommands.cpp => module-services/service-cellular/connection-manager/ConnectionManagerCellularCommands.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <service-cellular/service-cellular/connection-manager/ConnectionManagerCellularCommands.hpp>
@@ 93,5 93,5 @@ void ConnectionManagerCellularCommands::holdMinimumCpuFrequency()
}
void ConnectionManagerCellularCommands::retryPhoneModeChange()
{
- cellular.bus.sendUnicast(std::make_shared<cellular::RetryPhoneModeChangeRequest>(), cellular.serviceName);
+ cellular.bus.sendUnicast(std::make_shared<cellular::RetryPhoneModeChangeRequest>(), service::name::cellular);
}
M module-services/service-cellular/include/service-cellular/api/common.hpp => module-services/service-cellular/include/service-cellular/api/common.hpp +1 -5
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
@@ 9,10 9,6 @@
namespace cellular
{
- namespace service
- {
- constexpr const char *name = "ServiceCellular";
- }
namespace api
{
M module-services/service-cellular/include/service-cellular/api/message.hpp => module-services/service-cellular/include/service-cellular/api/message.hpp +3 -2
@@ 1,9 1,10 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <Service/Message.hpp>
+#include <service-cellular/ServiceCellularName.hpp>
namespace cellular::msg
{
@@ 15,7 16,7 @@ namespace cellular::msg
}
private:
- static constexpr const char *m_target = cellular::service::name;
+ static constexpr const char *m_target = ::service::name::cellular;
};
struct Response : public sys::msg::Response
M module-services/service-cellular/service-cellular/ServiceCellular.hpp => module-services/service-cellular/service-cellular/ServiceCellular.hpp +3 -4
@@ 10,6 10,7 @@
#include "PacketDataCellularMessage.hpp"
#include <service-cellular/connection-manager/ConnectionManager.hpp>
#include "src/URCCounter.hpp"
+#include "ServiceCellularDependencies.hpp"
#include <modem/ATURCStream.hpp>
#include <modem/mux/DLCChannel.h>
@@ 78,8 79,6 @@ class ServiceCellular : public sys::Service
*/
void registerMessageHandlers();
- static const char *serviceName;
-
/**
* @brief Its getting selected SIM card own number.
* @param destination Reference to destination string.
@@ 311,8 310,8 @@ namespace sys
static auto GetManifest() -> ServiceManifest
{
ServiceManifest manifest;
- manifest.name = ServiceCellular::serviceName;
- manifest.dependencies = {service::name::db};
+ manifest.name = service::name::cellular;
+ manifest.dependencies = sys::dependencies::getDependenciesTo<ServiceCellular>();
return manifest;
}
};
A module-services/service-cellular/service-cellular/ServiceCellularDependencies.hpp => module-services/service-cellular/service-cellular/ServiceCellularDependencies.hpp +29 -0
@@ 0,0 1,29 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include <service-antenna/ServiceAntennaDependencies.hpp>
+#include <service-cellular/ServiceCellularName.hpp>
+#include <string>
+#include <vector>
+
+class ServiceCellular;
+
+namespace sys::dependencies
+{
+
+ template <>
+ inline std::vector<std::string> getDependenciesFor<ServiceCellular>()
+ {
+ return sys::dependencies::getDependenciesTo<ServiceAntenna>();
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesTo<ServiceCellular>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<ServiceCellular>();
+ dependencies.push_back(service::name::cellular);
+ return dependencies;
+ }
+} // namespace sys::dependencies
A module-services/service-cellular/service-cellular/ServiceCellularName.hpp => module-services/service-cellular/service-cellular/ServiceCellularName.hpp +9 -0
@@ 0,0 1,9 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+namespace service::name
+{
+ constexpr inline auto cellular = "ServiceCellular";
+} // namespace service::name
M module-services/service-cellular/src/ServiceCellularPriv.cpp => module-services/service-cellular/src/ServiceCellularPriv.cpp +2 -3
@@ 6,7 6,6 @@
#include "SMSPartsHandler.hpp"
#include <service-cellular-api>
-#include <service-cellular/Constans.hpp>
#include <service-db/agents/settings/SystemSettings.hpp>
@@ 18,7 17,7 @@
#include <service-bluetooth/messages/BluetoothModeChanged.hpp>
#include <locks/data/PhoneLockMessages.hpp>
#include <service-time/service-time/TimeMessage.hpp>
-#include <service-time/Constants.hpp>
+#include <service-time/ServiceTimeName.hpp>
#include <queries/messages/sms/QuerySMSUpdate.hpp>
#include <service-antenna/AntennaServiceAPI.hpp>
@@ 27,7 26,7 @@
#include <at/cmd/QCFGUsbnet.hpp>
#include <at/cmd/CSQ.hpp>
#include <ucs2/UCS2.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include "checkSmsCenter.hpp"
M module-services/service-cellular/src/State.cpp => module-services/service-cellular/src/State.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <service-cellular/State.hpp>
@@ 68,7 68,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.sendUnicast(msg, cellular::service::name);
+ owner->bus.sendUnicast(msg, ::service::name::cellular);
}
State::ST State::get() const
A module-services/service-db/include/service-db/ServiceDBDependencies.hpp => module-services/service-db/include/service-db/ServiceDBDependencies.hpp +26 -0
@@ 0,0 1,26 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include <service-db/DBServiceName.hpp>
+#include <Service/ServiceDependencies.hpp>
+
+#include <string>
+#include <vector>
+
+class ServiceDB;
+
+namespace sys::dependencies
+{
+ template <>
+ inline std::vector<std::string> getDependenciesFor<ServiceDB>()
+ {
+ return {};
+ }
+ template <>
+ inline std::vector<std::string> getDependenciesTo<ServiceDB>()
+ {
+ return {service::name::db};
+ }
+} // namespace sys::dependencies
M module-services/service-desktop/CMakeLists.txt => module-services/service-desktop/CMakeLists.txt +2 -0
@@ 33,6 33,8 @@ target_sources(
include/service-desktop/OutboxNotifications.hpp
include/service-desktop/ServiceDesktop.hpp
include/service-desktop/USBSecurityModel.hpp
+ include/service-desktop/ServiceDesktopName.hpp
+ include/service-desktop/ServiceDesktopDependencies.hpp
)
target_include_directories(
M module-services/service-desktop/ServiceDesktop.cpp => module-services/service-desktop/ServiceDesktop.cpp +9 -8
@@ 4,7 4,7 @@
#include <service-desktop/ServiceDesktop.hpp>
#include <endpoints/EndpointFactory.hpp>
#include <endpoints/bluetooth/BluetoothMessagesHandler.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-evtmgr/EventManagerCommon.hpp>
#include <service-evtmgr/EVMessages.hpp>
#include <system/messages/TetheringStateRequest.hpp>
@@ 200,14 200,15 @@ auto ServiceDesktop::usbWorkerInit() -> sys::ReturnCodes
auto ServiceDesktop::usbWorkerDeinit() -> sys::ReturnCodes
{
- if (initialized) {
- LOG_DEBUG(".. usbWorkerDeinit ..");
- settings->deinit();
- desktopWorker->closeWorker();
- desktopWorker.reset();
- initialized = false;
- isUsbConfigured = false;
+ if (!initialized) {
+ return sys::ReturnCodes::Success;
}
+ LOG_DEBUG("Deinitializing USB worker");
+ settings->deinit();
+ desktopWorker->closeWorker();
+ desktopWorker.reset();
+ initialized = false;
+ isUsbConfigured = false;
return sys::ReturnCodes::Success;
}
M module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.cpp => module-services/service-desktop/endpoints/developerMode/DeveloperModeHelper.cpp +6 -6
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <endpoints/developerMode/DeveloperModeHelper.hpp>
@@ 7,7 7,7 @@
#include <endpoints/JsonKeyNames.hpp>
#include <endpoints/message/Sender.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-cellular/CellularMessage.hpp>
#include <service-cellular/ServiceCellular.hpp>
#include <service-bluetooth/messages/Status.hpp>
@@ 65,7 65,7 @@ namespace sdesktop::endpoints
LOG_DEBUG("at request sent with timeout >%d<", int(timeout.count()));
auto event = std::make_unique<ATResponseEvent>(cmd, timeout);
auto msg = std::make_shared<DeveloperModeRequest>(std::move(event));
- code = toCode(owner->bus.sendUnicast(msg, ServiceCellular::serviceName));
+ code = toCode(owner->bus.sendUnicast(msg, service::name::cellular));
return {sent::delayed, std::nullopt};
}
else if (body[json::developerMode::EQ].is_string()) {
@@ 307,7 307,7 @@ namespace sdesktop::endpoints
else if (cellularState == 3) {
auto event = std::make_unique<sdesktop::developerMode::CellularHotStartEvent>();
auto msg = std::make_shared<sdesktop::developerMode::DeveloperModeRequest>(std::move(event));
- res = owner->bus.sendUnicast(std::move(msg), ServiceCellular::serviceName);
+ res = owner->bus.sendUnicast(std::move(msg), service::name::cellular);
}
return res;
}
@@ 356,14 356,14 @@ namespace sdesktop::endpoints
{
auto event = std::make_unique<sdesktop::developerMode::CellularStateInfoRequestEvent>();
auto msg = std::make_shared<sdesktop::developerMode::DeveloperModeRequest>(std::move(event));
- return serv->bus.sendUnicast(std::move(msg), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::move(msg), service::name::cellular);
}
bool DeveloperModeHelper::requestCellularSleepModeInfo(sys::Service *serv)
{
auto event = std::make_unique<sdesktop::developerMode::CellularSleepModeInfoRequestEvent>();
auto msg = std::make_shared<sdesktop::developerMode::DeveloperModeRequest>(std::move(event));
- return serv->bus.sendUnicast(std::move(msg), ServiceCellular::serviceName);
+ return serv->bus.sendUnicast(std::move(msg), service::name::cellular);
}
} // namespace sdesktop::endpoints
M module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.cpp => module-services/service-desktop/endpoints/developerMode/Mode/UI_Helper.cpp +3 -3
@@ 1,11 1,11 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <endpoints/developerMode/Mode/UI_Helper.hpp>
#include <log/log.hpp>
-#include "service-desktop/Constants.hpp"
+#include "service-desktop/ServiceDesktopName.hpp"
#include "service-desktop/DeveloperModeMessage.hpp"
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/messages/DOMRequest.hpp>
namespace sdesktop::endpoints
M module-services/service-desktop/endpoints/security/SecurityEndpointHelper.cpp => module-services/service-desktop/endpoints/security/SecurityEndpointHelper.cpp +1 -1
@@ 4,7 4,7 @@
#include <endpoints/security/SecurityEndpointHelper.hpp>
#include <endpoints/message/Sender.hpp>
#include <endpoints/JsonKeyNames.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/messages/PreventBlockingRequest.hpp>
#include <service-desktop/ServiceDesktop.hpp>
#include <apps-common/locks/data/PhoneLockMessages.hpp>
M module-services/service-desktop/include/service-desktop/Constants.hpp => module-services/service-desktop/include/service-desktop/Constants.hpp +1 -5
@@ 1,14 1,10 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <string>
-namespace service::name
-{
- inline constexpr auto service_desktop = "ServiceDesktop";
-}
namespace sdesktop::paths
{
inline constexpr auto updateFilename = "update.tar";
M module-services/service-desktop/include/service-desktop/ServiceDesktop.hpp => module-services/service-desktop/include/service-desktop/ServiceDesktop.hpp +3 -2
@@ 5,6 5,8 @@
#include <bsp/usb/usb.hpp>
#include "Constants.hpp"
+#include "ServiceDesktopName.hpp"
+#include "ServiceDesktopDependencies.hpp"
#include "USBSecurityModel.hpp"
#include "DeveloperModeMessage.hpp"
#include "DesktopMessages.hpp"
@@ 12,7 14,6 @@
#include <service-bluetooth/messages/Status.hpp>
#include <service-bluetooth/messages/BondedDevices.hpp>
#include <service-bluetooth/messages/ResponseVisibleDevices.hpp>
-#include <service-db/DBServiceName.hpp>
#include <service-desktop/Sync.hpp>
#include <service-desktop/OutboxNotifications.hpp>
#include <service-evtmgr/BatteryMessages.hpp>
@@ 149,7 150,7 @@ namespace sys
{
ServiceManifest manifest;
manifest.name = service::name::service_desktop;
- manifest.dependencies = {service::name::db};
+ manifest.dependencies = sys::dependencies::getDependenciesFor<ServiceDesktop>();
return manifest;
}
};
A module-services/service-desktop/include/service-desktop/ServiceDesktopDependencies.hpp => module-services/service-desktop/include/service-desktop/ServiceDesktopDependencies.hpp +30 -0
@@ 0,0 1,30 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include "ServiceDesktopName.hpp"
+#include <service-eink/ServiceEinkDependencies.hpp>
+#include <string>
+#include <vector>
+
+class ServiceDesktop;
+
+namespace sys::dependencies
+{
+
+ template <>
+ inline std::vector<std::string> getDependenciesFor<ServiceDesktop>()
+ {
+ return sys::dependencies::getDependenciesTo<service::eink::ServiceEink>();
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesTo<ServiceDesktop>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<ServiceDesktop>();
+ dependencies.push_back(service::name::service_desktop);
+ return dependencies;
+ }
+
+} // namespace sys::dependencies
A module-services/service-desktop/include/service-desktop/ServiceDesktopName.hpp => module-services/service-desktop/include/service-desktop/ServiceDesktopName.hpp +9 -0
@@ 0,0 1,9 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+namespace service::name
+{
+ inline constexpr auto service_desktop = "ServiceDesktop";
+}
D module-services/service-eink/Common.hpp => module-services/service-eink/Common.hpp +0 -13
@@ 1,13 0,0 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
-// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
-
-#pragma once
-
-namespace service
-{
- namespace name
- {
- constexpr inline auto eink = "ServiceEink";
- } // namespace name
-
-} // namespace service
M module-services/service-eink/ServiceEink.hpp => module-services/service-eink/ServiceEink.hpp +2 -3
@@ 19,8 19,7 @@
#include <string>
#include <module-services/service-eink/messages/EinkModeMessage.hpp>
#include <hal/eink/AbstractEinkDisplay.hpp>
-
-#include "Common.hpp"
+#include "service-eink/ServiceEinkDependencies.hpp"
namespace service::eink
{
@@ 109,7 108,7 @@ namespace sys
{
ServiceManifest manifest;
manifest.name = service::name::eink;
- manifest.dependencies = {service::name::db};
+ manifest.dependencies = sys::dependencies::getDependenciesTo<service::eink::ServiceEink>();
return manifest;
}
};
A module-services/service-eink/ServiceEinkDependencies.hpp => module-services/service-eink/ServiceEinkDependencies.hpp +32 -0
@@ 0,0 1,32 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include <service-evtmgr/ServiceEventManagerDependencies.hpp>
+#include <service-eink/ServiceEinkName.hpp>
+#include <string>
+#include <vector>
+
+namespace service::eink
+{
+ class ServiceEink;
+}
+
+namespace sys::dependencies
+{
+
+ template <>
+ inline std::vector<std::string> getDependenciesFor<service::eink::ServiceEink>()
+ {
+ return sys::dependencies::getDependenciesTo<EventManager>();
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesTo<service::eink::ServiceEink>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<service::eink::ServiceEink>();
+ dependencies.push_back(service::name::eink);
+ return dependencies;
+ }
+} // namespace sys::dependencies
A module-services/service-eink/ServiceEinkName.hpp => module-services/service-eink/ServiceEinkName.hpp +9 -0
@@ 0,0 1,9 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+namespace service::name
+{
+ constexpr inline auto eink = "ServiceEink";
+} // namespace service::name
M module-services/service-evtmgr/EventManager.cpp => module-services/service-evtmgr/EventManager.cpp +4 -4
@@ 4,7 4,7 @@
#include "service-evtmgr/BatteryMessages.hpp"
#include "service-evtmgr/EVMessages.hpp"
#include "service-evtmgr/KbdMessage.hpp"
-#include "service-evtmgr/Constants.hpp"
+#include "service-evtmgr/ServiceEventManagerName.hpp"
#include "service-evtmgr/EventManagerCommon.hpp"
#include "service-evtmgr/WorkerEventCommon.hpp"
#include "service-evtmgr/AppSettingsNotify.hpp"
@@ 24,12 24,12 @@
#include <service-audio/AudioMessage.hpp>
#include <service-audio/AudioServiceAPI.hpp>
#include <service-db/DBNotificationMessage.hpp>
-#include <service-desktop/Constants.hpp>
+#include <service-desktop/ServiceDesktopName.hpp>
#include <service-desktop/DesktopMessages.hpp>
-#include <service-time/Constants.hpp>
+#include <service-time/ServiceTimeName.hpp>
#include <service-time/service-time/TimeMessage.hpp>
#include <service-bluetooth/messages/Status.hpp>
-#include <service-cellular/Constans.hpp>
+#include <service-bluetooth/ServiceBluetoothName.hpp>
#include <cassert>
#include <fstream>
M module-services/service-evtmgr/WorkerEventCommon.cpp => module-services/service-evtmgr/WorkerEventCommon.cpp +1 -1
@@ 3,7 3,7 @@
#include "service-evtmgr/EVMessages.hpp"
#include "service-evtmgr/KbdMessage.hpp"
-#include "service-evtmgr/Constants.hpp"
+#include "service-evtmgr/ServiceEventManagerName.hpp"
#include "service-evtmgr/WorkerEventCommon.hpp"
#include "battery/BatteryController.hpp"
M module-services/service-evtmgr/api/EventManagerServiceAPI.cpp => module-services/service-evtmgr/api/EventManagerServiceAPI.cpp +1 -1
@@ 3,7 3,7 @@
#include <service-evtmgr/EventManagerServiceAPI.hpp>
#include <service-evtmgr/EVMessages.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <MessageType.hpp>
#include <system/Common.hpp>
M module-services/service-evtmgr/battery/BatteryController.cpp => module-services/service-evtmgr/battery/BatteryController.cpp +2 -2
@@ 9,8 9,8 @@
#endif
#include <service-evtmgr/BatteryMessages.hpp>
-#include <service-evtmgr/Constants.hpp>
-#include <service-desktop/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
+#include <service-desktop/ServiceDesktopName.hpp>
#include <module-utils/EventStore/EventStore.hpp>
#include <log/log.hpp>
#include <magic_enum.hpp>
M module-services/service-evtmgr/service-evtmgr/EventManagerCommon.hpp => module-services/service-evtmgr/service-evtmgr/EventManagerCommon.hpp +1 -1
@@ 3,7 3,7 @@
#pragma once
-#include "Constants.hpp"
+#include "ServiceEventManagerName.hpp"
#include "EventManagerParams.hpp"
#include <hal/key_input/RawKey.hpp>
A module-services/service-evtmgr/service-evtmgr/ServiceEventManagerDependencies.hpp => module-services/service-evtmgr/service-evtmgr/ServiceEventManagerDependencies.hpp +30 -0
@@ 0,0 1,30 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include "ServiceEventManagerName.hpp"
+#include <service-db/ServiceDBDependencies.hpp>
+
+#include <string>
+#include <vector>
+
+class EventManager;
+
+namespace sys::dependencies
+{
+
+ template <>
+ inline std::vector<std::string> getDependenciesFor<EventManager>()
+ {
+ return sys::dependencies::getDependenciesTo<ServiceDB>();
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesTo<EventManager>()
+ {
+ auto dependencies = getDependenciesFor<EventManager>();
+ dependencies.push_back(service::name::evt_manager);
+ return dependencies;
+ }
+} // namespace sys::dependencies
R module-services/service-evtmgr/service-evtmgr/Constants.hpp => module-services/service-evtmgr/service-evtmgr/ServiceEventManagerName.hpp +0 -0
M module-services/service-fileindexer/CMakeLists.txt => module-services/service-fileindexer/CMakeLists.txt +2 -1
@@ 7,10 7,11 @@ target_sources( service-fileindexer
ServiceFileIndexer.cpp
StartupIndexer.cpp
PUBLIC
- include/service-fileindexer/Constants.hpp
+ include/service-fileindexer/ServiceFileIndexerName.hpp
include/service-fileindexer/InotifyHandler.hpp
include/service-fileindexer/ServiceFileIndexer.hpp
include/service-fileindexer/StartupIndexer.hpp
+ include/service-fileindexer/ServiceFileIndexerDependencies.hpp
)
target_include_directories( service-fileindexer
M module-services/service-fileindexer/ServiceFileIndexer.cpp => module-services/service-fileindexer/ServiceFileIndexer.cpp +8 -2
@@ 1,9 1,9 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <service-fileindexer/ServiceFileIndexer.hpp>
-#include <service-fileindexer/Constants.hpp>
+#include <service-fileindexer/ServiceFileIndexerName.hpp>
#include <log/log.hpp>
#include <purefs/filesystem_paths.hpp>
@@ 22,6 22,11 @@ namespace service
LOG_DEBUG("[%s] Initializing", service::name::file_indexer);
}
+ ServiceFileIndexer::~ServiceFileIndexer()
+ {
+ LOG_INFO("[%s] Cleaning resources", service::name::file_indexer);
+ }
+
sys::MessagePointer ServiceFileIndexer::DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp)
{
return sys::msgNotHandled();
@@ 43,6 48,7 @@ namespace service
sys::ReturnCodes ServiceFileIndexer::DeinitHandler()
{
+ LOG_DEBUG("[%s] Deitializing", service::name::file_indexer);
return sys::ReturnCodes::Success;
}
M module-services/service-fileindexer/StartupIndexer.cpp => module-services/service-fileindexer/StartupIndexer.cpp +2 -2
@@ 1,9 1,9 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "Common.hpp"
#include <service-fileindexer/StartupIndexer.hpp>
-#include <service-fileindexer/Constants.hpp>
+#include <service-fileindexer/ServiceFileIndexerName.hpp>
#include <Timers/TimerFactory.hpp>
#include <purefs/filesystem_paths.hpp>
M module-services/service-fileindexer/include/service-fileindexer/ServiceFileIndexer.hpp => module-services/service-fileindexer/include/service-fileindexer/ServiceFileIndexer.hpp +6 -4
@@ 1,11 1,12 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, 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 "Constants.hpp"
+#include "ServiceFileIndexerDependencies.hpp"
+#include "ServiceFileIndexerName.hpp"
#include "StartupIndexer.hpp"
#include "InotifyHandler.hpp"
@@ 16,7 17,7 @@ namespace service
{
public:
explicit ServiceFileIndexer(const std::vector<std::string> &paths);
- virtual ~ServiceFileIndexer() = default;
+ ~ServiceFileIndexer() override;
ServiceFileIndexer(const ServiceFileIndexer &) = delete;
ServiceFileIndexer &operator=(const ServiceFileIndexer &) = delete;
sys::MessagePointer DataReceivedHandler(sys::DataMessage *msg, sys::ResponseMessage *resp) override;
@@ 40,7 41,8 @@ namespace sys
static auto GetManifest() -> ServiceManifest
{
ServiceManifest manifest;
- manifest.name = service::name::file_indexer;
+ manifest.name = service::name::file_indexer;
+ manifest.dependencies = sys::dependencies::getDependenciesFor<service::ServiceFileIndexer>();
return manifest;
}
};
A module-services/service-fileindexer/include/service-fileindexer/ServiceFileIndexerDependencies.hpp => module-services/service-fileindexer/include/service-fileindexer/ServiceFileIndexerDependencies.hpp +31 -0
@@ 0,0 1,31 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include <service-db/ServiceDBDependencies.hpp>
+#include <service-fileindexer/ServiceFileIndexerName.hpp>
+#include <string>
+#include <vector>
+
+namespace service
+{
+ class ServiceFileIndexer;
+}
+
+namespace sys::dependencies
+{
+
+ template <>
+ inline std::vector<std::string> getDependenciesFor<service::ServiceFileIndexer>()
+ {
+ return sys::dependencies::getDependenciesTo<ServiceDB>();
+ }
+ template <>
+ inline std::vector<std::string> getDependenciesTo<service::ServiceFileIndexer>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<service::ServiceFileIndexer>();
+ dependencies.push_back(service::name::file_indexer);
+ return dependencies;
+ }
+} // namespace sys::dependencies
R module-services/service-fileindexer/include/service-fileindexer/Constants.hpp => module-services/service-fileindexer/include/service-fileindexer/ServiceFileIndexerName.hpp +0 -1
@@ 2,7 2,6 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
-#include <string>
namespace service::name
{
M module-services/service-gui/CMakeLists.txt => module-services/service-gui/CMakeLists.txt +1 -1
@@ 10,7 10,7 @@ target_sources(service-gui
WorkerGUI.cpp
messages/DrawMessage.cpp
INTERFACE
- service-gui/Common.hpp
+ service-gui/ServiceGUIName.hpp
service-gui/ServiceGUI.hpp
service-gui/messages/ChangeColorScheme.hpp
service-gui/messages/DrawMessage.hpp
M module-services/service-gui/ServiceGUI.cpp => module-services/service-gui/ServiceGUI.cpp +22 -10
@@ 11,7 11,7 @@
#include <FontManager.hpp>
#include <gui/core/ImageManager.hpp>
#include <log/log.hpp>
-#include <service-eink/Common.hpp>
+#include <service-eink/ServiceEinkName.hpp>
#include <service-eink/messages/ImageMessage.hpp>
#include <service-eink/messages/EinkMessage.hpp>
#include <service-eink/messages/PrepareDisplayEarlyRequest.hpp>
@@ 98,12 98,12 @@ namespace service::gui
void ServiceGUI::ProcessCloseReason(sys::CloseReason closeReason)
{
- if (not isDisplaying and not isRendering) {
+ if (isInState(ServiceGUIState::Idle)) {
sendCloseReadyMessage(this);
return;
}
else {
- isClosing = true;
+ setState(ServiceGUIState::Closing);
}
}
@@ 145,7 145,7 @@ namespace service::gui
void ServiceGUI::notifyRenderer(std::list<std::unique_ptr<::gui::DrawCommand>> &&commands,
::gui::RefreshModes refreshMode)
{
- isRendering = true;
+ setState(ServiceGUIState::Rendering);
enqueueDrawCommands(DrawCommandsQueue::QueueItem{std::move(commands), refreshMode});
worker->notify(WorkerGUI::Signal::Render);
}
@@ 172,12 172,11 @@ namespace service::gui
sys::MessagePointer ServiceGUI::handleGUIRenderingFinished(sys::Message *message)
{
- isRendering = false;
auto finishedMsg = static_cast<service::gui::RenderingFinished *>(message);
const auto contextId = finishedMsg->getContextId();
auto refreshMode = finishedMsg->getRefreshMode();
- if (not isDisplaying) {
+ if (not isInState(ServiceGUIState::Displaying)) {
if (cache.isRenderCached()) {
refreshMode = getMaxRefreshMode(cache.getCachedRender()->refreshMode, refreshMode);
cache.invalidate();
@@ 201,8 200,7 @@ namespace service::gui
void ServiceGUI::sendOnDisplay(::gui::Context *context, int contextId, ::gui::RefreshModes refreshMode)
{
- isDisplaying = true;
-
+ setState(ServiceGUIState::Displaying);
auto msg = std::make_shared<service::eink::ImageMessage>(contextId, context, refreshMode);
bus.sendUnicast(std::move(msg), service::name::eink);
scheduleContextRelease(contextId);
@@ 229,7 227,6 @@ namespace service::gui
sys::MessagePointer ServiceGUI::handleImageDisplayedNotification(sys::Message *message)
{
- isDisplaying = false;
const auto msg = static_cast<eink::ImageDisplayedNotification *>(message);
const auto contextId = msg->getContextId();
contextPool->returnContext(contextId);
@@ 240,9 237,12 @@ namespace service::gui
if (isNextFrameReady() and not isAnyFrameBeingRenderedOrDisplayed()) {
trySendNextFrame();
}
- else if (isClosing) {
+ else if (isInState(ServiceGUIState::Closing)) {
sendCloseReadyMessage(this);
}
+ else {
+ setState(ServiceGUIState::Idle);
+ }
return sys::MessageNone{};
}
@@ 264,4 264,16 @@ namespace service::gui
}
cache.invalidate();
}
+
+ void ServiceGUI::setState(const ServiceGUIState &nextState)
+ {
+ if (isInState(ServiceGUIState::Closing)) {
+ return;
+ }
+ state = nextState;
+ }
+ bool ServiceGUI::isInState(const ServiceGUIState &serviceState)
+ {
+ return state == serviceState;
+ }
} // namespace service::gui
M module-services/service-gui/messages/DrawMessage.cpp => module-services/service-gui/messages/DrawMessage.cpp +2 -2
@@ 1,9 1,9 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <messages/DrawMessage.hpp>
#include <messages/GUIMessage.hpp>
-#include <Common.hpp>
+#include <ServiceGUIName.hpp>
#include <DrawCommand.hpp>
namespace service::gui
M module-services/service-gui/service-gui/ServiceGUI.hpp => module-services/service-gui/service-gui/ServiceGUI.hpp +14 -7
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
@@ 7,13 7,12 @@
#include "DrawCommandsQueue.hpp"
#include "RenderCache.hpp"
#include "messages/RenderingFinished.hpp"
-#include "Common.hpp"
+#include "ServiceGUIDependencies.hpp"
#include <system/Common.hpp>
#include <Service/Message.hpp>
#include <Service/Service.hpp>
#include <Timers/TimerHandle.hpp>
-#include <service-eink/Common.hpp>
#include <cstdint>
#include <memory>
@@ 33,6 32,14 @@ namespace service::gui
{
friend WorkerGUI;
+ enum class ServiceGUIState
+ {
+ Displaying,
+ Rendering,
+ Closing,
+ Idle
+ };
+
public:
explicit ServiceGUI(::gui::Size displaySize,
const std::string &name = service::name::gui,
@@ 47,9 54,7 @@ namespace service::gui
sys::ReturnCodes SwitchPowerModeHandler(const sys::ServicePowerMode mode) override;
private:
- bool isRendering{};
- bool isDisplaying{};
- bool isClosing{};
+ ServiceGUIState state = ServiceGUIState::Idle;
static void initAssetManagers();
void registerMessageHandlers();
@@ 64,6 69,8 @@ namespace service::gui
bool isNextFrameReady() const noexcept;
bool isAnyFrameBeingRenderedOrDisplayed() const noexcept;
void trySendNextFrame();
+ void setState(const ServiceGUIState &nextState);
+ bool isInState(const ServiceGUIState &serviceState);
sys::MessagePointer handleDrawMessage(sys::Message *message);
sys::MessagePointer handleGUIRenderingFinished(sys::Message *message);
@@ 89,7 96,7 @@ namespace sys
{
ServiceManifest manifest;
manifest.name = service::name::gui;
- manifest.dependencies = {service::name::eink};
+ manifest.dependencies = sys::dependencies::getDependenciesFor<service::gui::ServiceGUI>();
return manifest;
}
};
A module-services/service-gui/service-gui/ServiceGUIDependencies.hpp => module-services/service-gui/service-gui/ServiceGUIDependencies.hpp +30 -0
@@ 0,0 1,30 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include <service-desktop/ServiceDesktopDependencies.hpp>
+#include <service-gui/ServiceGUIName.hpp>
+#include <string>
+#include <vector>
+
+namespace service::gui
+{
+ class ServiceGUI;
+}
+namespace sys::dependencies
+{
+ template <>
+ inline std::vector<std::string> getDependenciesFor<service::gui::ServiceGUI>()
+ {
+ return sys::dependencies::getDependenciesTo<ServiceDesktop>();
+ }
+
+ template <>
+ inline std::vector<std::string> getDependenciesTo<service::gui::ServiceGUI>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<service::gui::ServiceGUI>();
+ dependencies.push_back(service::name::gui);
+ return dependencies;
+ }
+} // namespace sys::dependencies
R module-services/service-gui/service-gui/Common.hpp => module-services/service-gui/service-gui/ServiceGUIName.hpp +0 -0
M module-services/service-time/AlarmServiceAPI.cpp => module-services/service-time/AlarmServiceAPI.cpp +1 -1
@@ 1,7 1,7 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
-#include "Constants.hpp"
+#include "ServiceTimeName.hpp"
#include <service-time/AlarmMessage.hpp>
#include <service-time/AlarmServiceAPI.hpp>
M module-services/service-time/ServiceTime.cpp => module-services/service-time/ServiceTime.cpp +1 -2
@@ 2,7 2,6 @@
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ServiceTime.hpp"
-#include "service-evtmgr/Constants.hpp"
#include "service-evtmgr/EVMessages.hpp"
#include <service-time/internal/StaticData.hpp>
#include <service-time/RTCCommand.hpp>
@@ 226,7 225,7 @@ namespace stm
}
bus.sendUnicast(std::make_shared<stm::message::AutomaticDateAndTimeChangedMessage>(message->getValue()),
- ServiceCellular::serviceName);
+ service::name::cellular);
return std::shared_ptr<sys::ResponseMessage>();
}
M module-services/service-time/ServiceTime.hpp => module-services/service-time/ServiceTime.hpp +2 -4
@@ 6,12 6,10 @@
#include "AlarmEventsDBRepository.hpp"
#include "AlarmOperations.hpp"
#include "AlarmMessageHandler.hpp"
-#include "Constants.hpp"
#include "service-time/TimeManager.hpp"
#include "service-time/ServiceTime.hpp"
-
-#include <service-db/DBServiceName.hpp>
#include <service-cellular/CellularServiceAPI.hpp>
+#include "service-time/ServiceTimeDependencies.hpp"
#include <MessageType.hpp>
#include <system/Common.hpp>
@@ 74,7 72,7 @@ namespace sys
{
ServiceManifest manifest;
manifest.name = service::name::service_time;
- manifest.dependencies = {service::name::db};
+ manifest.dependencies = sys::dependencies::getDependenciesFor<stm::ServiceTime>();
return manifest;
}
};
A module-services/service-time/ServiceTimeDependencies.hpp => module-services/service-time/ServiceTimeDependencies.hpp +30 -0
@@ 0,0 1,30 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include <service-db/ServiceDBDependencies.hpp>
+#include <service-time/ServiceTimeName.hpp>
+#include <string>
+#include <vector>
+
+namespace stm
+{
+ class ServiceTime;
+}
+
+namespace sys::dependencies
+{
+ template <>
+ inline std::vector<std::string> getDependenciesFor<stm::ServiceTime>()
+ {
+ return sys::dependencies::getDependenciesTo<ServiceDB>();
+ }
+ template <>
+ inline std::vector<std::string> getDependenciesTo<stm::ServiceTime>()
+ {
+ auto dependencies = sys::dependencies::getDependenciesFor<stm::ServiceTime>();
+ dependencies.push_back(service::name::service_time);
+ return dependencies;
+ }
+} // namespace sys::dependencies
R module-services/service-time/Constants.hpp => module-services/service-time/ServiceTimeName.hpp +0 -0
M module-sys/Service/CMakeLists.txt => module-sys/Service/CMakeLists.txt +1 -0
@@ 17,6 17,7 @@ target_sources(sys-service
include/Service/ServiceProxy.hpp
include/Service/Mailbox.hpp
include/Service/Message.hpp
+ include/Service/ServiceDependencies.hpp
PRIVATE
details/bus/Bus.cpp
M module-sys/Service/Worker.cpp => module-sys/Service/Worker.cpp +1 -1
@@ 298,7 298,7 @@ namespace sys
void Worker::close()
{
- if (!stop() || !join()) {
+ if (!stop() || !join()) { // timeout join
kill();
}
deinit();
A module-sys/Service/include/Service/ServiceDependencies.hpp => module-sys/Service/include/Service/ServiceDependencies.hpp +15 -0
@@ 0,0 1,15 @@
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
+// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
+
+#pragma once
+
+#include <string>
+#include <vector>
+
+namespace sys::dependencies
+{
+ template <class T>
+ std::vector<std::string> getDependenciesFor();
+ template <class T>
+ std::vector<std::string> getDependenciesTo();
+} // namespace sys::dependencies
M module-sys/SystemManager/SystemManagerCommon.cpp => module-sys/SystemManager/SystemManagerCommon.cpp +5 -6
@@ 13,15 13,14 @@
#include "Logger.hpp"
#include <service-evtmgr/KbdMessage.hpp>
#include <service-evtmgr/BatteryMessages.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-evtmgr/EventManagerServiceAPI.hpp>
#include <service-evtmgr/EVMessages.hpp>
#include <service-appmgr/messages/OnboardingPowerDownRequest.hpp>
#include <service-appmgr/messages/UserPowerDownRequest.hpp>
-#include <service-desktop/Constants.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-desktop/ServiceDesktopName.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/Controller.hpp>
-#include <service-cellular/Constans.hpp>
#include <system/messages/DeviceRegistrationMessage.hpp>
#include <system/messages/SentinelRegistrationMessage.hpp>
#include <system/messages/RequestCpuFrequencyMessage.hpp>
@@ 30,10 29,10 @@
#include "Timers/TimerFactory.hpp"
#include <service-appmgr/StartupType.hpp>
#include <purefs/vfs_subsystem.hpp>
-#include <service-gui/Common.hpp>
+#include <service-gui/ServiceGUIName.hpp>
#include <service-db/DBServiceName.hpp>
#include <module-gui/gui/Common.hpp>
-#include <service-eink/Common.hpp>
+#include <service-eink/ServiceEinkName.hpp>
#include <hal/boot_control.h>
#include <algorithm>
M products/BellHybrid/BellHybridMain.cpp => products/BellHybrid/BellHybridMain.cpp +2 -2
@@ 24,7 24,7 @@
#include <db/ServiceDB.hpp>
#include <evtmgr/EventManager.hpp>
#include <Service/ServiceCreator.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-desktop/ServiceDesktop.hpp>
#include <service-eink/ServiceEink.hpp>
#include <service-gui/ServiceGUI.hpp>
@@ 86,11 86,11 @@ int main()
/// 'purefs::dir::getUserMediaPath()'. Instead, we can only pass a specific app folder which is very limiting.
/// Hopefully, support for hierarchical folders will be added in the future and such a case won't be relevant
/// anymore.
- systemServices.emplace_back(sys::CreatorFor<ServiceDesktop>(paths::audio::userApp() / paths::audio::relaxation()));
systemServices.emplace_back(sys::CreatorFor<stm::ServiceTime>(std::make_shared<alarms::AlarmOperationsFactory>()));
systemServices.emplace_back(sys::CreatorFor<service::eink::ServiceEink>(service::eink::ExitAction::None));
systemServices.emplace_back(
sys::CreatorFor<service::gui::ServiceGUI>(gui::Size{BOARD_EINK_DISPLAY_RES_X, BOARD_EINK_DISPLAY_RES_Y}));
+ systemServices.emplace_back(sys::CreatorFor<ServiceDesktop>(paths::audio::userApp() / paths::audio::relaxation()));
auto sysmgr = std::make_shared<sys::SystemManager>(std::move(systemServices));
sysmgr->StartSystem(
M products/BellHybrid/alarms/src/actions/FrontlightAction.cpp => products/BellHybrid/alarms/src/actions/FrontlightAction.cpp +2 -2
@@ 1,10 1,10 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "FrontlightAction.hpp"
#include <service-evtmgr/ScreenLightControlMessage.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-db/Settings.hpp>
#include <db/SystemSettings.hpp>
M products/BellHybrid/alarms/src/actions/NotifyGUIAction.cpp => products/BellHybrid/alarms/src/actions/NotifyGUIAction.cpp +2 -2
@@ 1,10 1,10 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "NotifyGUIAction.hpp"
#include <apps-common/actions/AlarmTriggeredAction.hpp>
-#include <service-appmgr/include/service-appmgr/Constants.hpp>
+#include <service-appmgr/include/service-appmgr/ServiceApplicationManagerName.hpp>
namespace alarms
{
M products/BellHybrid/alarms/src/actions/NotifyGUIBedtimeReminderAction.cpp => products/BellHybrid/alarms/src/actions/NotifyGUIBedtimeReminderAction.cpp +2 -2
@@ 1,9 1,9 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "NotifyGUIBedtimeReminderAction.hpp"
-#include <service-appmgr/include/service-appmgr/Constants.hpp>
+#include <service-appmgr/include/service-appmgr/ServiceApplicationManagerName.hpp>
#include <appmgr/messages/AlarmMessage.hpp>
namespace alarms
M products/BellHybrid/apps/Application.cpp => products/BellHybrid/apps/Application.cpp +1 -1
@@ 13,7 13,7 @@
#include <common/popups/BellRebootWindow.hpp>
#include <common/windows/BellTurnOffWindow.hpp>
#include <common/windows/BellWelcomeWindow.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <common/popups/BedtimeNotificationWindow.hpp>
#include <apps-common/WindowsPopupFilter.hpp>
M products/BellHybrid/apps/application-bell-main/presenters/HomeScreenPresenter.cpp => products/BellHybrid/apps/application-bell-main/presenters/HomeScreenPresenter.cpp +1 -1
@@ 16,7 16,7 @@
#include <Timers/SystemTimer.hpp>
#include <Timers/TimerFactory.hpp>
#include <service-db/DBNotificationMessage.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <switches/LatchStatusRequest.hpp>
#include <bsp/trng/trng.hpp>
M products/BellHybrid/apps/application-bell-onboarding/ApplicationBellOnBoarding.cpp => products/BellHybrid/apps/application-bell-onboarding/ApplicationBellOnBoarding.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ApplicationBellOnBoarding.hpp"
@@ 14,7 14,7 @@
#include <windows/OnBoardingShortcutsOptionWindow.hpp>
#include <windows/OnBoardingShortcutsWindow.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/messages/GetCurrentDisplayLanguageResponse.hpp>
#include <apps-common/messages/OnBoardingMessages.hpp>
M products/BellHybrid/apps/application-bell-settings/models/DateTimeUnitsModel.cpp => products/BellHybrid/apps/application-bell-settings/models/DateTimeUnitsModel.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "models/DateTimeUnitsModel.hpp"
@@ 10,7 10,7 @@
#include <gui/widgets/ListViewEngine.hpp>
#include <gui/widgets/Style.hpp>
-#include <service-time/Constants.hpp>
+#include <service-time/ServiceTimeName.hpp>
#include <service-time/api/TimeSettingsApi.hpp>
#include <service-time/service-time/TimeMessage.hpp>
#include <widgets/DateSetSpinner.hpp>
M products/BellHybrid/apps/application-bell-settings/models/FrontlightModel.cpp => products/BellHybrid/apps/application-bell-settings/models/FrontlightModel.cpp +1 -1
@@ 5,7 5,7 @@
#include <apps-common/ApplicationCommon.hpp>
#include <service-evtmgr/screen-light-control/ScreenLightControl.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-evtmgr/ScreenLightControlMessage.hpp>
namespace app::bell_settings
M products/BellHybrid/apps/application-bell-settings/presenter/LayoutWindowPresenter.cpp => products/BellHybrid/apps/application-bell-settings/presenter/LayoutWindowPresenter.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "LayoutWindowPresenter.hpp"
@@ 9,7 9,7 @@
#include <EventStore.hpp>
#include <Temperature.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
constexpr auto alarmTime = 0;
constexpr auto clockTime = 0;
M products/BellHybrid/apps/application-bell-settings/presenter/TimeUnitsPresenter.cpp => products/BellHybrid/apps/application-bell-settings/presenter/TimeUnitsPresenter.cpp +1 -1
@@ 9,7 9,7 @@
#include <common/layouts/HomeScreenLayoutNames.hpp>
#include <appmgr/messages/ChangeHomescreenLayoutMessage.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
namespace
{
M products/BellHybrid/apps/application-bell-settings/windows/BellSettingsWindow.cpp => products/BellHybrid/apps/application-bell-settings/windows/BellSettingsWindow.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "AboutYourBellWindow.hpp"
@@ 15,7 15,7 @@
#include <common/popups/BellTurnOffOptionWindow.hpp>
#include <common/windows/BellFactoryReset.hpp>
#include <apps-common/windows/Dialog.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/messages/SwitchRequest.hpp>
namespace gui
M products/BellHybrid/apps/common/src/AlarmModel.cpp => products/BellHybrid/apps/common/src/AlarmModel.cpp +1 -1
@@ 8,7 8,7 @@
#include <time/dateCommon.hpp>
#include <service-time/AlarmServiceAPI.hpp>
#include <service-time/api/TimeSettingsApi.hpp>
-#include <service-time/Constants.hpp>
+#include <service-time/ServiceTimeName.hpp>
#include <service-time/AlarmMessage.hpp>
namespace app
M => +2 -3
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <ApplicationCommon.hpp>
@@ 10,8 10,7 @@
#include <gui/widgets/Icon.hpp>
#include <popups/Popups.hpp>
#include <service-appmgr/Controller.hpp>
#include <service-time/AlarmMessage.hpp>
#include <service-time/Constants.hpp>
#include <service-time/ServiceTimeName.hpp>
#include <application-bell-alarm/ApplicationBellAlarmNames.hpp>
#include <application-bell-main/ApplicationBellMain.hpp>
#include <WindowsStack.hpp>
M => +1 -4
@@ 1,9 1,8 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <ApplicationCommon.hpp>
#include <apps-common/messages/DialogMetadataMessage.hpp>
#include <apps-common/popups/data/PopupRequestParams.hpp>
#include <apps-common/popups/Popups.hpp>
#include <common/data/StyleCommon.hpp>
#include <common/popups/AlarmDeactivatedWindow.hpp>
@@ 11,8 10,6 @@
#include <gui/widgets/Icon.hpp>
#include <i18n/i18n.hpp>
#include <service-appmgr/Controller.hpp>
#include <service-time/AlarmMessage.hpp>
#include <service-time/Constants.hpp>
#include <application-bell-alarm/ApplicationBellAlarmNames.hpp>
#include <application-bell-main/ApplicationBellMain.hpp>
#include <WindowsStack.hpp>
M => +1 -1
@@ 10,7 10,7 @@
#include <common/windows/BellTurnOffWindow.hpp>
#include <i18n/i18n.hpp>
#include <options/OptionBellMenu.hpp>
#include <service-appmgr/Constants.hpp>
#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/messages/SwitchRequest.hpp>
#include <GuiTimer.hpp>
M products/BellHybrid/services/appmgr/ApplicationManager.cpp => products/BellHybrid/services/appmgr/ApplicationManager.cpp +1 -1
@@ 7,7 7,7 @@
#include <appmgr/messages/ChangeHomescreenLayoutMessage.hpp>
#include <application-bell-main/ApplicationBellMain.hpp>
#include <application-bell-onboarding/BellOnBoardingNames.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <common/windows/BellWelcomeWindow.hpp>
namespace app::manager
M products/BellHybrid/services/audio/ServiceAudio.cpp => products/BellHybrid/services/audio/ServiceAudio.cpp +6 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "ServiceAudio.hpp"
@@ 64,7 64,7 @@ namespace service
cpuSentinel(std::make_shared<sys::CpuSentinel>(audioServiceName, this)),
settingsProvider(std::make_unique<settings::Settings>())
{
- LOG_INFO("%s Initializing", audioServiceName);
+ LOG_INFO("[%s] Initializing", audioServiceName);
bus.channels.push_back(sys::BusChannel::ServiceAudioNotifications);
auto sentinelRegistrationMsg = std::make_shared<sys::SentinelRegistrationMessage>(cpuSentinel);
@@ 101,6 101,10 @@ namespace service
connect(typeid(AudioResumeRequest),
[this](sys::Message *msg) -> sys::MessagePointer { return handleResume(); });
}
+ Audio::~Audio()
+ {
+ LOG_INFO("[%s] Cleaning resources", audioServiceName);
+ }
sys::MessagePointer Audio::DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp)
{
return sys::msgNotHandled();
M products/BellHybrid/services/audio/include/audio/ServiceAudio.hpp => products/BellHybrid/services/audio/include/audio/ServiceAudio.hpp +4 -3
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
@@ 7,7 7,7 @@
#include <Audio/Audio.hpp>
#include <Audio/AudioMux.hpp>
#include <MessageType.hpp>
-#include <service-db/DBServiceName.hpp>
+#include <service-audio/ServiceAudioDependencies.hpp>
#include <Service/Service.hpp>
#include <SystemManager/CpuSentinel.hpp>
@@ 24,6 24,7 @@ namespace service
{
public:
Audio();
+ ~Audio() override;
sys::MessagePointer DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp = nullptr) final;
sys::ReturnCodes InitHandler() final;
@@ 81,7 82,7 @@ namespace sys
{
ServiceManifest manifest;
manifest.name = service::audioServiceName;
- manifest.dependencies = {service::name::db};
+ manifest.dependencies = sys::dependencies::getDependenciesFor<service::Audio>();
return manifest;
}
};
M products/BellHybrid/services/db/include/db/ServiceDB.hpp => products/BellHybrid/services/db/include/db/ServiceDB.hpp +5 -6
@@ 1,10 1,11 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <service-db/DBServiceName.hpp>
#include <service-db/ServiceDBCommon.hpp>
+#include <service-db/ServiceDBDependencies.hpp>
class AlarmEventRecordInterface;
class EventsDB;
@@ 40,11 41,9 @@ namespace sys
static auto GetManifest() -> ServiceManifest
{
ServiceManifest manifest;
- manifest.name = service::name::db;
-#if ENABLE_FILEINDEXER_SERVICE
- manifest.dependencies = {service::name::file_indexer.data()};
-#endif
- manifest.timeout = std::chrono::minutes{1};
+ manifest.name = service::name::db;
+ manifest.dependencies = sys::dependencies::getDependenciesFor<ServiceDB>();
+ manifest.timeout = std::chrono::minutes{1};
return manifest;
}
};
M products/BellHybrid/services/evtmgr/include/evtmgr/EventManager.hpp => products/BellHybrid/services/evtmgr/include/evtmgr/EventManager.hpp +3 -2
@@ 1,10 1,11 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <bsp/switches/LatchStatusRequest.hpp>
#include <service-evtmgr/EventManagerCommon.hpp>
+#include <service-evtmgr/ServiceEventManagerDependencies.hpp>
#include "backlight-handler/BacklightHandler.hpp"
#include "user-activity-handler/UserActivityHandler.hpp"
@@ 47,7 48,7 @@ namespace sys
{
ServiceManifest manifest;
manifest.name = service::name::evt_manager;
- manifest.dependencies = {service::name::db};
+ manifest.dependencies = sys::dependencies::getDependenciesFor<EventManager>();
return manifest;
}
};
M products/BellHybrid/sys/SystemManager.cpp => products/BellHybrid/sys/SystemManager.cpp +1 -1
@@ 7,7 7,7 @@
#include <system/messages/SystemManagerMessage.hpp>
#include <appmgr/messages/AlarmMessage.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
namespace sys
{
M products/PurePhone/PurePhoneMain.cpp => products/PurePhone/PurePhoneMain.cpp +2 -2
@@ 65,14 65,14 @@
#include <appmgr/ApplicationManager.hpp>
#include <db/ServiceDB.hpp>
#include <evtmgr/EventManager.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-audio/ServiceAudio.hpp>
#include <service-bluetooth/ServiceBluetooth.hpp>
#include <service-db/agents/quotes/QuotesAgent.hpp>
#include <service-time/ServiceTime.hpp>
#include <Service/ServiceCreator.hpp>
#include <service-gui/ServiceGUI.hpp>
-#include <service-gui/Common.hpp>
+#include <service-gui/ServiceGUIName.hpp>
#include <module-services/service-eink/ServiceEink.hpp>
#if ENABLE_SERVICE_FILEINDEXER
#include <service-fileindexer/ServiceFileIndexer.hpp>
M products/PurePhone/alarms/src/actions/NotifyGUIAction.cpp => products/PurePhone/alarms/src/actions/NotifyGUIAction.cpp +2 -2
@@ 1,11 1,11 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "NotifyGUIAction.hpp"
#include "log/log.hpp"
#include <apps-common/actions/AlarmTriggeredAction.hpp>
-#include <service-appmgr/include/service-appmgr/Constants.hpp>
+#include <service-appmgr/include/service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/Controller.hpp>
#include <apps-common/popups/data/AlarmPopupRequestParams.hpp>
M products/PurePhone/services/appmgr/ApplicationManager.cpp => products/PurePhone/services/appmgr/ApplicationManager.cpp +3 -3
@@ 13,7 13,7 @@
#include <module-services/service-cellular/service-cellular/VolteState.hpp>
#include <system/messages/TetheringQuestionRequest.hpp>
#include <Timers/TimerFactory.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-appmgr/messages/AutoLockRequests.hpp>
#include <service-appmgr/messages/GetAllNotificationsRequest.hpp>
#include <service-appmgr/messages/GetWallpaperOptionRequest.hpp>
@@ 21,9 21,9 @@
#include <service-cellular/CellularMessage.hpp>
#include <service-db/DBNotificationMessage.hpp>
#include <service-db/agents/settings/SystemSettings.hpp>
-#include <service-desktop/Constants.hpp>
+#include <service-desktop/ServiceDesktopName.hpp>
#include <service-evtmgr/EVMessages.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-evtmgr/torch.hpp>
#include <sys/messages/TetheringPhoneModeChangeProhibitedMessage.hpp>
#include <service-time/include/service-time/AlarmMessage.hpp>
M products/PurePhone/services/evtmgr/EventManager.cpp => products/PurePhone/services/evtmgr/EventManager.cpp +3 -3
@@ 77,7 77,7 @@ void EventManager::initProductEvents()
});
connect(typeid(sevm::SIMTrayMessage), [&]([[maybe_unused]] sys::Message *msg) {
- bus.sendUnicast(std::make_shared<sevm::SIMTrayMessage>(), ServiceCellular::serviceName);
+ bus.sendUnicast(std::make_shared<sevm::SIMTrayMessage>(), service::name::cellular);
return sys::MessageNone{};
});
@@ 147,13 147,13 @@ sys::MessagePointer EventManager::DataReceivedHandler(sys::DataMessage *msgl, sy
if (auto msg = dynamic_cast<sevm::StatusStateMessage *>(msgl)) {
auto message = std::make_shared<sevm::StatusStateMessage>(MessageType::EVMModemStatus);
message->state = msg->state;
- bus.sendUnicast(message, ServiceCellular::serviceName);
+ bus.sendUnicast(message, service::name::cellular);
}
handled = true;
}
else if (msgl->messageType == MessageType::EVMRingIndicator) {
auto msg = std::make_shared<cellular::UrcIncomingNotification>();
- bus.sendUnicast(std::move(msg), ServiceCellular::serviceName);
+ bus.sendUnicast(std::move(msg), service::name::cellular);
handled = true;
}
M products/PurePhone/sys/SystemManager.cpp => products/PurePhone/sys/SystemManager.cpp +4 -3
@@ 9,9 9,9 @@
#include <system/messages/SystemManagerMessage.hpp>
#include <system/messages/TetheringQuestionRequest.hpp>
#include <system/messages/TetheringStateRequest.hpp>
-#include <service-appmgr/Constants.hpp>
+#include <service-appmgr/ServiceApplicationManagerName.hpp>
#include <service-cellular/CellularServiceAPI.hpp>
-#include <service-evtmgr/Constants.hpp>
+#include <service-evtmgr/ServiceEventManagerName.hpp>
#include <service-evtmgr/EventManagerServiceAPI.hpp>
namespace sys
@@ 37,7 37,8 @@ namespace sys
storeGsm->simCardInserted());
};
auto isCallOngoing = [this]() {
- auto request = async_call<cellular::IsCallActive, cellular::IsCallActiveResponse>(cellular::service::name);
+ auto request =
+ async_call<cellular::IsCallActive, cellular::IsCallActiveResponse>(::service::name::cellular);
sync(request);
return request.getResult().active;
};