From dc9eb9cf1d4c3ebef32638da9e96f40c434375cf Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Fri, 30 Oct 2015 11:19:16 +0100 Subject: [PATCH] Add restart linphone core method --- src/org/linphone/LinphoneManager.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index ae597b8fa..f7c141004 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -550,6 +550,28 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag } } + public synchronized final void destroyLinphoneCore(Context c) { + sExited = true; + BluetoothManager.getInstance().destroy(); + try { + mTimer.cancel(); + mLc.destroy(); + } + catch (RuntimeException e) { + e.printStackTrace(); + } + finally { + mServiceContext.unregisterReceiver(instance.mKeepAliveReceiver); + mLc = null; + } + } + + public void restartLinphoneCore(Context context){ + destroyLinphoneCore(context); + startLibLinphone(context); + sExited = true; + } + private synchronized void startLibLinphone(Context c) { try { copyAssetsFromPackage();