fix: android prompt "Failed to stop voice call" on conn ended (#8434)

* fix: android prompt "Failed to stop voice call" on conn ended

Signed-off-by: fufesou <linlong1266@gmail.com>

* Remove invalid comment

Signed-off-by: fufesou <linlong1266@gmail.com>

* Better control of voice call status

Signed-off-by: fufesou <linlong1266@gmail.com>

* Better voice call status control

Signed-off-by: fufesou <linlong1266@gmail.com>

* better end conn for voice call

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2024-06-21 16:43:54 +08:00
committed by GitHub
parent 32c4712d5e
commit 74cc5abd09
3 changed files with 11 additions and 14 deletions

View File

@@ -105,11 +105,10 @@ class _RemotePageState extends State<RemotePage> {
}
await keyboardSubscription.cancel();
removeSharedStates(widget.id);
if (isAndroid) {
// Only one client is considered here for now.
// TODO: take into account the case where there are multiple clients
gFFI.invokeMethod("on_voice_call_closed");
}
// `on_voice_call_closed` should be called when the connection is ended.
// The inner logic of `on_voice_call_closed` will check if the voice call is active.
// Only one client is considered here for now.
gFFI.chatModel.onVoiceCallClosed("End connetion");
}
// to-do: It should be better to use transparent color instead of the bgColor.