Use new Core.stop() method

This commit is contained in:
Sylvain Berfini 2019-03-01 15:49:31 +01:00
parent 1ee8e83621
commit 460640d59e
2 changed files with 3 additions and 11 deletions

View file

@ -686,9 +686,8 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
}
public void restartCore() {
destroyCore();
startLibLinphone(mServiceContext, false);
sExited = false;
mCore.stop();
mCore.start();
}
private synchronized void startLibLinphone(Context c, boolean isPush) {
@ -877,7 +876,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
mCore.setNetworkReachable(false);
}
}
mCore = null;
mCore.stop();
}
public void enableProximitySensing(boolean enable) {

View file

@ -425,13 +425,6 @@ public final class LinphoneService extends Service {
sInstance = null;
LinphoneManager.destroy();
// The following are required if we want for the Core's finalize() method to be called
// before the super.onDestroy() call.
// We have to so there are no more ref on the native LinphoneCore object and thus call
// it's uninit() method which will free the AndroidPlatformHelper resources...
// Problem is both the below methods do not guaranty the finalize will be called in time...
// System.gc();
// System.runFinalization();
// Make sure our notification is gone.
mNotificationManager.destroy();