Explorar el Código

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é hace 4 años
padre
commit
d9250aa986
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  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 Ver fichero

@@ -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…
Cancelar
Guardar