diff --git a/RDKShell/CHANGELOG.md b/RDKShell/CHANGELOG.md index b3b567b9e5..4f295e2536 100644 --- a/RDKShell/CHANGELOG.md +++ b/RDKShell/CHANGELOG.md @@ -15,6 +15,10 @@ All notable changes to this RDK Service will be documented in this file. * Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. * For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README. +## [1.4.15] - 2024-05-13 +### Fixed +- Disable Auto Hibernation for Launch to Suspended + ## [1.4.14] - 2024-03-05 ### Fixed - Fix RDKShell Initialize and Deinitialize diff --git a/RDKShell/RDKShell.cpp b/RDKShell/RDKShell.cpp index 81f90535c6..e06f14ab73 100755 --- a/RDKShell/RDKShell.cpp +++ b/RDKShell/RDKShell.cpp @@ -17,6 +17,7 @@ * limitations under the License. **/ + #include "RDKShell.h" #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -53,7 +55,7 @@ #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 4 -#define API_VERSION_NUMBER_PATCH 14 +#define API_VERSION_NUMBER_PATCH 15 const string WPEFramework::Plugin::RDKShell::SERVICE_NAME = "org.rdk.RDKShell"; //methods @@ -211,6 +213,11 @@ int gHibernateBlocked; std::condition_variable gHibernateBlockedCondVariable; #endif +#ifdef HIBERNATE_NATIVE_APPS_ON_SUSPENDED +std::set gLaunchedToSuspended; +std::mutex gLaunchedToSuspendedMutex; +#endif + #define ANY_KEY 65536 #define RDKSHELL_THUNDER_TIMEOUT 20000 #define RDKSHELL_POWER_TIME_WAIT 2.5 @@ -725,7 +732,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 = @@ -3973,6 +3984,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;