From d63044513325af5a80602b952b7fba09be5b5af9 Mon Sep 17 00:00:00 2001 From: Hall Liu Date: Wed, 26 Sep 2018 18:10:14 -0700 Subject: Wire up the stopRtt API Connect the implementation of the onStopRtt API in Connection to the one in the IMS stack. Bug: 116671810 Test: manual Change-Id: Ibfa2d65ad543dfd2883096bfa6ff8b34f617a19d --- src/java/com/android/ims/ImsCall.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/java/com/android/ims/ImsCall.java b/src/java/com/android/ims/ImsCall.java index 04781e33..667cb3d4 100644 --- a/src/java/com/android/ims/ImsCall.java +++ b/src/java/com/android/ims/ImsCall.java @@ -1648,16 +1648,20 @@ public class ImsCall implements ICall { /** * Sends a user-requested RTT upgrade request. + * @param rttOn true if the request is to turn on RTT, false to turn off. */ - public void sendRttModifyRequest() { + public void sendRttModifyRequest(boolean rttOn) { logi("sendRttModifyRequest"); synchronized(mLockObj) { if (mSession == null) { loge("sendRttModifyRequest::no session"); } - if (mCallProfile.mMediaProfile.isRttCall()) { - logi("sendRttModifyRequest::Already RTT call, ignoring."); + if (rttOn && mCallProfile.mMediaProfile.isRttCall()) { + logi("sendRttModifyRequest::Already RTT call, ignoring request to turn on."); + return; + } else if (!rttOn && !mCallProfile.mMediaProfile.isRttCall()) { + logi("sendRttModifyRequest::Not RTT call, ignoring request to turn off."); return; } // Make a copy of the current ImsCallProfile and modify it to enable RTT @@ -1665,7 +1669,9 @@ public class ImsCall implements ICall { mCallProfile.writeToParcel(p, 0); p.setDataPosition(0); ImsCallProfile requestedProfile = new ImsCallProfile(p); - requestedProfile.mMediaProfile.setRttMode(ImsStreamMediaProfile.RTT_MODE_FULL); + requestedProfile.mMediaProfile.setRttMode(rttOn + ? ImsStreamMediaProfile.RTT_MODE_FULL + : ImsStreamMediaProfile.RTT_MODE_DISABLED); mSession.sendRttModifyRequest(requestedProfile); } -- cgit v1.2.3