diff options
author | Pooja Jain <poojain@codeaurora.org> | 2018-02-08 02:16:03 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-02-08 02:16:03 +0000 |
commit | 86e1fe5d1bcf1ae458d6c6b4c2d8a37e3663cc10 (patch) | |
tree | d86d3d7b2b555fab2f705946168b6d55ce331647 | |
parent | 25cba0e65d38a084d6459a3c745fb9b1439b3be5 (diff) | |
parent | 45cc8cc8c1031d255720b8ab7104eaf68bd6833b (diff) | |
download | ims-86e1fe5d1bcf1ae458d6c6b4c2d8a37e3663cc10.tar.gz |
IMS: Add support for call deflection feature am: a7ba0fb284 am: 25c986c768
am: 45cc8cc8c1
Change-Id: I59696ce4cb4899023a8a747eb2ec785eca3baa55
-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 e32103ef..1d728a1a 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 |