Add restart linphone core method

This commit is contained in:
Margaux Clerc 2015-10-30 11:19:16 +01:00
parent 4e5691e945
commit dc9eb9cf1d

View file

@ -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();