From c49d9d56fa4b76a635422170e27566459e2e8238 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 20 Nov 2012 14:17:07 +0100 Subject: [PATCH] Prevent breaking audio of ongoing GSM call when releasing a SIP call. --- src/org/linphone/LinphoneManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index 4e5cc6011..f1c72506d 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -1008,7 +1008,10 @@ public final class LinphoneManager implements LinphoneCoreListener { } if (state == CallEnd || state == Error) { - mAudioManager.setMode(MODE_NORMAL); + TelephonyManager tm = (TelephonyManager) LinphoneActivity.instance().getSystemService(Context.TELEPHONY_SERVICE); + if (tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) { + mAudioManager.setMode(MODE_NORMAL); + } } if (state == State.Connected) { @@ -1390,7 +1393,8 @@ public final class LinphoneManager implements LinphoneCoreListener { boolean sendCamera = mLc.getConferenceSize() == 0; enableCamera(call, sendCamera); } - if (state == State.CallEnd && mLc.getCallsNb() == 0) { + TelephonyManager tm = (TelephonyManager) LinphoneActivity.instance().getSystemService(Context.TELEPHONY_SERVICE); + if (state == State.CallEnd && mLc.getCallsNb() == 0 && tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) { routeAudioToReceiver(); }