Przeglądaj źródła

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 lat temu
rodzic
commit
d9250aa986

+ 12
- 0
android/app/src/main/java/org/jitsi/meet/MainActivity.java Wyświetl plik

@@ -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
 

Ładowanie…
Anuluj
Zapisz