If you have a JabberGuestCall instance instantiated in your app, and your app is dismissed to the background, Android may garbage collect that JabberGuestCall instance along with your app while it remains in the background. If this happens and your app was not in an active call, this is ok because you can always re-create a new JabberGuestCall instance when returning to the foreground. However, if you were in an active call when the app was dismissed to the background, and if the JabberGuestCall instance managing that call is garbage collected, then the active call will be immediately terminated. Re-creating a new JabberGuestCall instance in this case when returning to the foreground will not automatically redial and try to start another call.
One way to work around this is to spin up a background service while your calls are active, and make sure that background service holds on to its own copy of your JabberGuestCall instance. While this doesn't guarantee that the JabberGuestCall instance won't still be garbage collected (even background services in Android can still be stopped in some cases), it does present a greater probability that your call will not be dropped arbitrarily if your app is running in the background during an active call.
For your convenience, the JabberGuest SDK for Android does provide such a service for you to use, CallService. The CallService class monitors an active call and provides a number of other benefits. It is optional, but recommended that this service is started whenever there is an active call. Additionally, if your app activities extend from JabberGuestCallActivity, then this CallService will be automatically used.
For more information on how to use CallService in your app, please refer to the CallService class in the API Reference.
If you are going to handle notifications from JabberGuestCall, it is recommended to register your BroadcastReceivers when your component is coming to the foreground, and to unregister your BroadcastReceivers when you are going to the background, to reduce resource usage. In most cases, processing notifications from JabberGuestCall does not need to happen while the application is in the background.
It is also recommended to setup one InvalidCertificateHandler in the onResume() method of your activity (or fragment) to handle the invalid certificate event. For further information please refer to the Certificates section of the developer guide.
Note that the PreviewFragment and CallFragment classes have BroadcastReceivers built-in, and they already handle the logic for proper registration and unregistration.
During a call, JabberGuestCall by default will not change the Audio or Video mute states when the app is pushed into the background. You can always choose to change the mute state of the transmitted Audio or Video from the Android device during a call based on your app being in the background or foreground. If desired, you will have to add this logic into your application.
//To simply mute the Audio and Video
JabberGuestCall.getInstance().muteAudio();
JabberGuestCall.getInstance().muteVideo();