opt: more debug info

This commit is contained in:
Kingtous 2023-02-07 19:33:58 +08:00
parent db8b6d618f
commit c4b1c51e9e
3 changed files with 7 additions and 6 deletions

View File

@ -114,9 +114,6 @@ Future<void> initEnv(String appType) async {
_registerEventHandler(); _registerEventHandler();
// Update the system theme. // Update the system theme.
updateSystemWindowTheme(); updateSystemWindowTheme();
if (appType == kAppTypeConnectionManager) {
await bind.cmStartListenIpcThread();
}
} }
void runMainApp(bool startService) async { void runMainApp(bool startService) async {
@ -219,6 +216,7 @@ void runMultiWindow(
void runConnectionManagerScreen(bool hide) async { void runConnectionManagerScreen(bool hide) async {
await initEnv(kAppTypeConnectionManager); await initEnv(kAppTypeConnectionManager);
await bind.cmStartListenIpcThread();
_runApp( _runApp(
'', '',
const DesktopServerPage(), const DesktopServerPage(),

View File

@ -549,9 +549,11 @@ pub mod connection_manager {
let mut h: HashMap<&str, &str> = event.iter().cloned().collect(); let mut h: HashMap<&str, &str> = event.iter().cloned().collect();
assert!(h.get("name").is_none()); assert!(h.get("name").is_none());
h.insert("name", name); h.insert("name", name);
if let Some(s) = GLOBAL_EVENT_STREAM.read().unwrap().get(super::APP_TYPE_CM) { if let Some(s) = GLOBAL_EVENT_STREAM.read().unwrap().get(super::APP_TYPE_CM) {
s.add(serde_json::ser::to_string(&h).unwrap_or("".to_owned())); s.add(serde_json::ser::to_string(&h).unwrap_or("".to_owned()));
} else {
println!("Push event {} failed. No {} event stream found.", name, super::APP_TYPE_CM);
}; };
} }
} }

View File

@ -401,10 +401,11 @@ impl Connection {
conn.handle_voice_call(accepted).await; conn.handle_voice_call(accepted).await;
} }
ipc::Data::CloseVoiceCall(_reason) => { ipc::Data::CloseVoiceCall(_reason) => {
log::debug!("Close the voice call from the ipc.");
conn.close_voice_call().await; conn.close_voice_call().await;
// Notify the peer that we closed the voice call. // Notify the peer that we closed the voice call.
let req = new_voice_call_request(false); let msg = new_voice_call_request(false);
conn.send(req).await; conn.send(msg).await;
} }
_ => {} _ => {}
} }