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: Id0d523fb4bfc0f1e4c1cfff564fa8ceedffe9c6e
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 3192c75..8f46ecf 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -892,7 +892,7 @@
             if (originalConnection.isRttEnabledForCall()) {
                 originalConnection.setCurrentRttTextStream(textStream);
             } else {
-                originalConnection.sendRttModifyRequest(textStream);
+                originalConnection.startRtt(textStream);
             }
         } else {
             Log.w(this, "onStartRtt - not in IMS, so RTT cannot be enabled.");
@@ -901,7 +901,16 @@
 
     @Override
     public void onStopRtt() {
-        Log.i(this, "Stopping RTT currently not supported. Doing nothing.");
+        if (isImsConnection()) {
+            ImsPhoneConnection originalConnection = (ImsPhoneConnection) mOriginalConnection;
+            if (originalConnection.isRttEnabledForCall()) {
+                originalConnection.stopRtt();
+            } else {
+                Log.w(this, "onStopRtt - not in RTT call, ignoring");
+            }
+        } else {
+            Log.w(this, "onStopRtt - not in IMS, ignoring");
+        }
     }
 
     @Override