Add restart linphone core method
This commit is contained in:
parent
4e5691e945
commit
dc9eb9cf1d
1 changed files with 22 additions and 0 deletions
|
@ -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) {
|
private synchronized void startLibLinphone(Context c) {
|
||||||
try {
|
try {
|
||||||
copyAssetsFromPackage();
|
copyAssetsFromPackage();
|
||||||
|
|
Loading…
Reference in a new issue