From 47b76b3d435d985308f8112880f5c8afa833e3ef 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 | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index dcd1e3c3f..825215eff 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -566,9 +566,26 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag } } - public void resetLinphoneCore(Context c){ - destroyLinphoneCore(c); - startLibLinphone(c); + 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) {