elevation prompt && uac warning

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-09-27 13:30:49 +08:00
parent e1c2b8de6e
commit 728985e3bf
32 changed files with 156 additions and 16 deletions

View File

@@ -229,6 +229,8 @@ impl Connection {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
std::thread::spawn(move || Self::handle_input(rx_input, tx_cloned));
let mut second_timer = time::interval(Duration::from_secs(1));
let mut uac = false;
loop {
tokio::select! {
@@ -400,6 +402,19 @@ impl Connection {
break;
}
},
_ = second_timer.tick() => {
let is_uac = crate::video_service::IS_UAC_RUNNING.lock().unwrap().clone();
if uac != is_uac {
if !crate::platform::is_installed() && !crate::platform::is_root() {
uac = is_uac;
let mut misc = Misc::new();
misc.set_uac(uac);
let mut msg = Message::new();
msg.set_misc(misc);
conn.inner.send(msg.into());
}
}
}
_ = test_delay_timer.tick() => {
if last_recv_time.elapsed() >= SEC30 {
conn.on_close("Timeout", true).await;