Skip to content

RDKEAPPRT-879,324 - Remove CEC Plugin Activation/Deactivation from CEC Control Setting - #224

Open
SudarsananComcast wants to merge 11 commits into
developfrom
rdkeApprt-879
Open

RDKEAPPRT-879,324 - Remove CEC Plugin Activation/Deactivation from CEC Control Setting #224
SudarsananComcast wants to merge 11 commits into
developfrom
rdkeApprt-879

Conversation

@SudarsananComcast

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 13, 2026 09:05

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 aims to remove direct Thunder plugin activation/deactivation side effects from the “CEC Control” setting, shifting the control flow toward toggling the CEC enabled state instead of activating/deactivating the org.rdk.HdmiCecSource plugin.

Changes:

  • Commented out CEC plugin activation logic in _init().
  • Refactored toggleCEC() to compute a target enabled state and call setEnabled(...), then update the toggle icon accordingly.

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

Comment thread accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js Outdated
Comment on lines +218 to +221
// get the current state and toggle it
const newEnabledState = !res.enabled
this.cecApi.setEnabled({ enabled: newEnabledState })
.then(() => {
Copilot AI review requested due to automatic review settings July 13, 2026 09:38

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

Comment thread accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js Outdated
Comment thread accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js Outdated
Comment on lines +207 to +214
const newEnabledState = !(res && res.enabled)
this.cecApi.setEnabled(newEnabledState)
.then(() => {
const imageSrc = newEnabledState
? 'images/settings/ToggleOnOrange.png'
: 'images/settings/ToggleOffWhite.png'
this.tag('CECControl.Button').src = Utils.asset(imageSrc)
})
Copilot AI review requested due to automatic review settings July 13, 2026 10:18
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js Outdated
Copilot AI review requested due to automatic review settings July 13, 2026 10:20

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +228 to +238
this.cecApi.setEnabled(newEnabledState)
.then(() => {
// Update UI based on new state
const imageSrc = newEnabledState
? 'images/settings/ToggleOnOrange.png'
: 'images/settings/ToggleOffWhite.png'
this.tag('CECControl.Button').src = Utils.asset(imageSrc)
if (newEnabledState) {
this.performOTPAction()
}
})
Copilot AI review requested due to automatic review settings July 14, 2026 10:10

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 11:49

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js Outdated
Comment thread accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js Outdated
Copilot AI review requested due to automatic review settings July 15, 2026 11:53

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment on lines +230 to +240
this.cecApi.setEnabled(newEnabledState)
.then(() => {
// Update UI based on new state
const imageSrc = newEnabledState
? 'images/settings/ToggleOnOrange.png'
: 'images/settings/ToggleOffWhite.png'
this.tag('CECControl.Button').src = Utils.asset(imageSrc)
if (newEnabledState) {
this.performOTPAction()
}
})
Comment on lines +188 to +190
const isEnabled = !!(res && res.enabled)
console.log(`CEC initial status: ${isEnabled}`)

Copilot AI review requested due to automatic review settings July 17, 2026 11:03

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment on lines +228 to +240
// get the current state and toggle it.
const newEnabledState = !(res && res.enabled)
this.cecApi.setEnabled(newEnabledState)
.then(() => {
// Update UI based on new state
const imageSrc = newEnabledState
? 'images/settings/ToggleOnOrange.png'
: 'images/settings/ToggleOffWhite.png'
this.tag('CECControl.Button').src = Utils.asset(imageSrc)
if (newEnabledState) {
this.performOTPAction()
}
})
Comment on lines +188 to +189
const isEnabled = !!(res && res.enabled)
console.log(`CEC initial status: ${isEnabled}`)

@arun-madhavan-013 arun-madhavan-013 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CEC plugin activation is needed. UI is common for both Source & Sink devices.

Copilot AI review requested due to automatic review settings July 21, 2026 09:49

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

accelerator-home-ui/src/screens/OtherSettingsScreens/AdvancedSettingsScreen.js:248

  • toggleCEC() still calls cecApi.activate() and unconditionally updates UI/storage in .then(() => ...) even when setEnabled() fails (it can resolve { success: false } on error). This conflicts with the PR goal of removing plugin activation/deactivation from the setting (the plugin is already activated in App.js) and can desync the toggle UI from the real CEC state. Prefer calling setEnabled(newEnabledState) directly and gate UI/storage updates on a successful result.
                const newEnabledState = !(res && res.enabled)
                // if newEnabledState is true,then first activate CEC and then setEnabled to true, 
                // else just setEnabled to false
                const togglePromise = newEnabledState
                    ? this.cecApi.activate().then(() => this.cecApi.setEnabled(true))

accelerator-home-ui/src/overlays/OtherSettings/AdvancedSettingsScreenOverlay.js:233

  • toggleCEC() still calls cecApi.activate() and unconditionally updates UI/storage in .then(() => ...) even when setEnabled() fails (it can resolve { success: false } on error). This conflicts with the PR goal of removing plugin activation/deactivation from the setting (the plugin is already activated in App.js) and can desync the toggle UI from the real CEC state. Prefer calling setEnabled(newEnabledState) directly and gate UI/storage updates on a successful result.
                const newEnabledState = !(res && res.enabled)
                // if newEnabledState is true,then first activate CEC and then setEnabled to true, 
                // else just setEnabled to false
                const togglePromise = newEnabledState
                    ? this.cecApi.activate().then(() => this.cecApi.setEnabled(true))

@SudarsananComcast

Copy link
Copy Markdown
Contributor Author

Hi @arun-madhavan-013 CEC is activated in app.js file. just removed where the activate function call is not required.

@SudarsananComcast SudarsananComcast changed the title Remove CEC Plugin Activation/Deactivation from CEC Control Setting [RDKEAPPRT-879] Remove CEC Plugin Activation/Deactivation from CEC Control Setting [RDKEAPPRT-879,324] Jul 22, 2026
@SudarsananComcast SudarsananComcast changed the title Remove CEC Plugin Activation/Deactivation from CEC Control Setting [RDKEAPPRT-879,324] RDKEAPPRT-879,324 - Remove CEC Plugin Activation/Deactivation from CEC Control Setting Jul 22, 2026
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.

3 participants