aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYouming Ye <paulye@google.com>2019-03-19 16:50:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-03-19 16:50:58 +0000
commit85f6eb0cdd3e51c9e7c220c93b5b4fc77e1c413a (patch)
tree23b21da6104a59dc2043d51160c918eb95cfe19b
parentaa43f57812772a8daa97611591c64116158b8ad0 (diff)
parent57209e5f9eba51261a6b5ab6cb31aa949c0c0870 (diff)
downloadims-oreo-mr1-iot-release.tar.gz
-rw-r--r--src/java/com/android/ims/ImsCall.java38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/java/com/android/ims/ImsCall.java b/src/java/com/android/ims/ImsCall.java
index 74098a00..e45549ac 100644
--- a/src/java/com/android/ims/ImsCall.java
+++ b/src/java/com/android/ims/ImsCall.java
@@ -16,8 +16,6 @@
package com.android.ims;
-import com.android.internal.R;
-
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -1368,6 +1366,15 @@ public class ImsCall implements ICall {
}
}
+ private boolean isUpdatePending(ImsCall imsCall) {
+ if (imsCall != null && imsCall.mUpdateRequest != UPDATE_NONE) {
+ loge("merge :: update is in progress; request=" +
+ updateRequestToString(mUpdateRequest));
+ return true;
+ }
+ return false;
+ }
+
/**
* Merges the active & hold call.
*
@@ -1378,25 +1385,23 @@ 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) {
+ // If the fg call of the merge is in the midst of some other operation, we cannot merge.
+ // fg is either the host or the peer of the merge
+ if (isUpdatePending(this)) {
setCallSessionMergePending(false);
- if (mMergePeer != null) {
- mMergePeer.setCallSessionMergePending(false);
- }
- loge("merge :: update is in progress; request=" +
- updateRequestToString(mUpdateRequest));
+ if (mMergePeer != null) mMergePeer.setCallSessionMergePending(false);
+ if (mMergeHost != null) mMergeHost.setCallSessionMergePending(false);
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) {
+ // If the bg call of the merge is in the midst of some other operation, we cannot merge.
+ // bg is either the peer or the host of the merge.
+ if (isUpdatePending(mMergePeer) || isUpdatePending(mMergeHost)) {
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",
+ if (mMergePeer != null) mMergePeer.setCallSessionMergePending(false);
+ if (mMergeHost != null) mMergeHost.setCallSessionMergePending(false);
+ throw new ImsException("Peer or host call update is in progress",
ImsReasonInfo.CODE_LOCAL_ILLEGAL_STATE);
}
@@ -1421,6 +1426,9 @@ public class ImsCall implements ICall {
// merge is pending.
mUpdateRequest = UPDATE_MERGE;
mMergePeer.mUpdateRequest = UPDATE_MERGE;
+ } else if (mMergeHost != null && !mMergeHost.isMultiparty() && !isMultiparty()) {
+ mUpdateRequest = UPDATE_MERGE;
+ mMergeHost.mUpdateRequest = UPDATE_MERGE;
}
mSession.merge();