Add restart linphone core method

This commit is contained in:
Margaux Clerc 2015-10-30 11:19:16 +01:00
parent 8370093c96
commit 47b76b3d43

View file

@ -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) {