diff --git a/src/com/android/server/telecom/CallAudioManager.java b/src/com/android/server/telecom/CallAudioManager.java
index 9daf815..b555f85 100644
--- a/src/com/android/server/telecom/CallAudioManager.java
+++ b/src/com/android/server/telecom/CallAudioManager.java
@@ -44,6 +44,7 @@
     private boolean mIsTonePlaying;
     private boolean mWasSpeakerOn;
     private int mMostRecentlyUsedMode = AudioManager.MODE_IN_CALL;
+    private Call mCallToSpeedUpMTAudio = null;
 
     CallAudioManager(Context context, StatusBarNotifier statusBarNotifier,
             WiredHeadsetManager wiredHeadsetManager) {
@@ -106,6 +107,12 @@
         }
 
         setSystemAudioState(false /* isMute */, route, mAudioState.getSupportedRouteMask());
+
+        if (call.can(android.telecom.Call.Details.CAPABILITY_SPEED_UP_MT_AUDIO)) {
+            Log.v(this, "Speed up audio setup for IMS MT call.");
+            mCallToSpeedUpMTAudio = call;
+            updateAudioStreamAndMode();
+        }
     }
 
     @Override
@@ -282,6 +289,10 @@
         boolean wasNotVoiceCall = mAudioFocusStreamType != AudioManager.STREAM_VOICE_CALL;
         updateAudioStreamAndMode();
 
+        if (call != null && call.getState() == CallState.ACTIVE &&
+                            call == mCallToSpeedUpMTAudio) {
+            mCallToSpeedUpMTAudio = null;
+        }
         // If we transition from not voice call to voice call, we need to set an initial state.
         if (wasNotVoiceCall && mAudioFocusStreamType == AudioManager.STREAM_VOICE_CALL) {
             setInitialAudioState(call, true /* force */);
@@ -361,7 +372,11 @@
             Call foregroundCall = getForegroundCall();
             Call waitingForAccountSelectionCall =
                     CallsManager.getInstance().getFirstCallWithState(CallState.PRE_DIAL_WAIT);
-            if (foregroundCall != null && waitingForAccountSelectionCall == null) {
+            Call call = CallsManager.getInstance().getForegroundCall();
+            if (foregroundCall == null && call != null && call == mCallToSpeedUpMTAudio) {
+                requestAudioFocusAndSetMode(AudioManager.STREAM_VOICE_CALL,
+                                                         AudioManager.MODE_IN_CALL);
+            } else if (foregroundCall != null && waitingForAccountSelectionCall == null) {
                 // In the case where there is a call that is waiting for account selection,
                 // this will fall back to abandonAudioFocus() below, which temporarily exits
                 // the in-call audio mode. This is to allow TalkBack to speak the "Call with"
@@ -412,6 +427,7 @@
             Log.v(this, "abandoning audio focus");
             mAudioManager.abandonAudioFocusForCall();
             mAudioFocusStreamType = STREAM_NONE;
+            mCallToSpeedUpMTAudio = null;
         }
     }
 
