Merge "Postpone error until no more retries are available" into nyc-mr1-dev
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 71f52f4..6cb6488 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -371,6 +371,28 @@
         public void onExitedEcmMode() {
             handleExitedEcmMode();
         }
+
+        /**
+         * Called from {@link ImsPhoneCallTracker} when a request to pull an external call has
+         * failed.
+         * @param externalConnection
+         */
+        @Override
+        public void onCallPullFailed(com.android.internal.telephony.Connection externalConnection) {
+            if (externalConnection == null) {
+                return;
+            }
+
+            Log.i(this, "onCallPullFailed - pull failed; swapping back to call: %s",
+                    externalConnection);
+
+            // Swap the ImsPhoneConnection we used to do the pull for the ImsExternalConnection
+            // which originally represented the call.
+            setOriginalConnection(externalConnection);
+
+            // Set our state to active again since we're no longer pulling.
+            setActiveInternal();
+        }
     };
 
     protected com.android.internal.telephony.Connection mOriginalConnection;