Skip to content

Commit

Permalink
RDKTV-30518: Disable Auto Hibernation for Launch to Suspended
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianM27 committed May 8, 2024
1 parent 7d3dd07 commit 102ae97
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion RDKShell/RDKShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
* limitations under the License.
**/


#include "RDKShell.h"
#include <string>
#include <memory>
#include <iostream>
#include <mutex>
#include <thread>
#include <fstream>
#include <set>
#include <sstream>
#include <condition_variable>
#include <unistd.h>
Expand Down Expand Up @@ -214,6 +216,11 @@ int gHibernateBlocked;
std::condition_variable gHibernateBlockedCondVariable;
#endif

#ifdef HIBERNATE_NATIVE_APPS_ON_SUSPENDED
std::set<std::string> gLaunchedToSuspended;
std::mutex gLaunchedToSuspendedMutex;
#endif

#define ANY_KEY 65536
#define RDKSHELL_THUNDER_TIMEOUT 20000
#define RDKSHELL_POWER_TIME_WAIT 2.5
Expand Down Expand Up @@ -772,7 +779,11 @@ namespace WPEFramework {
if (Utils::getRFCConfig("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AppHibernate.Enable", param)
&& strncasecmp(param.value, "true", 4) == 0)
{
if ((mCallSign.find("Netflix") != std::string::npos || mCallSign.find("Cobalt") != std::string::npos))
gLaunchedToSuspendedMutex.lock();
bool l2s = (gLaunchedToSuspended.find(mCallSign) != gLaunchedToSuspended.end());
gLaunchedToSuspendedMutex.unlock();

if (!l2s && (mCallSign.find("Netflix") != std::string::npos || mCallSign.find("Cobalt") != std::string::npos))
{
// call RDKShell.hibernate
std::thread requestsThread =
Expand Down Expand Up @@ -4051,6 +4062,18 @@ namespace WPEFramework {
}
gSuspendedOrHibernatedApplicationsMutex.unlock();
#endif
#ifdef HIBERNATE_NATIVE_APPS_ON_SUSPENDED
gLaunchedToSuspendedMutex.lock();
if (suspend)
{
gLaunchedToSuspended.insert(appCallsign);
}
else
{
gLaunchedToSuspended.erase(appCallsign);
}
gLaunchedToSuspendedMutex.unlock();
#endif

//check to see if plugin already exists
bool newPluginFound = false;
Expand Down

0 comments on commit 102ae97

Please sign in to comment.