diff --git a/RDKShell/RDKShell.cpp b/RDKShell/RDKShell.cpp index b1f27c4c19..e70ca9594b 100755 --- a/RDKShell/RDKShell.cpp +++ b/RDKShell/RDKShell.cpp @@ -6605,14 +6605,40 @@ namespace WPEFramework { std::string compositorName = toLower(previousFocusedIterator->first); if (compositorName == previousFocusedClient) { +#ifdef HIBERNATE_SUPPORT_ENABLED std::cout << "setting the focus of " << compositorName << " to false " << std::endl; - Exchange::IFocus *focusedCallsign = mCurrentService->QueryInterfaceByCallsign(previousFocusedIterator->first); - if (focusedCallsign != NULL) + //Check plugin state, skip for hibernated state + string method = "status@" + previousFocusedIterator->first; + Core::JSON::ArrayType joResult; + auto thunderController = getThunderControllerClient(); + uint32_t ret = thunderController->Get>(RDKSHELL_THUNDER_TIMEOUT, method.c_str(), joResult); + bool isHibernated = false; + if (ret == Core::ERROR_NONE && joResult.Length() > 0) + { + PluginHost::MetaData::Service service = joResult[0]; + if (service.JSONState == PluginHost::MetaData::Service::state::HIBERNATED) + { + isHibernated = true; + } + } + + if (isHibernated == false) + { +#endif + Exchange::IFocus *focusedCallsign = mCurrentService->QueryInterfaceByCallsign(previousFocusedIterator->first); + if (focusedCallsign != NULL) + { + uint32_t status = focusedCallsign->Focused(false); + std::cout << "result of set focus to false: " << status << std::endl; + focusedCallsign->Release(); + } +#ifdef HIBERNATE_SUPPORT_ENABLED + } + else { - uint32_t status = focusedCallsign->Focused(false); - std::cout << "result of set focus to false: " << status << std::endl; - focusedCallsign->Release(); + std::cout << "setting the focus for " << compositorName << " to false skipped, plugin hibernated " << std::endl; } +#endif break; } }