From 3609fabb3e9c4817ca65a1b61678d568ff9e57dd Mon Sep 17 00:00:00 2001 From: Gomathi Shankar Date: Fri, 24 May 2024 11:42:54 +0530 Subject: [PATCH 1/4] Update MaintenanceManager.cpp --- MaintenanceManager/MaintenanceManager.cpp | 25 ++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/MaintenanceManager/MaintenanceManager.cpp b/MaintenanceManager/MaintenanceManager.cpp index 9b5988aae9..381c5c1931 100644 --- a/MaintenanceManager/MaintenanceManager.cpp +++ b/MaintenanceManager/MaintenanceManager.cpp @@ -286,11 +286,24 @@ namespace WPEFramework { uint8_t i=0; string cmd=""; bool internetConnectStatus=false; + bool delayMaintenanceStarted = false; + +#if defined(ENABLE_WHOAMI) + /* Purposefully delaying MAINTENANCE_STARTED status to honor POWER compliance */ + if (UNSOLICITED_MAINTENANCE == g_maintenance_type) { + delayMaintenanceStarted = true; + LOGINFO("delayMaintenanceStarted is true"); + } +#endif + if (!delayMaintenanceStarted) { + LOGINFO("delayMaintenanceStarted is false"); + m_statusMutex.lock(); + MaintenanceManager::_instance->onMaintenanceStatusChange(MAINTENANCE_STARTED); + m_statusMutex.unlock(); + } + std::unique_lock lck(m_callMutex); LOGINFO("Executing Maintenance tasks"); - m_statusMutex.lock(); - MaintenanceManager::_instance->onMaintenanceStatusChange(MAINTENANCE_STARTED); - m_statusMutex.unlock(); /* cleanup if not empty */ if(!tasks.empty()){ @@ -352,6 +365,12 @@ namespace WPEFramework { return; } + if (delayMaintenanceStarted) { + LOGINFO("delayMaintenanceStarted is true"); + m_statusMutex.lock(); + MaintenanceManager::_instance->onMaintenanceStatusChange(MAINTENANCE_STARTED); + m_statusMutex.unlock(); + } LOGINFO("Reboot_Pending :%s",g_is_reboot_pending.c_str()); if (UNSOLICITED_MAINTENANCE == g_maintenance_type){ From 0a7aa055a7e2fcb2e39653333f32dd37d814d048 Mon Sep 17 00:00:00 2001 From: Gomathi Shankar Date: Fri, 24 May 2024 11:44:44 +0530 Subject: [PATCH 2/4] Update MaintenanceManager.cpp --- MaintenanceManager/MaintenanceManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MaintenanceManager/MaintenanceManager.cpp b/MaintenanceManager/MaintenanceManager.cpp index 381c5c1931..be0edb4b7e 100644 --- a/MaintenanceManager/MaintenanceManager.cpp +++ b/MaintenanceManager/MaintenanceManager.cpp @@ -288,6 +288,9 @@ namespace WPEFramework { bool internetConnectStatus=false; bool delayMaintenanceStarted = false; + std::unique_lock lck(m_callMutex); + LOGINFO("Executing Maintenance tasks"); + #if defined(ENABLE_WHOAMI) /* Purposefully delaying MAINTENANCE_STARTED status to honor POWER compliance */ if (UNSOLICITED_MAINTENANCE == g_maintenance_type) { @@ -302,9 +305,6 @@ namespace WPEFramework { m_statusMutex.unlock(); } - std::unique_lock lck(m_callMutex); - LOGINFO("Executing Maintenance tasks"); - /* cleanup if not empty */ if(!tasks.empty()){ tasks.erase (tasks.begin(),tasks.end()); @@ -371,6 +371,7 @@ namespace WPEFramework { MaintenanceManager::_instance->onMaintenanceStatusChange(MAINTENANCE_STARTED); m_statusMutex.unlock(); } + LOGINFO("Reboot_Pending :%s",g_is_reboot_pending.c_str()); if (UNSOLICITED_MAINTENANCE == g_maintenance_type){ From 1cbda92148447ce7b3a7cda83fbbaa304fc78282 Mon Sep 17 00:00:00 2001 From: Gomathi Shankar Date: Mon, 27 May 2024 10:54:24 +0530 Subject: [PATCH 3/4] Update MaintenanceManager.cpp --- MaintenanceManager/MaintenanceManager.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/MaintenanceManager/MaintenanceManager.cpp b/MaintenanceManager/MaintenanceManager.cpp index be0edb4b7e..7ab9db78a2 100644 --- a/MaintenanceManager/MaintenanceManager.cpp +++ b/MaintenanceManager/MaintenanceManager.cpp @@ -295,11 +295,9 @@ namespace WPEFramework { /* Purposefully delaying MAINTENANCE_STARTED status to honor POWER compliance */ if (UNSOLICITED_MAINTENANCE == g_maintenance_type) { delayMaintenanceStarted = true; - LOGINFO("delayMaintenanceStarted is true"); } #endif if (!delayMaintenanceStarted) { - LOGINFO("delayMaintenanceStarted is false"); m_statusMutex.lock(); MaintenanceManager::_instance->onMaintenanceStatusChange(MAINTENANCE_STARTED); m_statusMutex.unlock(); @@ -366,7 +364,6 @@ namespace WPEFramework { } if (delayMaintenanceStarted) { - LOGINFO("delayMaintenanceStarted is true"); m_statusMutex.lock(); MaintenanceManager::_instance->onMaintenanceStatusChange(MAINTENANCE_STARTED); m_statusMutex.unlock(); From cdc1edb9c833bbc98087e2616a18649c7cbf4c02 Mon Sep 17 00:00:00 2001 From: Gomathi Shankar Date: Mon, 27 May 2024 11:04:15 +0530 Subject: [PATCH 4/4] Update CHANGELOG.md --- MaintenanceManager/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MaintenanceManager/CHANGELOG.md b/MaintenanceManager/CHANGELOG.md index 9aaffe6dee..75e24b4c90 100644 --- a/MaintenanceManager/CHANGELOG.md +++ b/MaintenanceManager/CHANGELOG.md @@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.0.35] - 2024-05-27 +### Fixed +- Delay Unsolicited Maintenance start event in WAI-enabled case + ## [1.0.34] - 2024-05-14 ### Fixed - Additional logging for MaintenanceManager WhoAmI's setPartnerId