Modified PhoneUtils.java to move call to setGatewayInfoForConnection inside a code block that appropriately checks for null, as required.
b/12210645

Change-Id: I3108872c7e5081a9e5c9e4b202577218871488a9
(cherry picked from commit 10f1c6a97074b981b08bb804a3568c17ec3890a5)
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 2d44977..02df7fd 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -720,11 +720,6 @@
             // we dialed an MMI (see below).
         }
 
-        // Now that the call is successful, we can save the gateway info for the call
-        if (callGateway != null) {
-            callGateway.setGatewayInfoForConnection(connection, gatewayInfo);
-        }
-
         int phoneType = phone.getPhoneType();
 
         // On GSM phones, null is returned for MMI codes
@@ -736,6 +731,11 @@
                 status = CALL_STATUS_FAILED;
             }
         } else {
+            // Now that the call is successful, we can save the gateway info for the call
+            if (callGateway != null) {
+                callGateway.setGatewayInfoForConnection(connection, gatewayInfo);
+            }
+
             if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
                 updateCdmaCallStateOnNewOutgoingCall(app, connection);
             }