diff options
author | Pooja Jain <poojain@codeaurora.org> | 2018-02-08 01:00:48 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-02-08 01:00:48 +0000 |
commit | 25c986c76831a68da52764b4d1f6347aefee928a (patch) | |
tree | 87cfd069d65d351f1fb91c3a9db5fddd0efdf93d | |
parent | f3be06368835697b50859db0ee8401089de3069a (diff) | |
parent | a7ba0fb28496aff091a2e172607f0e4e848c3c1c (diff) | |
download | ims-25c986c76831a68da52764b4d1f6347aefee928a.tar.gz |
IMS: Add support for call deflection feature
am: a7ba0fb284
Change-Id: Ie738a8187d3480988c81fbda560a911f6c3aeba2
-rw-r--r-- | src/java/com/android/ims/ImsCall.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/java/com/android/ims/ImsCall.java b/src/java/com/android/ims/ImsCall.java index 760e5e81..5fceb7af 100644 --- a/src/java/com/android/ims/ImsCall.java +++ b/src/java/com/android/ims/ImsCall.java @@ -1166,6 +1166,30 @@ public class ImsCall implements ICall { } /** + * Deflects a call. + * + * @param number number to be deflected to. + * @throws ImsException if the IMS service fails to deflect the call + */ + public void deflect(String number) throws ImsException { + logi("deflect :: session=" + mSession + ", number=" + Rlog.pii(TAG, number)); + + synchronized(mLockObj) { + if (mSession == null) { + throw new ImsException("No call to deflect", + ImsReasonInfo.CODE_LOCAL_CALL_TERMINATED); + } + + try { + mSession.deflect(number); + } catch (Throwable t) { + loge("deflect :: ", t); + throw new ImsException("deflect()", t, 0); + } + } + } + + /** * Rejects a call. * * @param reason reason code to reject an incoming call |