diff options
author | Pooja Jain <poojain@codeaurora.org> | 2018-02-08 01:27:51 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-02-08 01:27:51 +0000 |
commit | 45cc8cc8c1031d255720b8ab7104eaf68bd6833b (patch) | |
tree | 87cfd069d65d351f1fb91c3a9db5fddd0efdf93d | |
parent | 91e072a0f0a4cbbab4692853594d2ff224d5b04b (diff) | |
parent | 25c986c76831a68da52764b4d1f6347aefee928a (diff) | |
download | ims-45cc8cc8c1031d255720b8ab7104eaf68bd6833b.tar.gz |
IMS: Add support for call deflection feature am: a7ba0fb284
am: 25c986c768
Change-Id: Icbc543f5aaf3d49fecf16ccb8b1abfade4ef6b1c
-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 |