From d9ed874439293ed6c34ce27a3689711c986f977b Mon Sep 17 00:00:00 2001 From: Anju Mathapati Date: Fri, 17 Jul 2015 14:54:10 -0700 Subject: Handle hangup for 4 way conference scenario Pass the session only during 3-way conference scenario. For all other cases pass it as null, so as to avoid the listenerproxy getting over-written Bug: 22173672 Change-Id: I10a223aaabe731a3a7d3c24da123dae660ed5bb3 --- .../com/android/ims/internal/ImsCallSession.java | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/java/com/android/ims/internal') diff --git a/src/java/com/android/ims/internal/ImsCallSession.java b/src/java/com/android/ims/internal/ImsCallSession.java index d7b0392f..b89323d6 100644 --- a/src/java/com/android/ims/internal/ImsCallSession.java +++ b/src/java/com/android/ims/internal/ImsCallSession.java @@ -1034,10 +1034,9 @@ public class ImsCallSession { @Override public void callSessionMergeStarted(IImsCallSession session, IImsCallSession newSession, ImsCallProfile profile) { - if (mListener != null) { - mListener.callSessionMergeStarted(ImsCallSession.this, - new ImsCallSession(newSession), profile); - } + // This callback can be used for future use to add additional + // functionality that may be needed between conference start and complete + Log.d(TAG, "callSessionMergeStarted"); } /** @@ -1046,21 +1045,25 @@ public class ImsCallSession { * @param session The call session. */ @Override - public void callSessionMergeComplete(IImsCallSession activeCallSession) { + public void callSessionMergeComplete(IImsCallSession newSession) { if (mListener != null) { - // Check if the active session is the same session that was - // active before the merge request was sent. - ImsCallSession validActiveSession = ImsCallSession.this; + if (newSession != null) { + // Check if the active session is the same session that was + // active before the merge request was sent. + ImsCallSession validActiveSession = ImsCallSession.this; try { - if (!Objects.equals(miSession.getCallId(), activeCallSession.getCallId())) { + if (!Objects.equals(miSession.getCallId(), newSession.getCallId())) { // New session created after conference - validActiveSession = new ImsCallSession(activeCallSession); + validActiveSession = new ImsCallSession(newSession); } } catch (RemoteException rex) { Log.e(TAG, "callSessionMergeComplete: exception for getCallId!"); } - - mListener.callSessionMergeComplete(validActiveSession); + mListener.callSessionMergeComplete(validActiveSession); + } else { + // Session already exists. Hence no need to pass + mListener.callSessionMergeComplete(null); + } } } -- cgit v1.2.3