Improved destruction of LinphoneCore when device shuts down
This commit is contained in:
parent
ab306f06fd
commit
119a7fe7f4
1 changed files with 2 additions and 6 deletions
|
@ -18,7 +18,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
package org.linphone;
|
package org.linphone;
|
||||||
|
|
||||||
import org.linphone.core.LinphoneCore;
|
|
||||||
import org.linphone.core.LinphoneCoreFactory;
|
import org.linphone.core.LinphoneCoreFactory;
|
||||||
import org.linphone.core.LpConfig;
|
import org.linphone.core.LpConfig;
|
||||||
import org.linphone.mediastream.Log;
|
import org.linphone.mediastream.Log;
|
||||||
|
@ -32,11 +31,8 @@ public class BootReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent.getAction().equalsIgnoreCase(Intent.ACTION_SHUTDOWN)) {
|
if (intent.getAction().equalsIgnoreCase(Intent.ACTION_SHUTDOWN)) {
|
||||||
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
Log.w("Device is shutting down, destroying LinphoneCore to unregister");
|
||||||
if (lc != null) {
|
LinphoneManager.destroy();
|
||||||
Log.w("Device is shutting down, destroying LinphoneCore to unregister");
|
|
||||||
lc.destroy();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
String path = context.getFilesDir().getAbsolutePath() + "/.linphonerc";
|
String path = context.getFilesDir().getAbsolutePath() + "/.linphonerc";
|
||||||
LpConfig lpConfig = LinphoneCoreFactory.instance().createLpConfig(path);
|
LpConfig lpConfig = LinphoneCoreFactory.instance().createLpConfig(path);
|
||||||
|
|
Loading…
Reference in a new issue