mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-17 13:35:50 +00:00
refact: android audio input, voice call (#8037)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -221,7 +221,7 @@ impl<T: InvokeUiCM> ConnectionManager<T> {
|
||||
self.ui_handler.show_elevation(show);
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
fn voice_call_started(&self, id: i32) {
|
||||
if let Some(client) = CLIENTS.write().unwrap().get_mut(&id) {
|
||||
client.incoming_voice_call = false;
|
||||
@@ -230,7 +230,7 @@ impl<T: InvokeUiCM> ConnectionManager<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
fn voice_call_incoming(&self, id: i32) {
|
||||
if let Some(client) = CLIENTS.write().unwrap().get_mut(&id) {
|
||||
client.incoming_voice_call = true;
|
||||
@@ -239,7 +239,7 @@ impl<T: InvokeUiCM> ConnectionManager<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
fn voice_call_closed(&self, id: i32, _reason: &str) {
|
||||
if let Some(client) = CLIENTS.write().unwrap().get_mut(&id) {
|
||||
client.incoming_voice_call = false;
|
||||
@@ -656,6 +656,15 @@ pub async fn start_listen<T: InvokeUiCM>(
|
||||
Some(Data::Close) => {
|
||||
break;
|
||||
}
|
||||
Some(Data::StartVoiceCall) => {
|
||||
cm.voice_call_started(current_id);
|
||||
}
|
||||
Some(Data::VoiceCallIncoming) => {
|
||||
cm.voice_call_incoming(current_id);
|
||||
}
|
||||
Some(Data::CloseVoiceCall(reason)) => {
|
||||
cm.voice_call_closed(current_id, reason.as_str());
|
||||
}
|
||||
None => {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user