From 9b1723376c2f04b30b677d94f9105220a014501e Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Wed, 6 Sep 2017 14:38:37 -0700 Subject: Prevent IMS call merge if the peer call has a pending update request. Currently, if the user requests merge, and the call they request the merge on is in the midst of some other pending operation (e.g. hold, resume), the system will prevent the merge from taking place. The logic, however does not account for the fact that the background call being merged into the foreground call could also be engaged in some other update operation. Added code to ensure that both calls are not actively engaged in some pending operation. Test: Manual Change-Id: Icc2f3786865345435bbf138b54736fc6f09c0aa4 Fixes: 63764631 --- src/java/com/android/ims/ImsCall.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/java/com/android/ims/ImsCall.java b/src/java/com/android/ims/ImsCall.java index 716687d7..c5e6368e 100644 --- a/src/java/com/android/ims/ImsCall.java +++ b/src/java/com/android/ims/ImsCall.java @@ -1319,13 +1319,28 @@ public class ImsCall implements ICall { logi("merge :: "); synchronized(mLockObj) { + // If the host of the merge is in the midst of some other operation, we cannot merge. if (mUpdateRequest != UPDATE_NONE) { + setCallSessionMergePending(false); + if (mMergePeer != null) { + mMergePeer.setCallSessionMergePending(false); + } loge("merge :: update is in progress; request=" + updateRequestToString(mUpdateRequest)); throw new ImsException("Call update is in progress", ImsReasonInfo.CODE_LOCAL_ILLEGAL_STATE); } + // The peer of the merge is in the midst of some other operation, we cannot merge. + if (mMergePeer != null && mMergePeer.mUpdateRequest != UPDATE_NONE) { + setCallSessionMergePending(false); + mMergePeer.setCallSessionMergePending(false); + loge("merge :: peer call update is in progress; request=" + + updateRequestToString(mMergePeer.mUpdateRequest)); + throw new ImsException("Peer call update is in progress", + ImsReasonInfo.CODE_LOCAL_ILLEGAL_STATE); + } + if (mSession == null) { loge("merge :: no call session"); throw new ImsException("No call session", -- cgit v1.2.3