瀏覽代碼

android: bring back activity to the foreground when exiting PiP

When exiting PiP with by pressing the X the onPictureInPictureModeChanged method
is called. Since onResume is called a while after, in case the maximize button
is called, it's not easy to know if the user pressed the X button, and that was
the cause for exiting PiP.

So, in order to avoid show the user they are still in the meeting, bring the
activity to the foregound so they can hangup.
j8
Saúl Ibarra Corretgé 4 年之前
父節點
當前提交
d9250aa986
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12
    0
      android/app/src/main/java/org/jitsi/meet/MainActivity.java

+ 12
- 0
android/app/src/main/java/org/jitsi/meet/MainActivity.java 查看文件

@@ -210,6 +210,18 @@ public class MainActivity extends JitsiMeetActivity {
210 210
         return super.onKeyUp(keyCode, event);
211 211
     }
212 212
 
213
+    @Override
214
+    public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode) {
215
+        super.onPictureInPictureModeChanged(isInPictureInPictureMode);
216
+
217
+        Log.d(TAG, "Is in picture-in-picture mode: " + isInPictureInPictureMode);
218
+
219
+        if (!isInPictureInPictureMode) {
220
+            this.startActivity(new Intent(this, getClass())
221
+                .addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
222
+        }
223
+    }
224
+
213 225
     // Helper methods
214 226
     //
215 227
 

Loading…
取消
儲存