Commit b27a3676 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added a setting to disable automatic call pause when audio focus is lost

parent 2fc10b13
......@@ -32,6 +32,7 @@ import android.os.Build;
import org.linphone.core.AudioDevice;
import org.linphone.core.Call;
import org.linphone.core.Config;
import org.linphone.core.Core;
import org.linphone.core.CoreListenerStub;
import org.linphone.core.tools.Log;
......@@ -255,12 +256,17 @@ public class CoreManager {
public void onAudioFocusLost() {
if (mCore != null) {
if (mCore.isInConference()) {
Log.i("[Core Manager] App has lost audio focus, leaving conference");
mCore.leaveConference();
boolean pauseCallsWhenAudioFocusIsLost = mCore.getConfig().getBool("audio", "android_pause_calls_when_audio_focus_lost", true);
if (pauseCallsWhenAudioFocusIsLost) {
if (mCore.isInConference()) {
Log.i("[Core Manager] App has lost audio focus, leaving conference");
mCore.leaveConference();
} else {
Log.i("[Core Manager] App has lost audio focus, pausing all calls");
mCore.pauseAllCalls();
}
} else {
Log.i("[Core Manager] App has lost audio focus, pausing all calls");
mCore.pauseAllCalls();
Log.w("[Core Manager] Audio focus lost but keeping calls running");
}
}
}
......@@ -352,7 +358,7 @@ public class CoreManager {
sb.append(abi).append(", ");
}
Log.i(sb.substring(0, sb.length() - 2));
Log.i("=========================================");
Log.i("=========================================");
}
private void dumpLinphoneInformation() {
......@@ -367,6 +373,6 @@ public class CoreManager {
Log.i(sb.substring(0, sb.length() - 2));
Log.i("PACKAGE=", org.linphone.core.BuildConfig.LIBRARY_PACKAGE_NAME);
Log.i("BUILD TYPE=", org.linphone.core.BuildConfig.BUILD_TYPE);
Log.i("=========================================");
Log.i("=========================================");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment