diff --git a/src/server.rs b/src/server.rs index 66095fd9e..2b833576a 100644 --- a/src/server.rs +++ b/src/server.rs @@ -8,12 +8,10 @@ use std::{ use bytes::Bytes; pub use connection::*; -#[cfg(not(any(target_os = "android", target_os = "ios")))] -use hbb_common::config::Config2; use hbb_common::tcp::{self, new_listener}; use hbb_common::{ allow_err, - anyhow::{anyhow, Context}, + anyhow::Context, bail, config::{Config, CONNECT_TIMEOUT, RELAY_PORT}, log, @@ -25,6 +23,8 @@ use hbb_common::{ timeout, tokio, ResultType, Stream, }; #[cfg(not(any(target_os = "android", target_os = "ios")))] +use hbb_common::{anyhow::anyhow, config::Config2}; +#[cfg(not(any(target_os = "android", target_os = "ios")))] use service::ServiceTmpl; use service::{GenericService, Service, Subscriber}; diff --git a/src/server/connection.rs b/src/server/connection.rs index 200a6dfb5..69cb56102 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -1936,6 +1936,7 @@ impl Connection { true } + #[cfg(not(any(target_os = "android", target_os = "ios")))] fn change_resolution(&mut self, r: &Resolution) { if self.keyboard { if let Ok(name) = video_service::get_current_display_name() { @@ -2148,6 +2149,7 @@ impl Connection { } } } + #[cfg(not(any(target_os = "android", target_os = "ios")))] if let Some(custom_resolution) = o.custom_resolution.as_ref() { if custom_resolution.width > 0 && custom_resolution.height > 0 { self.change_resolution(&custom_resolution); diff --git a/src/server/video_service.rs b/src/server/video_service.rs index 747fff73e..18b400fca 100644 --- a/src/server/video_service.rs +++ b/src/server/video_service.rs @@ -113,6 +113,7 @@ fn update_get_original_resolution_(display_name: &str, w: usize, h: usize) -> Re } #[inline] +#[cfg(not(any(target_os = "android", target_os = "ios")))] pub fn reset_resolutions() { for (name, (w, h)) in ORIGINAL_RESOLUTIONS.read().unwrap().iter() { if let Err(e) = crate::platform::change_resolution(name, *w as _, *h as _) {