浏览代码

Fix reconnection when the web socket was abruptly closed

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 <danxuliu@gmail.com>
Daniel Calviño Sánchez 2 年之前
父节点
当前提交
6466aaea20
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

+ 2 - 1
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;