Skip to content

Commit

Permalink
RDKShell: Skip SetFocus to false for Hibernated plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianM27 committed Nov 3, 2023
1 parent cc2c93e commit 17dc21d
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions RDKShell/RDKShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6606,13 +6606,39 @@ namespace WPEFramework {
if (compositorName == previousFocusedClient)
{
std::cout << "setting the focus of " << compositorName << " to false " << std::endl;
Exchange::IFocus *focusedCallsign = mCurrentService->QueryInterfaceByCallsign<Exchange::IFocus>(previousFocusedIterator->first);
if (focusedCallsign != NULL)
#ifdef HIBERNATE_SUPPORT_ENABLED
//Check plugin state, skip for hibernated state
string method = "status@" + previousFocusedIterator->first;
Core::JSON::ArrayType<PluginHost::MetaData::Service> joResult;
auto thunderController = getThunderControllerClient();
uint32_t ret = thunderController->Get<Core::JSON::ArrayType<PluginHost::MetaData::Service>>(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<Exchange::IFocus>(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;
}
}
Expand Down

0 comments on commit 17dc21d

Please sign in to comment.