From cfd27c8d87e273f5be164bba94119b7cde4e62aa Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 27 Jun 2024 20:09:51 +0800 Subject: [PATCH] wakelock not block system sleep (#8504) Signed-off-by: 21pages --- src/platform/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 65d047cff..fe66e50dc 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -104,8 +104,11 @@ pub fn get_wakelock(_display: bool) -> WakeLock { hbb_common::log::info!("new wakelock, require display on: {_display}"); #[cfg(target_os = "android")] return crate::platform::WakeLock::new("server"); + // display: keep screen on + // idle: keep cpu on + // sleep: prevent system from sleeping, even manually #[cfg(not(target_os = "android"))] - return crate::platform::WakeLock::new(_display, true, true); + return crate::platform::WakeLock::new(_display, true, false); } pub(crate) struct InstallingService; // please use new