diff --git a/src/com/android/phone/CallLogger.java b/src/com/android/phone/CallLogger.java
index 644812f..9e76db4 100644
--- a/src/com/android/phone/CallLogger.java
+++ b/src/com/android/phone/CallLogger.java
@@ -26,6 +26,7 @@
 import android.net.Uri;
 import android.os.SystemProperties;
 import android.provider.CallLog.Calls;
+import android.telephony.DisconnectCause;
 import android.telephony.PhoneNumberUtils;
 import android.text.TextUtils;
 import android.util.Log;
@@ -87,13 +88,13 @@
      * Came as logCall(Connection,int) but calculates the call type from the connection object.
      */
     public void logCall(Connection c) {
-        final Connection.DisconnectCause cause = c.getDisconnectCause();
+        final int cause = c.getDisconnectCause();
 
         // Set the "type" to be displayed in the call log (see constants in CallLog.Calls)
         final int callLogType;
 
         if (c.isIncoming()) {
-            callLogType = (cause == Connection.DisconnectCause.INCOMING_MISSED ?
+            callLogType = (cause == DisconnectCause.INCOMING_MISSED ?
                            Calls.MISSED_TYPE : Calls.INCOMING_TYPE);
         } else {
             callLogType = Calls.OUTGOING_TYPE;
diff --git a/src/com/android/phone/CallModeler.java b/src/com/android/phone/CallModeler.java
index e4ed147..72eaed0 100644
--- a/src/com/android/phone/CallModeler.java
+++ b/src/com/android/phone/CallModeler.java
@@ -20,6 +20,7 @@
 import android.os.Handler;
 import android.os.Message;
 import android.os.SystemProperties;
+import android.telephony.DisconnectCause;
 import android.telephony.PhoneNumberUtils;
 import android.text.TextUtils;
 import android.util.Log;
@@ -38,7 +39,6 @@
 import com.google.android.collect.Maps;
 import com.google.android.collect.Sets;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSortedSet;
 import com.google.common.collect.Lists;
 
@@ -555,8 +555,7 @@
             changed = true;
         }
 
-        final Call.DisconnectCause newDisconnectCause =
-                translateDisconnectCauseFromTelephony(connection.getDisconnectCause());
+        final int newDisconnectCause = connection.getDisconnectCause();
         if (call.getDisconnectCause() != newDisconnectCause) {
             call.setDisconnectCause(newDisconnectCause);
             changed = true;
@@ -789,73 +788,6 @@
         return retval;
     }
 
-    private final ImmutableMap<Connection.DisconnectCause, Call.DisconnectCause> CAUSE_MAP =
-            ImmutableMap.<Connection.DisconnectCause, Call.DisconnectCause>builder()
-                .put(Connection.DisconnectCause.BUSY, Call.DisconnectCause.BUSY)
-                .put(Connection.DisconnectCause.CALL_BARRED, Call.DisconnectCause.CALL_BARRED)
-                .put(Connection.DisconnectCause.CDMA_ACCESS_BLOCKED,
-                        Call.DisconnectCause.CDMA_ACCESS_BLOCKED)
-                .put(Connection.DisconnectCause.CDMA_ACCESS_FAILURE,
-                        Call.DisconnectCause.CDMA_ACCESS_FAILURE)
-                .put(Connection.DisconnectCause.CDMA_DROP, Call.DisconnectCause.CDMA_DROP)
-                .put(Connection.DisconnectCause.CDMA_INTERCEPT, Call.DisconnectCause.CDMA_INTERCEPT)
-                .put(Connection.DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE,
-                        Call.DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE)
-                .put(Connection.DisconnectCause.CDMA_NOT_EMERGENCY,
-                        Call.DisconnectCause.CDMA_NOT_EMERGENCY)
-                .put(Connection.DisconnectCause.CDMA_PREEMPTED, Call.DisconnectCause.CDMA_PREEMPTED)
-                .put(Connection.DisconnectCause.CDMA_REORDER, Call.DisconnectCause.CDMA_REORDER)
-                .put(Connection.DisconnectCause.CDMA_RETRY_ORDER,
-                        Call.DisconnectCause.CDMA_RETRY_ORDER)
-                .put(Connection.DisconnectCause.CDMA_SO_REJECT, Call.DisconnectCause.CDMA_SO_REJECT)
-                .put(Connection.DisconnectCause.CONGESTION, Call.DisconnectCause.CONGESTION)
-                .put(Connection.DisconnectCause.CS_RESTRICTED, Call.DisconnectCause.CS_RESTRICTED)
-                .put(Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY,
-                        Call.DisconnectCause.CS_RESTRICTED_EMERGENCY)
-                .put(Connection.DisconnectCause.CS_RESTRICTED_NORMAL,
-                        Call.DisconnectCause.CS_RESTRICTED_NORMAL)
-                .put(Connection.DisconnectCause.ERROR_UNSPECIFIED,
-                        Call.DisconnectCause.ERROR_UNSPECIFIED)
-                .put(Connection.DisconnectCause.FDN_BLOCKED, Call.DisconnectCause.FDN_BLOCKED)
-                .put(Connection.DisconnectCause.ICC_ERROR, Call.DisconnectCause.ICC_ERROR)
-                .put(Connection.DisconnectCause.INCOMING_MISSED,
-                        Call.DisconnectCause.INCOMING_MISSED)
-                .put(Connection.DisconnectCause.INCOMING_REJECTED,
-                        Call.DisconnectCause.INCOMING_REJECTED)
-                .put(Connection.DisconnectCause.INVALID_CREDENTIALS,
-                        Call.DisconnectCause.INVALID_CREDENTIALS)
-                .put(Connection.DisconnectCause.INVALID_NUMBER,
-                        Call.DisconnectCause.INVALID_NUMBER)
-                .put(Connection.DisconnectCause.LIMIT_EXCEEDED, Call.DisconnectCause.LIMIT_EXCEEDED)
-                .put(Connection.DisconnectCause.LOCAL, Call.DisconnectCause.LOCAL)
-                .put(Connection.DisconnectCause.LOST_SIGNAL, Call.DisconnectCause.LOST_SIGNAL)
-                .put(Connection.DisconnectCause.MMI, Call.DisconnectCause.MMI)
-                .put(Connection.DisconnectCause.NORMAL, Call.DisconnectCause.NORMAL)
-                .put(Connection.DisconnectCause.NOT_DISCONNECTED,
-                        Call.DisconnectCause.NOT_DISCONNECTED)
-                .put(Connection.DisconnectCause.NUMBER_UNREACHABLE,
-                        Call.DisconnectCause.NUMBER_UNREACHABLE)
-                .put(Connection.DisconnectCause.OUT_OF_NETWORK, Call.DisconnectCause.OUT_OF_NETWORK)
-                .put(Connection.DisconnectCause.OUT_OF_SERVICE, Call.DisconnectCause.OUT_OF_SERVICE)
-                .put(Connection.DisconnectCause.POWER_OFF, Call.DisconnectCause.POWER_OFF)
-                .put(Connection.DisconnectCause.SERVER_ERROR, Call.DisconnectCause.SERVER_ERROR)
-                .put(Connection.DisconnectCause.SERVER_UNREACHABLE,
-                        Call.DisconnectCause.SERVER_UNREACHABLE)
-                .put(Connection.DisconnectCause.TIMED_OUT, Call.DisconnectCause.TIMED_OUT)
-                .put(Connection.DisconnectCause.UNOBTAINABLE_NUMBER,
-                        Call.DisconnectCause.UNOBTAINABLE_NUMBER)
-                .build();
-
-    private Call.DisconnectCause translateDisconnectCauseFromTelephony(
-            Connection.DisconnectCause causeSource) {
-
-        if (CAUSE_MAP.containsKey(causeSource)) {
-            return CAUSE_MAP.get(causeSource);
-        }
-
-        return Call.DisconnectCause.UNKNOWN;
-    }
-
     /**
      * Gets an existing callId for a connection, or creates one if none exists.
      * This function does NOT set any of the Connection data onto the Call class.
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index 80807a2..aa4270e 100644
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -46,6 +46,7 @@
 import android.os.Vibrator;
 import android.provider.CallLog.Calls;
 import android.provider.Settings;
+import android.telephony.DisconnectCause;
 import android.telephony.PhoneNumberUtils;
 import android.telephony.PhoneStateListener;
 import android.telephony.TelephonyManager;
@@ -899,7 +900,7 @@
         mVoicePrivacyState = false;
         Connection c = (Connection) r.result;
         if (c != null) {
-            log("onDisconnect: cause = " + c.getDisconnectCause()
+            log("onDisconnect: cause = " + DisconnectCause.toString(c.getDisconnectCause())
                   + ", incoming = " + c.isIncoming()
                   + ", date = " + c.getCreateTime());
         } else {
@@ -974,34 +975,34 @@
 
         // The "Busy" or "Congestion" tone is the highest priority:
         if (c != null) {
-            Connection.DisconnectCause cause = c.getDisconnectCause();
-            if (cause == Connection.DisconnectCause.BUSY) {
+            int cause = c.getDisconnectCause();
+            if (cause == DisconnectCause.BUSY) {
                 if (DBG) log("- need to play BUSY tone!");
                 toneToPlay = InCallTonePlayer.TONE_BUSY;
-            } else if (cause == Connection.DisconnectCause.CONGESTION) {
+            } else if (cause == DisconnectCause.CONGESTION) {
                 if (DBG) log("- need to play CONGESTION tone!");
                 toneToPlay = InCallTonePlayer.TONE_CONGESTION;
-            } else if (((cause == Connection.DisconnectCause.NORMAL)
-                    || (cause == Connection.DisconnectCause.LOCAL))
+            } else if (((cause == DisconnectCause.NORMAL)
+                    || (cause == DisconnectCause.LOCAL))
                     && (mApplication.isOtaCallInActiveState())) {
                 if (DBG) log("- need to play OTA_CALL_END tone!");
                 toneToPlay = InCallTonePlayer.TONE_OTA_CALL_END;
-            } else if (cause == Connection.DisconnectCause.CDMA_REORDER) {
+            } else if (cause == DisconnectCause.CDMA_REORDER) {
                 if (DBG) log("- need to play CDMA_REORDER tone!");
                 toneToPlay = InCallTonePlayer.TONE_REORDER;
-            } else if (cause == Connection.DisconnectCause.CDMA_INTERCEPT) {
+            } else if (cause == DisconnectCause.CDMA_INTERCEPT) {
                 if (DBG) log("- need to play CDMA_INTERCEPT tone!");
                 toneToPlay = InCallTonePlayer.TONE_INTERCEPT;
-            } else if (cause == Connection.DisconnectCause.CDMA_DROP) {
+            } else if (cause == DisconnectCause.CDMA_DROP) {
                 if (DBG) log("- need to play CDMA_DROP tone!");
                 toneToPlay = InCallTonePlayer.TONE_CDMA_DROP;
-            } else if (cause == Connection.DisconnectCause.OUT_OF_SERVICE) {
+            } else if (cause == DisconnectCause.OUT_OF_SERVICE) {
                 if (DBG) log("- need to play OUT OF SERVICE tone!");
                 toneToPlay = InCallTonePlayer.TONE_OUT_OF_SERVICE;
-            } else if (cause == Connection.DisconnectCause.UNOBTAINABLE_NUMBER) {
+            } else if (cause == DisconnectCause.UNOBTAINABLE_NUMBER) {
                 if (DBG) log("- need to play TONE_UNOBTAINABLE_NUMBER tone!");
                 toneToPlay = InCallTonePlayer.TONE_UNOBTAINABLE_NUMBER;
-            } else if (cause == Connection.DisconnectCause.ERROR_UNSPECIFIED) {
+            } else if (cause == DisconnectCause.ERROR_UNSPECIFIED) {
                 if (DBG) log("- DisconnectCause is ERROR_UNSPECIFIED: play TONE_CALL_ENDED!");
                 toneToPlay = InCallTonePlayer.TONE_CALL_ENDED;
             }
@@ -1017,9 +1018,9 @@
         if ((toneToPlay == InCallTonePlayer.TONE_NONE)
             && (mCM.getState() == PhoneConstants.State.IDLE)
             && (c != null)) {
-            Connection.DisconnectCause cause = c.getDisconnectCause();
-            if ((cause == Connection.DisconnectCause.NORMAL)  // remote hangup
-                || (cause == Connection.DisconnectCause.LOCAL)) {  // local hangup
+            int cause = c.getDisconnectCause();
+            if ((cause == DisconnectCause.NORMAL)  // remote hangup
+                || (cause == DisconnectCause.LOCAL)) {  // local hangup
                 if (VDBG) log("- need to play CALL_ENDED tone!");
                 toneToPlay = InCallTonePlayer.TONE_CALL_ENDED;
                 mIsCdmaRedialCall = false;
@@ -1055,9 +1056,9 @@
             }
 
             final long date = c.getCreateTime();
-            final Connection.DisconnectCause cause = c.getDisconnectCause();
+            final int cause = c.getDisconnectCause();
             final boolean missedCall = c.isIncoming() &&
-                    (cause == Connection.DisconnectCause.INCOMING_MISSED);
+                    (cause == DisconnectCause.INCOMING_MISSED);
             if (missedCall) {
                 // Show the "Missed call" notification.
                 // (Note we *don't* do this if this was an incoming call that
@@ -1086,10 +1087,10 @@
             if (((mPreviousCdmaCallState == Call.State.DIALING)
                     || (mPreviousCdmaCallState == Call.State.ALERTING))
                     && (!isEmergencyNumber)
-                    && (cause != Connection.DisconnectCause.INCOMING_MISSED )
-                    && (cause != Connection.DisconnectCause.NORMAL)
-                    && (cause != Connection.DisconnectCause.LOCAL)
-                    && (cause != Connection.DisconnectCause.INCOMING_REJECTED)) {
+                    && (cause != DisconnectCause.INCOMING_MISSED )
+                    && (cause != DisconnectCause.NORMAL)
+                    && (cause != DisconnectCause.LOCAL)
+                    && (cause != DisconnectCause.INCOMING_REJECTED)) {
                 if (!mIsCdmaRedialCall) {
                     if (autoretrySetting == InCallScreen.AUTO_RETRY_ON) {
                         // TODO: (Moto): The contact reference data may need to be stored and use
diff --git a/src/com/android/phone/EmergencyCallHelper.java b/src/com/android/phone/EmergencyCallHelper.java
index 47f0e54..74ce088 100644
--- a/src/com/android/phone/EmergencyCallHelper.java
+++ b/src/com/android/phone/EmergencyCallHelper.java
@@ -29,6 +29,7 @@
 import android.os.PowerManager;
 import android.os.UserHandle;
 import android.provider.Settings;
+import android.telephony.DisconnectCause;
 import android.telephony.ServiceState;
 import android.util.Log;
 
@@ -234,11 +235,12 @@
      */
     private void onDisconnect(Message msg) {
         Connection conn = (Connection) ((AsyncResult) msg.obj).result;
-        Connection.DisconnectCause cause = conn.getDisconnectCause();
+        int cause = conn.getDisconnectCause();
         if (DBG) log("onDisconnect: connection '" + conn
-                     + "', addr '" + conn.getAddress() + "', cause = " + cause);
+                     + "', addr '" + conn.getAddress()
+                     + "', cause = " + DisconnectCause.toString(cause));
 
-        if (cause == Connection.DisconnectCause.OUT_OF_SERVICE) {
+        if (cause == DisconnectCause.OUT_OF_SERVICE) {
             // Wait a bit more and try again (or just bail out totally if
             // we've had too many failures.)
             if (DBG) log("- onDisconnect: OUT_OF_SERVICE, need to retry...");
