Skip to content

Commit

Permalink
RDK-43052: RDKShell: change namings to 'hibernate' from 'checkpoint'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianM27 committed Oct 31, 2023
1 parent 706ce07 commit 298221e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
28 changes: 14 additions & 14 deletions RDKShell/RDKShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const string WPEFramework::Plugin::RDKShell::RDKSHELL_METHOD_KEY_REPEAT_CONFIG =
const string WPEFramework::Plugin::RDKShell::RDKSHELL_METHOD_GET_GRAPHICS_FRAME_RATE = "getGraphicsFrameRate";
const string WPEFramework::Plugin::RDKShell::RDKSHELL_METHOD_SET_GRAPHICS_FRAME_RATE = "setGraphicsFrameRate";
#ifdef HIBERNATE_SUPPORT_ENABLED
const string WPEFramework::Plugin::RDKShell::RDKSHELL_METHOD_CHECKPOINT = "checkpoint";
const string WPEFramework::Plugin::RDKShell::RDKSHELL_METHOD_HIBERNATE = "hibernate";
const string WPEFramework::Plugin::RDKShell::RDKSHELL_METHOD_RESTORE = "restore";
#endif

Expand All @@ -167,7 +167,7 @@ const string WPEFramework::Plugin::RDKShell::RDKSHELL_EVENT_ON_EASTER_EGG = "onE
const string WPEFramework::Plugin::RDKShell::RDKSHELL_EVENT_ON_WILL_DESTROY = "onWillDestroy";
const string WPEFramework::Plugin::RDKShell::RDKSHELL_EVENT_ON_SCREENSHOT_COMPLETE = "onScreenshotComplete";
#ifdef HIBERNATE_SUPPORT_ENABLED
const string WPEFramework::Plugin::RDKShell::RDKSHELL_EVENT_ON_CHECKPOINTED = "onCheckpointed";
const string WPEFramework::Plugin::RDKShell::RDKSHELL_EVENT_ON_HIBERNATED = "onHibernated";
const string WPEFramework::Plugin::RDKShell::RDKSHELL_EVENT_ON_RESTORED = "onRestored";
#endif

Expand Down Expand Up @@ -627,14 +627,14 @@ namespace WPEFramework {
&& nativeAppWasResumed.find(mCallSign) != nativeAppWasResumed.end()
&& nativeAppWasResumed[mCallSign])
{
// call RDKShell.checkpoint
// call RDKShell.hibernate
std::thread requestsThread =
std::thread([=]()
{
JsonObject checkpointParams;
JsonObject checkpointResponse;
checkpointParams["callsign"] = mCallSign;
mRDKShell.getThunderControllerClient("org.rdk.RDKShell.1")->Invoke<JsonObject, JsonObject>(0, "checkpoint", checkpointParams, checkpointResponse); });
JsonObject hibernateParams;
JsonObject hibernatetResponse;
hibernateParams["callsign"] = mCallSign;
mRDKShell.getThunderControllerClient("org.rdk.RDKShell.1")->Invoke<JsonObject, JsonObject>(0, "hibernate", hibernateParams, hibernatetResponse); });

requestsThread.detach();
}
Expand Down Expand Up @@ -1432,7 +1432,7 @@ namespace WPEFramework {
Register(RDKSHELL_METHOD_SET_AV_BLOCKED, &RDKShell::setAVBlockedWrapper, this);
Register(RDKSHELL_METHOD_GET_AV_BLOCKED_APPS, &RDKShell::getBlockedAVApplicationsWrapper, this);
#ifdef HIBERNATE_SUPPORT_ENABLED
Register(RDKSHELL_METHOD_CHECKPOINT, &RDKShell::checkpointWrapper, this);
Register(RDKSHELL_METHOD_HIBERNATE, &RDKShell::hibernateWrapper, this);
Register(RDKSHELL_METHOD_RESTORE, &RDKShell::restoreWrapper, this);
#endif
m_timer.connect(std::bind(&RDKShell::onTimer, this));
Expand Down Expand Up @@ -6231,7 +6231,7 @@ namespace WPEFramework {
}

#ifdef HIBERNATE_SUPPORT_ENABLED
uint32_t RDKShell::checkpointWrapper(const JsonObject& parameters, JsonObject& response)
uint32_t RDKShell::hibernateWrapper(const JsonObject& parameters, JsonObject& response)
{
LOGINFOMETHOD();
bool status = false;
Expand All @@ -6253,9 +6253,9 @@ namespace WPEFramework {

if (isApplicationBeingDestroyed)
{
std::cout << "ignoring checkpoint for " << callsign << " as it is being destroyed " << std::endl;
std::cout << "ignoring hibernate for " << callsign << " as it is being destroyed " << std::endl;
status = false;
response["message"] = "failed to checkpoint application, is being destroyed";
response["message"] = "failed to hibernate application, is being destroyed";
returnResponse(status);
}

Expand All @@ -6269,9 +6269,9 @@ namespace WPEFramework {
stateStatus = thunderPlugin->Get<WPEFramework::Core::JSON::String>(RDKSHELL_THUNDER_TIMEOUT, "state", stateString);
if(stateStatus || stateString != "suspended")
{
std::cout << "ignoring checkpoint for " << callsign << " as it is not suspended " << std::endl;
std::cout << "ignoring hibenrate for " << callsign << " as it is not suspended " << std::endl;
status = false;
response["message"] = "failed to checkpoint native application, not suspended";
response["message"] = "failed to hibernate native application, not suspended";
returnResponse(status);
}
}
Expand Down Expand Up @@ -6301,7 +6301,7 @@ namespace WPEFramework {
{
eventMsg["success"] = true;
}
notify(RDKShell::RDKSHELL_EVENT_ON_CHECKPOINTED, eventMsg);
notify(RDKShell::RDKSHELL_EVENT_ON_HIBERNATED, eventMsg);
});
requestsThread.detach();
status = true;
Expand Down
6 changes: 3 additions & 3 deletions RDKShell/RDKShell.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace WPEFramework {
static const string RDKSHELL_METHOD_GET_GRAPHICS_FRAME_RATE;
static const string RDKSHELL_METHOD_SET_GRAPHICS_FRAME_RATE;
#ifdef HIBERNATE_SUPPORT_ENABLED
static const string RDKSHELL_METHOD_CHECKPOINT;
static const string RDKSHELL_METHOD_HIBERNATE;
static const string RDKSHELL_METHOD_RESTORE;
#endif

Expand All @@ -172,7 +172,7 @@ namespace WPEFramework {
static const string RDKSHELL_EVENT_ON_WILL_DESTROY;
static const string RDKSHELL_EVENT_ON_SCREENSHOT_COMPLETE;
#ifdef HIBERNATE_SUPPORT_ENABLED
static const string RDKSHELL_EVENT_ON_CHECKPOINTED;
static const string RDKSHELL_EVENT_ON_HIBERNATED;
static const string RDKSHELL_EVENT_ON_RESTORED;
#endif

Expand Down Expand Up @@ -270,7 +270,7 @@ namespace WPEFramework {
uint32_t getGraphicsFrameRateWrapper(const JsonObject& parameters, JsonObject& response);
uint32_t setGraphicsFrameRateWrapper(const JsonObject& parameters, JsonObject& response);
#ifdef HIBERNATE_SUPPORT_ENABLED
uint32_t checkpointWrapper(const JsonObject& parameters, JsonObject& response);
uint32_t hibernateWrapper(const JsonObject& parameters, JsonObject& response);
uint32_t restoreWrapper(const JsonObject& parameters, JsonObject& response);
#endif

Expand Down
14 changes: 7 additions & 7 deletions RDKShell/RDKShell.json
Original file line number Diff line number Diff line change
Expand Up @@ -2233,10 +2233,10 @@
]
}
},
"checkpoint": {
"summary": "Checkpoint an application.",
"hibernate": {
"summary": "Hibernate an application.",
"events": {
"onCheckpointed" : "Triggers when an application is checkpointed"
"onHibernated" : "Triggers when an application is hibernated"
},
"params": {
"type": "object",
Expand All @@ -2245,12 +2245,12 @@
"$ref": "#/definitions/callsign"
},
"timeout": {
"summary": "Timeout in ms for checkpoint procedure",
"summary": "Timeout in ms for hibernate procedure",
"type": "number",
"example": 10000
},
"procsequence": {
"summary": "Checkpoint sequence of application processes",
"summary": "Hibernate sequence of application processes",
"type": "array",
"items": {
"type": "string",
Expand Down Expand Up @@ -2599,8 +2599,8 @@
]
}
},
"onCheckpointed":{
"summary": "Triggers when an application is checkpointed.",
"onHibernated":{
"summary": "Triggers when an application is hibernated.",
"params": {
"type": "object",
"properties": {
Expand Down

0 comments on commit 298221e

Please sign in to comment.