Skip to content

Commit

Permalink
2445_fix: thunder api get invoke whenever badger_capabilities trigger…
Browse files Browse the repository at this point in the history
…ed (#625)

* fix: thunder api get invoke whenever badger_capabilities triggered

* chore: branch version updated from 1.12.rc to 1.13.rc
  • Loading branch information
nnaveen979 authored Sep 6, 2024
1 parent 3fc9f71 commit 52999ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 10 additions & 26 deletions device/thunder_ripple_sdk/src/processors/thunder_device_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ pub struct CachedDeviceInfo {
model: Option<String>,
make: Option<String>,
hdcp_support: Option<HashMap<HdcpProfile, bool>>,
hdcp_status: Option<HDCPStatus>,
hdr_profile: Option<HashMap<HdrProfile, bool>>,
version: Option<FireboltSemanticVersion>,
}
Expand Down Expand Up @@ -184,15 +183,6 @@ impl CachedState {
let _ = hdcp.hdcp_support.insert(value);
}

fn get_hdcp_status(&self) -> Option<HDCPStatus> {
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<HashMap<HdrProfile, bool>> {
self.cached.read().unwrap().hdr_profile.clone()
}
Expand Down Expand Up @@ -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::<ThunderHDCPStatus>(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::<ThunderHDCPStatus>(resp.message) {
response = thdcp.hdcp_status;
}
response
}
Expand Down

0 comments on commit 52999ca

Please sign in to comment.