diff options
author | Ravi Paluri <quic_rpaluri@quicinc.com> | 2020-02-05 12:35:41 +0530 |
---|---|---|
committer | Ravi Paluri <quic_rpaluri@quicinc.com> | 2020-02-14 11:02:09 +0530 |
commit | f4b38e7ff15bef49e333dfb5a0eb788d65abe1ae (patch) | |
tree | 1a106d233c55f7b875f77c7781b38b0fee7fa09c /telecomm/java/android/telecom/ConnectionService.java | |
parent | 3819be4271be3085bc55d5e2665952dcc8a77991 (diff) |
IMS: Add support for IMS Explicit call transfer
Test: Manual
Bug: 62170207
Change-Id: I06a256adb0e1910d40809c91bcdd42c56a142842
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionService.java')
-rwxr-xr-x[-rw-r--r--] | telecomm/java/android/telecom/ConnectionService.java | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index 2aea723cf418..0dca006f37c0 100644..100755 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -128,6 +128,8 @@ public abstract class ConnectionService extends Service { private static final String SESSION_ANSWER = "CS.an"; private static final String SESSION_ANSWER_VIDEO = "CS.anV"; private static final String SESSION_DEFLECT = "CS.def"; + private static final String SESSION_TRANSFER = "CS.trans"; + private static final String SESSION_CONSULTATIVE_TRANSFER = "CS.cTrans"; private static final String SESSION_REJECT = "CS.r"; private static final String SESSION_REJECT_MESSAGE = "CS.rWM"; private static final String SESSION_SILENCE = "CS.s"; @@ -196,6 +198,8 @@ public abstract class ConnectionService extends Service { private static final int MSG_CREATE_CONFERENCE_FAILED = 37; private static final int MSG_REJECT_WITH_REASON = 38; private static final int MSG_ADD_PARTICIPANT = 39; + private static final int MSG_EXPLICIT_CALL_TRANSFER = 40; + private static final int MSG_EXPLICIT_CALL_TRANSFER_CONSULTATIVE = 41; private static Connection sNullConnection; @@ -481,6 +485,38 @@ public abstract class ConnectionService extends Service { } @Override + public void transfer(@NonNull String callId, @NonNull Uri number, + boolean isConfirmationRequired, Session.Info sessionInfo) { + Log.startSession(sessionInfo, SESSION_TRANSFER); + try { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = number; + args.argi1 = isConfirmationRequired ? 1 : 0; + args.arg3 = Log.createSubsession(); + mHandler.obtainMessage(MSG_EXPLICIT_CALL_TRANSFER, args).sendToTarget(); + } finally { + Log.endSession(); + } + } + + @Override + public void consultativeTransfer(@NonNull String callId, @NonNull String otherCallId, + Session.Info sessionInfo) { + Log.startSession(sessionInfo, SESSION_CONSULTATIVE_TRANSFER); + try { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = callId; + args.arg2 = otherCallId; + args.arg3 = Log.createSubsession(); + mHandler.obtainMessage( + MSG_EXPLICIT_CALL_TRANSFER_CONSULTATIVE, args).sendToTarget(); + } finally { + Log.endSession(); + } + } + + @Override public void silence(String callId, Session.Info sessionInfo) { Log.startSession(sessionInfo, SESSION_SILENCE); try { @@ -1108,6 +1144,30 @@ public abstract class ConnectionService extends Service { } break; } + case MSG_EXPLICIT_CALL_TRANSFER: { + SomeArgs args = (SomeArgs) msg.obj; + Log.continueSession((Session) args.arg3, SESSION_HANDLER + SESSION_TRANSFER); + try { + final boolean isConfirmationRequired = args.argi1 == 1; + transfer((String) args.arg1, (Uri) args.arg2, isConfirmationRequired); + } finally { + args.recycle(); + Log.endSession(); + } + break; + } + case MSG_EXPLICIT_CALL_TRANSFER_CONSULTATIVE: { + SomeArgs args = (SomeArgs) msg.obj; + Log.continueSession( + (Session) args.arg3, SESSION_HANDLER + SESSION_CONSULTATIVE_TRANSFER); + try { + consultativeTransfer((String) args.arg1, (String) args.arg2); + } finally { + args.recycle(); + Log.endSession(); + } + break; + } case MSG_DISCONNECT: { SomeArgs args = (SomeArgs) msg.obj; Log.continueSession((Session) args.arg2, SESSION_HANDLER + SESSION_DISCONNECT); @@ -2042,6 +2102,18 @@ public abstract class ConnectionService extends Service { findConnectionForAction(callId, "reject").onReject(rejectReason); } + private void transfer(String callId, Uri number, boolean isConfirmationRequired) { + Log.d(this, "transfer %s", callId); + findConnectionForAction(callId, "transfer").onTransfer(number, isConfirmationRequired); + } + + private void consultativeTransfer(String callId, String otherCallId) { + Log.d(this, "consultativeTransfer %s", callId); + Connection connection1 = findConnectionForAction(callId, "consultativeTransfer"); + Connection connection2 = findConnectionForAction(otherCallId, " consultativeTransfer"); + connection1.onTransfer(connection2); + } + private void silence(String callId) { Log.d(this, "silence %s", callId); findConnectionForAction(callId, "silence").onSilence(); |