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 diff --git a/MaintenanceManager/MaintenanceManager.cpp b/MaintenanceManager/MaintenanceManager.cpp index 9b5988aae9..7ab9db78a2 100644 --- a/MaintenanceManager/MaintenanceManager.cpp +++ b/MaintenanceManager/MaintenanceManager.cpp @@ -286,11 +286,22 @@ namespace WPEFramework { uint8_t i=0; string cmd=""; bool internetConnectStatus=false; - std::unique_lock lck(m_callMutex); + bool delayMaintenanceStarted = false; + + std::unique_lock lck(m_callMutex); LOGINFO("Executing Maintenance tasks"); - m_statusMutex.lock(); - MaintenanceManager::_instance->onMaintenanceStatusChange(MAINTENANCE_STARTED); - m_statusMutex.unlock(); + +#if defined(ENABLE_WHOAMI) + /* Purposefully delaying MAINTENANCE_STARTED status to honor POWER compliance */ + if (UNSOLICITED_MAINTENANCE == g_maintenance_type) { + delayMaintenanceStarted = true; + } +#endif + if (!delayMaintenanceStarted) { + m_statusMutex.lock(); + MaintenanceManager::_instance->onMaintenanceStatusChange(MAINTENANCE_STARTED); + m_statusMutex.unlock(); + } /* cleanup if not empty */ if(!tasks.empty()){ @@ -352,6 +363,12 @@ namespace WPEFramework { return; } + if (delayMaintenanceStarted) { + 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){