Improved destruction of LinphoneCore when device shuts down
This commit is contained in:
parent
ab306f06fd
commit
119a7fe7f4
1 changed files with 2 additions and 6 deletions
|
@ -18,7 +18,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
*/
|
||||
package org.linphone;
|
||||
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.LinphoneCoreFactory;
|
||||
import org.linphone.core.LpConfig;
|
||||
import org.linphone.mediastream.Log;
|
||||
|
@ -32,11 +31,8 @@ public class BootReceiver extends BroadcastReceiver {
|
|||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (intent.getAction().equalsIgnoreCase(Intent.ACTION_SHUTDOWN)) {
|
||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||
if (lc != null) {
|
||||
Log.w("Device is shutting down, destroying LinphoneCore to unregister");
|
||||
lc.destroy();
|
||||
}
|
||||
Log.w("Device is shutting down, destroying LinphoneCore to unregister");
|
||||
LinphoneManager.destroy();
|
||||
} else {
|
||||
String path = context.getFilesDir().getAbsolutePath() + "/.linphonerc";
|
||||
LpConfig lpConfig = LinphoneCoreFactory.instance().createLpConfig(path);
|
||||
|
|
Loading…
Reference in a new issue