From c3bba1c22b238ad6686d8187c34824ebe7418934 Mon Sep 17 00:00:00 2001 From: apatel859 Date: Tue, 25 Jan 2022 17:34:29 -0500 Subject: [PATCH] LLAMA-5154:Panel fails to come out of standby Reason for change: Added fix to handle exceptions. Test Procedure:Refer JIRA Risks: low Signed-off-by: apatel859 --- DisplaySettings/DisplaySettings.cpp | 20 +++++++++++++++++++- DisplaySettings/DisplaySettings.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/DisplaySettings/DisplaySettings.cpp b/DisplaySettings/DisplaySettings.cpp index 15d3a1b861..3866bbf582 100644 --- a/DisplaySettings/DisplaySettings.cpp +++ b/DisplaySettings/DisplaySettings.cpp @@ -3786,6 +3786,11 @@ namespace WPEFramework { return m_powerState; } + void DisplaySettings::initAudioPortsWorker(void) + { + DisplaySettings::_instance->InitAudioPorts(); + } + void DisplaySettings::powerEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len) { if(!DisplaySettings::_instance) @@ -3801,7 +3806,20 @@ namespace WPEFramework { eventData->data.state.curState, eventData->data.state.newState); m_powerState = eventData->data.state.newState; if (eventData->data.state.newState == IARM_BUS_PWRMGR_POWERSTATE_ON) { - DisplaySettings::_instance->InitAudioPorts(); + try + { + LOGWARN("creating worker thread for initAudioPortsWorker "); + std::thread audioPortInitThread = std::thread(initAudioPortsWorker); + audioPortInitThread.detach(); + } + catch(const std::system_error& e) + { + LOGERR("system_error exception in thread creation: %s", e.what()); + } + catch(const std::exception& e) + { + LOGERR("exception in thread creation : %s", e.what()); + } } else { diff --git a/DisplaySettings/DisplaySettings.h b/DisplaySettings/DisplaySettings.h index 2621c8295b..4a90b576b8 100644 --- a/DisplaySettings/DisplaySettings.h +++ b/DisplaySettings/DisplaySettings.h @@ -141,6 +141,7 @@ namespace WPEFramework { uint32_t setMS12ProfileSettingsOverride(const JsonObject& parameters, JsonObject& response); void InitAudioPorts(); void AudioPortsReInitialize(); + static void initAudioPortsWorker(void); //End methods //Begin events