From 33c1553942c01f2216c085855ed0bc36a65e6b55 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 20 Nov 2012 14:07:46 +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 0fcea5a87..ed4e8b750 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -1025,7 +1025,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) { @@ -1399,7 +1402,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(); }