Skip to content

RDKEAPPRT-899 If QueryPowerState is standby ,after reboot QueryPowerState is shown ON - #236

Open
suryag23 wants to merge 1 commit into
developfrom
899
Open

RDKEAPPRT-899 If QueryPowerState is standby ,after reboot QueryPowerState is shown ON#236
suryag23 wants to merge 1 commit into
developfrom
899

Conversation

@suryag23

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts power-state restoration logic during/after reboot so that a device previously in STANDBY is not incorrectly treated as ON after reboot, and adds a session-scoped guard intended to avoid re-running restoration logic on UI reloads (e.g., language changes).

Changes:

  • Removes logic that forcibly converted POWER_STATE_STANDBY to POWER_STATE_ON during reboot handling.
  • Adds a sessionStorage flag (powerStateRestored) to skip power-state restoration on subsequent UI reloads within the same session.
  • Updates _getPowerStatebeforeReboot() to short-circuit to current power state when the session flag is set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

});
this.LOG("_PowerStateHandlingWhileReboot: powerstate after setting to new powerstate " + JSON.stringify(GLOBALS.powerState) + " and ");
}
sessionStorage.setItem('powerStateRestored', 'true');
Comment on lines +1682 to +1685
appApi.getPowerState().then(res => {
GLOBALS.powerState = res.currentState;
this.LOG("_getPowerStatebeforeReboot: Set GLOBALS.powerState to current state: " + JSON.stringify(res.currentState));
}).catch(err => {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants