Terminate calls when killing task

This commit is contained in:
Sylvain Berfini 2018-02-15 10:02:49 +01:00
parent cb76369a9a
commit 9758a6f684

View file

@ -803,11 +803,15 @@ public final class LinphoneService extends Service {
@Override @Override
public void onTaskRemoved(Intent rootIntent) { public void onTaskRemoved(Intent rootIntent) {
if (getResources().getBoolean(R.bool.kill_service_with_task_manager)) { if (getResources().getBoolean(R.bool.kill_service_with_task_manager)) {
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
if (lc != null) {
lc.terminateAllCalls();
}
Log.d("Task removed, stop service"); Log.d("Task removed, stop service");
// If push is enabled, don't unregister account, otherwise do unregister // If push is enabled, don't unregister account, otherwise do unregister
if (LinphonePreferences.instance().isPushNotificationEnabled()) { if (LinphonePreferences.instance().isPushNotificationEnabled()) {
Core lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
if (lc != null) lc.setNetworkReachable(false); if (lc != null) lc.setNetworkReachable(false);
} }
stopSelf(); stopSelf();