From 6466aaea20ec517b3f4a2703d0c0cf6574a33d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Sat, 26 Nov 2022 20:14:44 +0100 Subject: [PATCH] Fix reconnection when the web socket was abruptly closed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the web socket is abruptly closed it is connected again and the call is rejoined. However, the call was rejoined in a background thread, so an exception was thrown when trying to modify the views, which prevented the call from being joined again. Besides that the call state needs to be explicitly changed, as if the web socket was connected again while in a call the state would be already "JOINED" or "IN_CONVERSATION", which prevents the signaling settings from being fetched again after the permissions check, and therefore also prevented the call from being joined again. Signed-off-by: Daniel Calviño Sánchez --- .../main/java/com/nextcloud/talk/activities/CallActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 7fc54561f..cbd377bc9 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -1578,7 +1578,8 @@ public class CallActivity extends CallBaseActivity { if (currentCallStatus == CallStatus.RECONNECTING) { hangup(false); } else { - initiateCall(); + setCallState(CallStatus.RECONNECTING); + runOnUiThread(this::initiateCall); } } break;