From 52999ca9c0da34051dfce1b50aa717c7918c2957 Mon Sep 17 00:00:00 2001 From: nnaveen979 <142964959+nnaveen979@users.noreply.github.com> Date: Fri, 6 Sep 2024 20:41:43 +0530 Subject: [PATCH] 2445_fix: thunder api get invoke whenever badger_capabilities triggered (#625) * fix: thunder api get invoke whenever badger_capabilities triggered * chore: branch version updated from 1.12.rc to 1.13.rc --- .github/workflows/Build.yml | 2 +- .../src/processors/thunder_device_info.rs | 36 ++++++------------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index a37bc283f..94ae44e58 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main" ] pull_request: - branches: [ "main", "1.12.rc" ] + branches: [ "main", "1.13.rc" ] env: CARGO_TERM_COLOR: always diff --git a/device/thunder_ripple_sdk/src/processors/thunder_device_info.rs b/device/thunder_ripple_sdk/src/processors/thunder_device_info.rs index 2c5c1f440..d79f00aed 100644 --- a/device/thunder_ripple_sdk/src/processors/thunder_device_info.rs +++ b/device/thunder_ripple_sdk/src/processors/thunder_device_info.rs @@ -148,7 +148,6 @@ pub struct CachedDeviceInfo { model: Option, make: Option, hdcp_support: Option>, - hdcp_status: Option, hdr_profile: Option>, version: Option, } @@ -184,15 +183,6 @@ impl CachedState { let _ = hdcp.hdcp_support.insert(value); } - fn get_hdcp_status(&self) -> Option { - self.cached.read().unwrap().hdcp_status.clone() - } - - fn update_hdcp_status(&self, value: HDCPStatus) { - let mut hdcp = self.cached.write().unwrap(); - let _ = hdcp.hdcp_status.insert(value); - } - fn get_hdr(&self) -> Option> { self.cached.read().unwrap().hdr_profile.clone() } @@ -721,22 +711,16 @@ impl ThunderDeviceInfoRequestProcessor { async fn get_hdcp_status(state: &CachedState) -> HDCPStatus { let mut response: HDCPStatus = HDCPStatus::default(); - match state.get_hdcp_status() { - Some(status) => response = status, - None => { - let resp = state - .get_thunder_client() - .call(DeviceCallRequest { - method: ThunderPlugin::Hdcp.method("getHDCPStatus"), - params: None, - }) - .await; - info!("{}", resp.message); - if let Ok(thdcp) = serde_json::from_value::(resp.message) { - response = thdcp.hdcp_status; - state.update_hdcp_status(response.clone()); - } - } + let resp = state + .get_thunder_client() + .call(DeviceCallRequest { + method: ThunderPlugin::Hdcp.method("getHDCPStatus"), + params: None, + }) + .await; + info!("{}", resp.message); + if let Ok(thdcp) = serde_json::from_value::(resp.message) { + response = thdcp.hdcp_status; } response }