ソースを参照

android fix: do not enter PiP mode when the permissions alert is shown

Entering PiP mode while the permissions dialog is display will not only
fail, but also mess up the Activity lifecycle on some OS versions.
We may end up with two activity/fragment instances and a situation where
the onStop callback was not called yet on the instance #1 while
the onResume has been already called on instance #2.
master
paweldomas 6年前
コミット
0889ffdf27

+ 9
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivityDelegate.java ファイルの表示

40
     private static PermissionListener permissionListener;
40
     private static PermissionListener permissionListener;
41
     private static Callback permissionsCallback;
41
     private static Callback permissionsCallback;
42
 
42
 
43
+    /**
44
+     * Tells whether or not the permissions request is currently in progress.
45
+     *
46
+     * @return {@code true} if the permssions are being requested or {@code false} otherwise.
47
+     */
48
+    static boolean arePermissionsBeingRequested() {
49
+        return permissionListener != null;
50
+    }
51
+
43
     /**
52
     /**
44
      * {@link Activity} lifecycle method which should be called from
53
      * {@link Activity} lifecycle method which should be called from
45
      * {@code Activity#onActivityResult} so we are notified about results of external intents
54
      * {@code Activity#onActivityResult} so we are notified about results of external intents

+ 1
- 0
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java ファイルの表示

123
                 PictureInPictureModule.class);
123
                 PictureInPictureModule.class);
124
         if (pipModule != null
124
         if (pipModule != null
125
                 && PictureInPictureModule.isPictureInPictureSupported()
125
                 && PictureInPictureModule.isPictureInPictureSupported()
126
+                && !JitsiMeetActivityDelegate.arePermissionsBeingRequested()
126
                 && this.url != null) {
127
                 && this.url != null) {
127
             try {
128
             try {
128
                 pipModule.enterPictureInPicture();
129
                 pipModule.enterPictureInPicture();

読み込み中…
キャンセル
保存