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 15, 2024
1 parent d5f7f21 commit b8d29a1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions RDKShell/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.18] - 2024-05-13
### Fixed
- Disable Auto Hibernation for Launch to Suspended

## [1.4.17] - 2024-04-10
### Added
- Fix for rdkshell missing events
Expand Down
27 changes: 25 additions & 2 deletions 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 @@ -53,7 +55,7 @@

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 4
#define API_VERSION_NUMBER_PATCH 17
#define API_VERSION_NUMBER_PATCH 18

const string WPEFramework::Plugin::RDKShell::SERVICE_NAME = "org.rdk.RDKShell";
//methods
Expand Down Expand Up @@ -212,6 +214,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 @@ -727,7 +734,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 @@ -3982,6 +3993,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 b8d29a1

Please sign in to comment.