瀏覽代碼

Fix call not joined again if reconnecting while in pip mode

When a publisher fails during a call a reconnection is triggered, which
first leaves the call and then initiates it again. Initiating a video
call first request the permissions, but it seems that the request hangs
when done while in PiP mode. Due to this if the publisher fails while in
PiP mode and the call is initiated again the call will be simply left,
without reconnecting to it.

The problem is specific to video calls, as in voice only calls
"onMicrophoneClick" is used instead, and it explicitly checks if the
permissions are already granted. Checking if the permissions are already
granted before requesting them is also recommended in the Android
developer guide, and as the permissions are requested during the
original call initialization it is expected that they will be already
granted if the call is changed to PiP mode, so the problem is work
arounded that way (but if the permissions are not granted when the
publisher fails in PiP mode the problem would still happen, although
that should be quite uncommon).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Daniel Calviño Sánchez 2 年之前
父節點
當前提交
c01c052181
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

+ 3 - 1
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

@@ -700,7 +700,9 @@ public class CallActivity extends CallBaseActivity {
         if (isVoiceOnlyCall) {
             onMicrophoneClick();
         } else {
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+            if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CALL)) {
+                onPermissionsGranted();
+            } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                 requestPermissions(PERMISSIONS_CALL, 100);
             } else {
                 onRequestPermissionsResult(100, PERMISSIONS_CALL, new int[]{1, 1});