aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2016-08-11 13:16:54 -0700
committerTyler Gunn <tgunn@google.com>2016-08-11 13:16:54 -0700
commit25a72fccf3313ab46a1dd03096f8944a96499406 (patch)
treeabd8a8f51b5891b83c4117a704770fc6e4e65d28
parentafb53c826d0f4614311a93d24a9bf8fe2b0a51a5 (diff)
downloadims-25a72fccf3313ab46a1dd03096f8944a96499406.tar.gz
Add prototype of terminate() which supports override terminate reason code.
When ImsCall#termiante(int) is called with a reason code, the modem will only actually disconnect the call for some disconnect reasons. Adding an override of that method which allows the caller to specify an override which is reported as the actual disconnect reason in the onCallSessionTerminated callback in ImsPhoneCallTracker. Bug: 30702393 Change-Id: I006046c03630e9d010424591f3bbb7d46da3a76f
-rw-r--r--src/java/com/android/ims/ImsCall.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/java/com/android/ims/ImsCall.java b/src/java/com/android/ims/ImsCall.java
index 266245d4..74614586 100644
--- a/src/java/com/android/ims/ImsCall.java
+++ b/src/java/com/android/ims/ImsCall.java
@@ -562,6 +562,15 @@ public class ImsCall implements ICall {
private ImsCallSessionListenerProxy mImsCallSessionListenerProxy;
/**
+ * When calling {@link #terminate(int, int)}, an override for the termination reason which the
+ * modem returns.
+ *
+ * Necessary because passing in an unexpected {@link ImsReasonInfo} reason code to
+ * {@link #terminate(int)} will cause the modem to ignore the terminate request.
+ */
+ private int mOverrideReason = ImsReasonInfo.CODE_UNSPECIFIED;
+
+ /**
* Create an IMS call object.
*
* @param context the context for accessing system services
@@ -1145,6 +1154,12 @@ public class ImsCall implements ICall {
}
}
+ public void terminate(int reason, int overrideReason) throws ImsException {
+ logi("terminate :: reason=" + reason + " ; overrideReadon=" + overrideReason);
+ mOverrideReason = overrideReason;
+ terminate(reason);
+ }
+
/**
* Terminates an IMS call (e.g. user initiated).
*
@@ -2207,6 +2222,12 @@ public class ImsCall implements ICall {
return;
}
+ if (mOverrideReason != ImsReasonInfo.CODE_UNSPECIFIED) {
+ logi("callSessionTerminated :: overrideReasonInfo=" + mOverrideReason);
+ reasonInfo = new ImsReasonInfo(mOverrideReason, reasonInfo.getExtraCode(),
+ reasonInfo.getExtraMessage());
+ }
+
// Process the termination first. If we are in the midst of establishing a conference
// call, we may bury this callback until we are done. If there so no conference
// call, the code after this function will be a NOOP.