Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(android) fix JitsiMeetActivity.onDestroy not leaving the room

Saúl Ibarra Corretgé9e147d784262
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java
index 41526fce3e..119c6d8f44 100644
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java
+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java
@@ -177,8 +177,11 @@ public class JitsiMeetActivity extends AppCompatActivity
}
protected void leave() {
- Intent hangupBroadcastIntent = BroadcastIntentHelper.buildHangUpIntent();
- LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(hangupBroadcastIntent);
+ if (this.jitsiView != null) {
+ this.jitsiView.abort();
+ } else {
+ JitsiMeetLogger.w("Cannot leave, view is null");
+ }
}
private @Nullable
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java
index d021a7494e..59d6e6b4f3 100644
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java
+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java
@@ -157,6 +157,14 @@ public class JitsiMeetView extends FrameLayout {
setProps(options != null ? options.asProps() : new Bundle());
}
+ /**
+ * Internal method which aborts running RN by passing empty props.
+ * This is only meant to be used from the enclosing Activity's onDestroy.
+ */
+ public void abort() {
+ setProps(new Bundle());
+ }
+
/**
* Creates the {@code ReactRootView} for the given app name with the given
* props. Once created it's set as the view of this {@code FrameLayout}.