From 35c90bf55ac09f4ce88781950460da3e5b61b898 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 27 Jun 2025 17:15:12 -0700 Subject: [PATCH] manager/user: Only expose ScreenReader0 if /usr/bin/orca exists --- src/manager/user.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/manager/user.rs b/src/manager/user.rs index 797f0c3..d2f4efc 100644 --- a/src/manager/user.rs +++ b/src/manager/user.rs @@ -8,6 +8,7 @@ use anyhow::{Error, Result}; use std::collections::HashMap; +use tokio::fs::try_exists; use tokio::sync::mpsc::{Sender, UnboundedSender}; use tokio::sync::oneshot; use tokio_stream::StreamExt; @@ -25,6 +26,7 @@ use crate::hardware::{ device_config, device_type, device_variant, steam_deck_variant, SteamDeckVariant, }; use crate::job::JobManagerCommand; +use crate::path; use crate::platform::platform_config; use crate::power::{ get_available_cpu_scaling_governors, get_available_gpu_performance_levels, @@ -1138,7 +1140,9 @@ pub(crate) async fn create_interfaces( object_server.at(MANAGER_PATH, manager2).await?; - object_server.at(MANAGER_PATH, screen_reader).await?; + if try_exists(path("/usr/bin/orca")).await? { + object_server.at(MANAGER_PATH, screen_reader).await?; + } if steam_deck_variant().await.unwrap_or_default() == SteamDeckVariant::Galileo { object_server.at(MANAGER_PATH, wifi_debug).await?; @@ -1174,7 +1178,7 @@ mod test { use std::os::unix::fs::PermissionsExt; use std::path::PathBuf; use std::time::Duration; - use tokio::fs::{set_permissions, write}; + use tokio::fs::{create_dir_all, set_permissions, write}; use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver}; use tokio::time::sleep; use zbus::object_server::Interface; @@ -1279,6 +1283,9 @@ mod test { write(&exe_path, "").await?; set_permissions(&exe_path, PermissionsExt::from_mode(0o700)).await?; + create_dir_all(path("/usr/bin")).await?; + write(path("/usr/bin/orca"), "").await?; + handle .test .process_cb