diff options
| author | Anthony Lee <anthonylee@google.com> | 2015-07-23 19:33:17 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-23 19:33:17 +0000 |
| commit | 5e2ca1726a9704e92028179de3bf83626e3e9612 (patch) | |
| tree | 07355df5c9426c78764b0c4dc4a79e9f163f318e | |
| parent | 77e4256dcb15e55e1dd09904fe7847df6be3aa02 (diff) | |
| parent | 22444533a7c42c71dad746322094777fee352d3c (diff) | |
| download | android_frameworks_opt_net_ims-5e2ca1726a9704e92028179de3bf83626e3e9612.tar.gz android_frameworks_opt_net_ims-5e2ca1726a9704e92028179de3bf83626e3e9612.tar.bz2 android_frameworks_opt_net_ims-5e2ca1726a9704e92028179de3bf83626e3e9612.zip | |
am 22444533: Merge "Handle hangup for 4 way conference scenario" into mnc-dev
* commit '22444533a7c42c71dad746322094777fee352d3c':
Handle hangup for 4 way conference scenario
| -rw-r--r-- | src/java/com/android/ims/ImsCall.java | 65 | ||||
| -rw-r--r-- | src/java/com/android/ims/internal/ImsCallSession.java | 27 |
2 files changed, 33 insertions, 59 deletions
diff --git a/src/java/com/android/ims/ImsCall.java b/src/java/com/android/ims/ImsCall.java index be90e25..afbb196 100644 --- a/src/java/com/android/ims/ImsCall.java +++ b/src/java/com/android/ims/ImsCall.java @@ -2327,40 +2327,6 @@ public class ImsCall implements ICall { logi("callSessionMergeStarted :: session=" + session + " newSession=" + newSession + ", profile=" + profile); - if (!isCallSessionMergePending()) { - // Odd, we are not in the midst of merging anything. - logi("callSessionMergeStarted :: no merge in progress."); - return; - } - - // There are 2 ways that we can go here. If the session that supplied the params - // is not null, then it is the new session that represents the new conference - // if the merge succeeds. If it is null, the merge is happening on our current - // ImsCallSession. - if (session == null) { - // Everything is already set up and we just need to make sure - // that we properly respond to all the future callbacks about - // this merge. - if (CONF_DBG) { - logi("callSessionMergeStarted :: merging into existing ImsCallSession"); - } - return; - } - - if (CONF_DBG) { - logi("callSessionMergeStarted :: setting our transient ImsCallSession"); - } - - // If we are here, this means that we are creating a new conference and - // we need to do some extra work around managing a new ImsCallSession that - // could represent our new ImsCallSession if the merge succeeds. - synchronized(ImsCall.this) { - // Keep track of this session for future callbacks to indicate success - // or failure of this merge. - mTransientConferenceSession = newSession; - mTransientConferenceSession.setListener(createCallSessionListener()); - } - return; } @@ -2377,7 +2343,7 @@ public class ImsCall implements ICall { /** * We received a callback from ImsCallSession that merge completed. - * @param session - this session can have 2 values based on the below scenarios + * @param newSession - this session can have 2 values based on the below scenarios * * Conference Scenarios : * Case 1 - 3 way success case @@ -2389,24 +2355,29 @@ public class ImsCall implements ICall { * call (mergeHost) and the single party call is in the background. * * Conference Result: - * session : active session after conference - * session = new session for case 1, 2, 3. Should be considered as mTransientConferencession - * session = Active conference session for case 5, same as current session, - * mergehost was foreground call - * mTransientConferencession will be null - * session = Active conference session for case 4, mergeHost was background call - * mTransientConferencession will be null + * session : new session after conference + * newSession = new session for case 1, 2, 3. + * Should be considered as mTransientConferencession + * newSession = Active conference session for case 5 will be null + * mergehost was foreground call + * mTransientConferencession will be null + * newSession = Active conference session for case 4 will be null + * mergeHost was background call + * mTransientConferencession will be null */ @Override - public void callSessionMergeComplete(ImsCallSession session) { - logi("callSessionMergeComplete :: session=" + session); + public void callSessionMergeComplete(ImsCallSession newSession) { + logi("callSessionMergeComplete :: newSession =" + newSession); if (!isMergeHost()) { // Handles case 4 mMergeHost.processMergeComplete(); } else { - // Handles case 1, 2, 3, 5 - mTransientConferenceSession = doesCallSessionExistsInMerge(session) ? - null: session; + // Handles case 1, 2, 3 + if (newSession != null) { + mTransientConferenceSession = doesCallSessionExistsInMerge(newSession) ? + null: newSession; + } + // Handles case 5 processMergeComplete(); } } diff --git a/src/java/com/android/ims/internal/ImsCallSession.java b/src/java/com/android/ims/internal/ImsCallSession.java index 258af4c..d8614e3 100644 --- a/src/java/com/android/ims/internal/ImsCallSession.java +++ b/src/java/com/android/ims/internal/ImsCallSession.java @@ -1044,10 +1044,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"); } /** @@ -1056,21 +1055,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); + } } } |
