wake lock for all connection type

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-11-24 16:40:18 +08:00
parent bd81e4d0fb
commit 2de1c62daf
9 changed files with 102 additions and 87 deletions

View File

@@ -363,13 +363,6 @@ fn get_capturer(current: usize, portable_service_running: bool) -> ResultType<Ca
}
fn run(vs: VideoService) -> ResultType<()> {
#[cfg(not(target_os = "android"))]
let _wake_lock = get_wake_lock();
#[cfg(target_os = "android")]
let wake_lock = crate::platform::WakeLock::new("video service");
#[cfg(target_os = "android")]
let _lock_guard = wake_lock.acquire();
// Wayland only support one video capturer for now. It is ok to call ensure_inited() here.
//
// ensure_inited() is needed because clear() may be called.
@@ -735,19 +728,6 @@ fn start_uac_elevation_check() {
});
}
#[cfg(not(target_os = "android"))]
fn get_wake_lock() -> crate::platform::WakeLock {
let (display, idle, sleep) = if cfg!(windows) {
(true, false, false)
} else if cfg!(linux) {
(false, false, true)
} else {
//macos
(true, false, false)
};
crate::platform::WakeLock::new(display, idle, sleep)
}
#[inline]
fn try_broadcast_display_changed(
sp: &GenericService,