Microphone Remains Active After Swiping JitsiMeetActivity from Recent Tasks
Closed this issue · 4 comments
What happened?
I have an activity that launches JitsiMeetActivity for managing video conferences. However, if the conference activity is swiped away from the recent tasks, the React instance remains active, and the microphone continues to be used.
How can I properly terminate the session and release the microphone?
If the conference were running in a single activity setup, this issue wouldn’t arise because closing the activity would clean up everything. But in the current structure, the lingering React instance and microphone usage need explicit handling.
Also, when I swipe out of the activity, isReadyToClose is set to false, meaning that ConnectionService.abortConnections() will not be called.
<activity
android:name=".ConferenceJitsiActivity"
android:launchMode="singleInstance"
android:supportsPictureInPicture="true"
android:resizeableActivity="true"
android:taskAffinity=".ConferenceAffinity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:excludeFromRecents="true"
android:windowSoftInputMode="adjustResize"
/>
@Override
public void onDestroy() {
JitsiMeetLogger.i("onDestroy()");
// Here we are trying to handle the following corner case: an application using the SDK
// is using this Activity for displaying meetings, but there is another "main" Activity
// with other content. If this Activity is "swiped out" from the recent list we will get
// Activity#onDestroy() called without warning. At this point we can try to leave the
// current meeting, but when our view is detached from React the JS <-> Native bridge won't
// be operational so the external API won't be able to notify the native side that the
// conference terminated. Thus, try our best to clean up.
if (!isReadyToClose) {
JitsiMeetLogger.i("onDestroy(): leaving...");
leave();
}
this.jitsiView = null;
if (AudioModeModule.useConnectionService()) {
ConnectionService.abortConnections();
}
JitsiMeetOngoingConferenceService.abort(this);
LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver);
JitsiMeetActivityDelegate.onHostDestroy(this);
super.onDestroy();
}
Platform
- Chrome (or Chromium based)
- Firefox
- Safari
- Other desktop browser
- Android browser
- iOS browser
- Electron app
- Android mobile app
- iOS mobile app
- Custom app using a mobile SDK
Browser / app / sdk version
99.0.0
Relevant log output
No response
Reproducibility
- The problem is reproducible on meet.jit.si
More details?
No response
Hey there!
First, what SDK version are you using? 99.0.0 is not a released version. Can you reproduce this with 10.3.0?
Also, when I swipe out of the activity, isReadyToClose is set to false, meaning that ConnectionService.abortConnections() will not be called.
Why do you think that? No code is skipped in onDestroy, that should be called. Note that CS is not enabled by default anyway.
We can close this issue:
Problem was that i have called dispose in onDestroy():
jitsyView.dispose()
which then lost communication to native bridge and memory leaks happened.
We can close this issue:
Problem was that i have called dispose in onDestroy():
jitsyView.dispose()
which then lost communication to native bridge and memory leaks happened.
Good to hear!