mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-07 23:20:31 -04:00
manager/user: Only enable HdmiCec1 if plasma-remotecontrollers.service exists
This commit is contained in:
parent
7dc0d0969d
commit
1de2109c6d
2 changed files with 27 additions and 6 deletions
|
@ -611,7 +611,10 @@ pub(crate) async fn create_interfaces(
|
|||
object_server.at(MANAGER_PATH, gpu_tdp_limit).await?;
|
||||
}
|
||||
|
||||
object_server.at(MANAGER_PATH, hdmi_cec).await?;
|
||||
if hdmi_cec.hdmi_cec.get_enabled_state().await.is_ok() {
|
||||
object_server.at(MANAGER_PATH, hdmi_cec).await?;
|
||||
}
|
||||
|
||||
object_server.at(MANAGER_PATH, manager2).await?;
|
||||
|
||||
if config
|
||||
|
@ -651,6 +654,7 @@ mod test {
|
|||
use crate::hardware::test::fake_model;
|
||||
use crate::hardware::HardwareVariant;
|
||||
use crate::platform::{PlatformConfig, ScriptConfig, ServiceConfig, StorageConfig};
|
||||
use crate::systemd::test::{MockManager, MockUnit};
|
||||
use crate::{power, testing};
|
||||
|
||||
use std::time::Duration;
|
||||
|
@ -682,6 +686,23 @@ mod test {
|
|||
|
||||
handle.test.platform_config.replace(platform_config);
|
||||
let connection = handle.new_dbus().await?;
|
||||
connection.request_name("org.freedesktop.systemd1").await?;
|
||||
{
|
||||
let object_server = connection.object_server();
|
||||
object_server
|
||||
.at("/org/freedesktop/systemd1", MockManager::default())
|
||||
.await?;
|
||||
|
||||
let mut prc = MockUnit::default();
|
||||
prc.unit_file = String::from("disabled");
|
||||
object_server
|
||||
.at(
|
||||
"/org/freedesktop/systemd1/unit/plasma_2dremotecontrollers_2eservice",
|
||||
prc,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
fake_model(HardwareVariant::Jupiter).await?;
|
||||
power::test::create_nodes().await?;
|
||||
create_interfaces(connection.clone(), connection.clone(), tx_ctx, tx_job).await?;
|
||||
|
|
|
@ -173,7 +173,7 @@ pub fn escape(name: &str) -> String {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
pub mod test {
|
||||
use super::*;
|
||||
use crate::error::to_zbus_fdo_error;
|
||||
use crate::{enum_roundtrip, testing};
|
||||
|
@ -201,14 +201,14 @@ mod test {
|
|||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct MockUnit {
|
||||
active: String,
|
||||
unit_file: String,
|
||||
pub struct MockUnit {
|
||||
pub active: String,
|
||||
pub unit_file: String,
|
||||
job: u32,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct MockManager {
|
||||
pub struct MockManager {
|
||||
states: HashMap<String, EnableState>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue