aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHall Liu <hallliu@google.com>2018-10-05 18:08:36 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-10-05 18:08:36 -0700
commite14571848a57d504b5c029a2475ab5114673250b (patch)
tree620dc91f8ec4118611018187c971a63c102be20d
parentf811db84837b9f48cd8b7fa1a14c5b6314a45f5b (diff)
parentf23cfaba399b6471d1da378ea0e9d00404c9445a (diff)
downloadims-e14571848a57d504b5c029a2475ab5114673250b.tar.gz
Merge "Wire up the stopRtt API"pie-temp
am: f23cfaba39 Change-Id: I6f7496d4865878e8f5fa2c90e671066c556b475e
-rw-r--r--src/java/com/android/ims/ImsCall.java14
1 files 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);
}