Merge "Import translations. DO NOT MERGE" into lmp-mr1-dev
diff --git a/sip/src/com/android/services/telephony/sip/SipConnection.java b/sip/src/com/android/services/telephony/sip/SipConnection.java
index a858035..5df61b7 100644
--- a/sip/src/com/android/services/telephony/sip/SipConnection.java
+++ b/sip/src/com/android/services/telephony/sip/SipConnection.java
@@ -21,9 +21,7 @@
 import android.os.Message;
 import android.telecom.AudioState;
 import android.telecom.Connection;
-import android.telecom.DisconnectCause;
 import android.telecom.PhoneAccount;
-import android.telecom.PhoneCapabilities;
 import android.util.Log;
 
 import com.android.internal.telephony.Call;
@@ -246,17 +244,17 @@
     }
 
     private int buildCallCapabilities() {
-        int capabilities = PhoneCapabilities.MUTE | PhoneCapabilities.SUPPORT_HOLD;
+        int capabilities = CAPABILITY_MUTE | CAPABILITY_SUPPORT_HOLD;
         if (getState() == STATE_ACTIVE || getState() == STATE_HOLDING) {
-            capabilities |= PhoneCapabilities.HOLD;
+            capabilities |= CAPABILITY_HOLD;
         }
         return capabilities;
     }
 
     void updateCallCapabilities(boolean force) {
         int newCallCapabilities = buildCallCapabilities();
-        if (force || getCallCapabilities() != newCallCapabilities) {
-            setCallCapabilities(newCallCapabilities);
+        if (force || getConnectionCapabilities() != newCallCapabilities) {
+            setConnectionCapabilities(newCallCapabilities);
         }
     }
 
diff --git a/src/com/android/services/telephony/CdmaConference.java b/src/com/android/services/telephony/CdmaConference.java
index a0d6dd2..fdd2110 100755
--- a/src/com/android/services/telephony/CdmaConference.java
+++ b/src/com/android/services/telephony/CdmaConference.java
@@ -21,7 +21,6 @@
 import android.telecom.Conference;
 import android.telecom.Connection;
 import android.telecom.PhoneAccountHandle;
-import android.telecom.PhoneCapabilities;
 
 import com.android.internal.telephony.Call;
 import com.android.internal.telephony.CallStateException;
@@ -42,7 +41,7 @@
     }
 
     public void updateCapabilities(int capabilities) {
-        capabilities |=  PhoneCapabilities.MUTE | PhoneCapabilities.GENERIC_CONFERENCE;
+        capabilities |= Connection.CAPABILITY_MUTE | Connection.CAPABILITY_GENERIC_CONFERENCE;
         setCapabilities(capabilities);
     }
 
@@ -84,10 +83,10 @@
     public void onMerge() {
         Log.i(this, "Merging CDMA conference call.");
         // Can only merge once
-        mCapabilities &= ~PhoneCapabilities.MERGE_CONFERENCE;
+        mCapabilities &= ~Connection.CAPABILITY_MERGE_CONFERENCE;
         // Once merged, swap is enabled.
         if (isSwapSupportedAfterMerge()){
-            mCapabilities |= PhoneCapabilities.SWAP_CONFERENCE;
+            mCapabilities |= Connection.CAPABILITY_SWAP_CONFERENCE;
         }
         updateCapabilities(mCapabilities);
         sendFlash();
diff --git a/src/com/android/services/telephony/CdmaConferenceController.java b/src/com/android/services/telephony/CdmaConferenceController.java
index f7b9793..3d90fd3 100644
--- a/src/com/android/services/telephony/CdmaConferenceController.java
+++ b/src/com/android/services/telephony/CdmaConferenceController.java
@@ -19,7 +19,6 @@
 import android.os.Handler;
 import android.telecom.Connection;
 import android.telecom.DisconnectCause;
-import android.telecom.PhoneCapabilities;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -156,11 +155,11 @@
             CdmaConnection newConnection = mCdmaConnections.get(mCdmaConnections.size() - 1);
             if (newConnection.isOutgoing()) {
                 // Only an outgoing call can be merged with an ongoing call.
-                mConference.updateCapabilities(PhoneCapabilities.MERGE_CONFERENCE);
+                mConference.updateCapabilities(Connection.CAPABILITY_MERGE_CONFERENCE);
             } else {
                 // If the most recently added connection was an incoming call, enable
                 // swap instead of merge.
-                mConference.updateCapabilities(PhoneCapabilities.SWAP_CONFERENCE);
+                mConference.updateCapabilities(Connection.CAPABILITY_SWAP_CONFERENCE);
             }
 
             // 2) Add any new connections to the conference
diff --git a/src/com/android/services/telephony/CdmaConnection.java b/src/com/android/services/telephony/CdmaConnection.java
index c52a824..0baa3cc 100644
--- a/src/com/android/services/telephony/CdmaConnection.java
+++ b/src/com/android/services/telephony/CdmaConnection.java
@@ -20,7 +20,6 @@
 import android.os.Message;
 
 import android.provider.Settings;
-import android.telecom.PhoneCapabilities;
 import android.telephony.DisconnectCause;
 import android.telephony.PhoneNumberUtils;
 
@@ -136,6 +135,20 @@
         super.onAnswer();
     }
 
+    /**
+     * Clones the current {@link CdmaConnection}.
+     * <p>
+     * Listeners are not copied to the new instance.
+     *
+     * @return The cloned connection.
+     */
+    @Override
+    public TelephonyConnection cloneConnection() {
+        CdmaConnection cdmaConnection = new CdmaConnection(getOriginalConnection(),
+                mEmergencyTonePlayer, mAllowMute, mIsOutgoing);
+        return cdmaConnection;
+    }
+
     @Override
     public void onStateChanged(int state) {
         Connection originalConnection = getOriginalConnection();
@@ -155,10 +168,10 @@
     }
 
     @Override
-    protected int buildCallCapabilities() {
-        int capabilities = super.buildCallCapabilities();
+    protected int buildConnectionCapabilities() {
+        int capabilities = super.buildConnectionCapabilities();
         if (mAllowMute) {
-            capabilities |= PhoneCapabilities.MUTE;
+            capabilities |= CAPABILITY_MUTE;
         }
         return capabilities;
     }
diff --git a/src/com/android/services/telephony/ConferenceParticipantConnection.java b/src/com/android/services/telephony/ConferenceParticipantConnection.java
index 49307ba..eae3696 100644
--- a/src/com/android/services/telephony/ConferenceParticipantConnection.java
+++ b/src/com/android/services/telephony/ConferenceParticipantConnection.java
@@ -22,7 +22,6 @@
 import android.telecom.Connection;
 import android.telecom.ConferenceParticipant;
 import android.telecom.DisconnectCause;
-import android.telecom.PhoneCapabilities;
 
 /**
  * Represents a participant in a conference call.
@@ -116,13 +115,13 @@
     }
 
     /**
-     * Configures the {@link android.telecom.PhoneCapabilities} applicable to this connection.  A
+     * Configures the capabilities applicable to this connection.  A
      * conference participant can only be disconnected from a conference since there is not
      * actual connection to the participant which could be split from the conference.
      */
     private void setCapabilities() {
-        int capabilities = PhoneCapabilities.DISCONNECT_FROM_CONFERENCE;
-        setCallCapabilities(capabilities);
+        int capabilities = CAPABILITY_DISCONNECT_FROM_CONFERENCE;
+        setConnectionCapabilities(capabilities);
     }
 
     /**
diff --git a/src/com/android/services/telephony/GsmConnection.java b/src/com/android/services/telephony/GsmConnection.java
index d2e68c6..1273c60 100644
--- a/src/com/android/services/telephony/GsmConnection.java
+++ b/src/com/android/services/telephony/GsmConnection.java
@@ -16,9 +16,6 @@
 
 package com.android.services.telephony;
 
-import android.telecom.PhoneCapabilities;
-
-import com.android.internal.telephony.CallStateException;
 import com.android.internal.telephony.Connection;
 
 /**
@@ -29,6 +26,19 @@
         super(connection);
     }
 
+    /**
+     * Clones the current {@link GsmConnection}.
+     * <p>
+     * Listeners are not copied to the new instance.
+     *
+     * @return The cloned connection.
+     */
+    @Override
+    public TelephonyConnection cloneConnection() {
+        GsmConnection gsmConnection = new GsmConnection(getOriginalConnection());
+        return gsmConnection;
+    }
+
     /** {@inheritDoc} */
     @Override
     public void onPlayDtmfTone(char digit) {
@@ -46,12 +56,12 @@
     }
 
     @Override
-    protected int buildCallCapabilities() {
-        int capabilities = super.buildCallCapabilities();
-        capabilities |= PhoneCapabilities.MUTE;
-        capabilities |= PhoneCapabilities.SUPPORT_HOLD;
+    protected int buildConnectionCapabilities() {
+        int capabilities = super.buildConnectionCapabilities();
+        capabilities |= CAPABILITY_MUTE;
+        capabilities |= CAPABILITY_SUPPORT_HOLD;
         if (getState() == STATE_ACTIVE || getState() == STATE_HOLDING) {
-            capabilities |= PhoneCapabilities.HOLD;
+            capabilities |= CAPABILITY_HOLD;
         }
         return capabilities;
     }
diff --git a/src/com/android/services/telephony/ImsConference.java b/src/com/android/services/telephony/ImsConference.java
index 5fc3e41..2870481 100644
--- a/src/com/android/services/telephony/ImsConference.java
+++ b/src/com/android/services/telephony/ImsConference.java
@@ -27,10 +27,8 @@
 import android.telecom.ConferenceParticipant;
 import android.telecom.DisconnectCause;
 import android.telecom.PhoneAccountHandle;
-import android.telecom.PhoneCapabilities;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -55,16 +53,6 @@
 public class ImsConference extends Conference {
 
     /**
-     * TelephonyConnection class used to represent the connection to the conference server.
-     */
-    private class ConferenceHostConnection extends TelephonyConnection {
-        protected ConferenceHostConnection(
-                com.android.internal.telephony.Connection originalConnection) {
-            super(originalConnection);
-        }
-    }
-
-    /**
      * Listener used to respond to changes to conference participants.  At the conference level we
      * are most concerned with handling destruction of a conference participant.
      */
@@ -182,18 +170,18 @@
      *
      * @param telephonyConnectionService The connection service responsible for adding new
      *                                   conferene participants.
-     * @param conferenceHost The IMS radio connection hosting the conference.
+     * @param conferenceHost The telephony connection hosting the conference.
      */
     public ImsConference(TelephonyConnectionService telephonyConnectionService,
-            com.android.internal.telephony.Connection conferenceHost) {
+            TelephonyConnection conferenceHost) {
 
         super(null);
         mTelephonyConnectionService = telephonyConnectionService;
         setConferenceHost(conferenceHost);
-        setCapabilities(
-                PhoneCapabilities.SUPPORT_HOLD |
-                        PhoneCapabilities.HOLD |
-                        PhoneCapabilities.MUTE
+        setConnectionCapabilities(
+                Connection.CAPABILITY_SUPPORT_HOLD |
+                Connection.CAPABILITY_HOLD |
+                Connection.CAPABILITY_MUTE
         );
     }
 
@@ -326,22 +314,19 @@
      * are no conference event package participants, conference management is not permitted.
      */
     private void updateManageConference() {
-        boolean couldManageConference = PhoneCapabilities.can(getCapabilities(),
-                PhoneCapabilities.MANAGE_CONFERENCE);
+        boolean couldManageConference = can(Connection.CAPABILITY_MANAGE_CONFERENCE);
         boolean canManageConference = !mConferenceParticipantConnections.isEmpty();
         Log.v(this, "updateManageConference was:%s is:%s", couldManageConference ? "Y" : "N",
                 canManageConference ? "Y" : "N");
 
         if (couldManageConference != canManageConference) {
-            int newCapabilities = getCapabilities();
+            int newCapabilities = getConnectionCapabilities();
 
             if (canManageConference) {
-                newCapabilities |= PhoneCapabilities.MANAGE_CONFERENCE;
+                addCapability(Connection.CAPABILITY_MANAGE_CONFERENCE);
             } else {
-                newCapabilities = PhoneCapabilities.remove(newCapabilities,
-                        PhoneCapabilities.MANAGE_CONFERENCE);
+                removeCapability(Connection.CAPABILITY_MANAGE_CONFERENCE);
             }
-            setCapabilities(newCapabilities);
         }
     }
 
@@ -350,12 +335,12 @@
      *
      * @param conferenceHost The connection hosting the conference.
      */
-    private void setConferenceHost(com.android.internal.telephony.Connection conferenceHost) {
+    private void setConferenceHost(TelephonyConnection conferenceHost) {
         if (Log.VERBOSE) {
             Log.v(this, "setConferenceHost " + conferenceHost);
         }
 
-        mConferenceHost = new ConferenceHostConnection(conferenceHost);
+        mConferenceHost = conferenceHost;
         mConferenceHost.addConnectionListener(mConferenceHostListener);
         mConferenceHost.addTelephonyConnectionListener(mTelephonyConnectionListener);
     }
diff --git a/src/com/android/services/telephony/ImsConferenceController.java b/src/com/android/services/telephony/ImsConferenceController.java
index e924687..5df7ea0 100644
--- a/src/com/android/services/telephony/ImsConferenceController.java
+++ b/src/com/android/services/telephony/ImsConferenceController.java
@@ -251,14 +251,17 @@
      * @param connection The connection to the Ims server.
      */
     private void startConference(TelephonyConnection connection) {
-        com.android.internal.telephony.Connection originalConnection =
-                connection.getOriginalConnection();
         if (Log.VERBOSE) {
             Log.v(this, "Start new ImsConference - connection: %s", connection);
         }
 
+        // Make a clone of the connection which will become the Ims conference host connection.
+        // This is necessary since the Connection Service does not support removing a connection
+        // from Telecom.  Instead we create a new instance and remove the old one from telecom.
+        TelephonyConnection conferenceHostConnection = connection.cloneConnection();
+
         // Create conference and add to telecom
-        ImsConference conference = new ImsConference(mConnectionService, originalConnection);
+        ImsConference conference = new ImsConference(mConnectionService, conferenceHostConnection);
         conference.setState(connection.getState());
         mConnectionService.addConference(conference);
         conference.addListener(mConferenceListener);
diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java
index c105fff..b36037e 100644
--- a/src/com/android/services/telephony/TelecomAccountRegistry.java
+++ b/src/com/android/services/telephony/TelecomAccountRegistry.java
@@ -81,7 +81,7 @@
 
             // Populate the phone account data.
             int subId = mPhone.getSubId();
-            int color = PhoneAccount.NO_COLOR;
+            int color = PhoneAccount.NO_HIGHLIGHT_COLOR;
             int slotId = SubscriptionManager.INVALID_SIM_SLOT_INDEX;
             String line1Number = mTelephonyManager.getLine1NumberForSubscriber(subId);
             if (line1Number == null) {
diff --git a/src/com/android/services/telephony/TelephonyConference.java b/src/com/android/services/telephony/TelephonyConference.java
index 3a80097..e379f38 100644
--- a/src/com/android/services/telephony/TelephonyConference.java
+++ b/src/com/android/services/telephony/TelephonyConference.java
@@ -16,7 +16,6 @@
 
 package com.android.services.telephony;
 
-import android.telecom.PhoneCapabilities;
 import android.telecom.Conference;
 import android.telecom.Connection;
 import android.telecom.PhoneAccountHandle;
@@ -35,11 +34,11 @@
 
     public TelephonyConference(PhoneAccountHandle phoneAccount) {
         super(phoneAccount);
-        setCapabilities(
-                PhoneCapabilities.SUPPORT_HOLD |
-                PhoneCapabilities.HOLD |
-                PhoneCapabilities.MUTE |
-                PhoneCapabilities.MANAGE_CONFERENCE);
+        setConnectionCapabilities(
+                Connection.CAPABILITY_SUPPORT_HOLD |
+                Connection.CAPABILITY_HOLD |
+                Connection.CAPABILITY_MUTE |
+                Connection.CAPABILITY_MANAGE_CONFERENCE);
         setActive();
     }
 
@@ -148,12 +147,7 @@
         // If a conference event package was received, do not attempt to remove manage conference.
         if (connection instanceof TelephonyConnection &&
                 ((TelephonyConnection) connection).wasImsConnection()) {
-            int capabilities = getCapabilities();
-            if (PhoneCapabilities.can(capabilities, PhoneCapabilities.MANAGE_CONFERENCE)) {
-                int newCapabilities =
-                        PhoneCapabilities.remove(capabilities, PhoneCapabilities.MANAGE_CONFERENCE);
-                setCapabilities(newCapabilities);
-            }
+            removeCapability(Connection.CAPABILITY_MANAGE_CONFERENCE);
         }
     }
 
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 77a76d0..f551eca 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -21,20 +21,14 @@
 import android.os.Handler;
 import android.os.Message;
 import android.telecom.AudioState;
-import android.telecom.Conference;
 import android.telecom.ConferenceParticipant;
 import android.telecom.Connection;
-import android.telecom.DisconnectCause;
 import android.telecom.PhoneAccount;
-import android.telecom.PhoneCapabilities;
 
 import com.android.internal.telephony.Call;
 import com.android.internal.telephony.CallStateException;
 import com.android.internal.telephony.Connection.PostDialListener;
 import com.android.internal.telephony.Phone;
-import com.android.internal.telephony.cdma.CdmaCall;
-import com.android.internal.telephony.gsm.*;
-import com.android.internal.telephony.gsm.GsmConnection;
 import com.android.internal.telephony.imsphone.ImsPhoneConnection;
 
 import java.lang.Override;
@@ -178,28 +172,27 @@
 
     /**
      * Determines if the {@link TelephonyConnection} has local video capabilities.
-     * This is used when {@link TelephonyConnection#updateCallCapabilities()}} is called,
-     * ensuring the appropriate {@link PhoneCapabilities} are set.  Since {@link PhoneCapabilities}
+     * This is used when {@link TelephonyConnection#updateConnectionCapabilities()}} is called,
+     * ensuring the appropriate capabilities are set.  Since capabilities
      * can be rebuilt at any time it is necessary to track the video capabilities between rebuild.
-     * The {@link PhoneCapabilities} (including video capabilities) are communicated to the telecom
+     * The capabilities (including video capabilities) are communicated to the telecom
      * layer.
      */
     private boolean mLocalVideoCapable;
 
     /**
      * Determines if the {@link TelephonyConnection} has remote video capabilities.
-     * This is used when {@link TelephonyConnection#updateCallCapabilities()}} is called,
-     * ensuring the appropriate {@link PhoneCapabilities} are set.  Since {@link PhoneCapabilities}
-     * can be rebuilt at any time it is necessary to track the video capabilities between rebuild.
-     * The {@link PhoneCapabilities} (including video capabilities) are communicated to the telecom
-     * layer.
+     * This is used when {@link TelephonyConnection#updateConnectionCapabilities()}} is called,
+     * ensuring the appropriate capabilities are set.  Since capabilities can be rebuilt at any time
+     * it is necessary to track the video capabilities between rebuild. The capabilities (including
+     * video capabilities) are communicated to the telecom layer.
      */
     private boolean mRemoteVideoCapable;
 
     /**
      * Determines the current audio quality for the {@link TelephonyConnection}.
-     * This is used when {@link TelephonyConnection#updateCallCapabilities}} is called to indicate
-     * whether a call has the {@link android.telecom.CallCapabilities#VoLTE} capability.
+     * This is used when {@link TelephonyConnection#updateConnectionCapabilities}} is called to
+     * indicate whether a call has the {@link Connection#CAPABILITY_VoLTE} capability.
      */
     private int mAudioQuality;
 
@@ -215,6 +208,13 @@
         }
     }
 
+    /**
+     * Creates a clone of the current {@link TelephonyConnection}.
+     *
+     * @return The clone.
+     */
+    public abstract TelephonyConnection cloneConnection();
+
     @Override
     public void onAudioStateChanged(AudioState audioState) {
         // TODO: update TTY mode.
@@ -397,30 +397,30 @@
      * Builds call capabilities common to all TelephonyConnections. Namely, apply IMS-based
      * capabilities.
      */
-    protected int buildCallCapabilities() {
+    protected int buildConnectionCapabilities() {
         int callCapabilities = 0;
         if (isImsConnection()) {
-            callCapabilities |= PhoneCapabilities.SUPPORT_HOLD;
+            callCapabilities |= CAPABILITY_SUPPORT_HOLD;
             if (getState() == STATE_ACTIVE || getState() == STATE_HOLDING) {
-                callCapabilities |= PhoneCapabilities.HOLD;
+                callCapabilities |= CAPABILITY_HOLD;
             }
         }
         return callCapabilities;
     }
 
-    protected final void updateCallCapabilities() {
-        int newCallCapabilities = buildCallCapabilities();
-        newCallCapabilities = applyVideoCapabilities(newCallCapabilities);
-        newCallCapabilities = applyAudioQualityCapabilities(newCallCapabilities);
-        newCallCapabilities = applyConferenceTerminationCapabilities(newCallCapabilities);
+    protected final void updateConnectionCapabilities() {
+        int newCapabilities = buildConnectionCapabilities();
+        newCapabilities = applyVideoCapabilities(newCapabilities);
+        newCapabilities = applyAudioQualityCapabilities(newCapabilities);
+        newCapabilities = applyConferenceTerminationCapabilities(newCapabilities);
 
-        if (getCallCapabilities() != newCallCapabilities) {
-            setCallCapabilities(newCallCapabilities);
+        if (getConnectionCapabilities() != newCapabilities) {
+            setConnectionCapabilities(newCapabilities);
         }
     }
 
     protected final void updateAddress() {
-        updateCallCapabilities();
+        updateConnectionCapabilities();
         if (mOriginalConnection != null) {
             Uri address = getAddressFromNumber(mOriginalConnection.getAddress());
             int presentation = mOriginalConnection.getNumberPresentation();
@@ -616,7 +616,7 @@
                     break;
             }
         }
-        updateCallCapabilities();
+        updateConnectionCapabilities();
         updateAddress();
     }
 
@@ -666,18 +666,18 @@
         int currentCapabilities = capabilities;
         if (mRemoteVideoCapable) {
             currentCapabilities = applyCapability(currentCapabilities,
-                    PhoneCapabilities.SUPPORTS_VT_REMOTE);
+                    CAPABILITY_SUPPORTS_VT_REMOTE);
         } else {
             currentCapabilities = removeCapability(currentCapabilities,
-                    PhoneCapabilities.SUPPORTS_VT_REMOTE);
+                    CAPABILITY_SUPPORTS_VT_REMOTE);
         }
 
         if (mLocalVideoCapable) {
             currentCapabilities = applyCapability(currentCapabilities,
-                    PhoneCapabilities.SUPPORTS_VT_LOCAL);
+                    CAPABILITY_SUPPORTS_VT_LOCAL);
         } else {
             currentCapabilities = removeCapability(currentCapabilities,
-                    PhoneCapabilities.SUPPORTS_VT_LOCAL);
+                    CAPABILITY_SUPPORTS_VT_LOCAL);
         }
         return currentCapabilities;
     }
@@ -687,17 +687,17 @@
      * definition audio is considered to have the {@code VoLTE} call capability as VoLTE uses high
      * definition audio.
      *
-     * @param callCapabilities The {@code CallCapabilities} bit-mask.
+     * @param capabilities The {@code CallCapabilities} bit-mask.
      * @return The capabilities with the audio capabilities applied.
      */
-    private int applyAudioQualityCapabilities(int callCapabilities) {
-        int currentCapabilities = callCapabilities;
+    private int applyAudioQualityCapabilities(int capabilities) {
+        int currentCapabilities = capabilities;
 
         if (mAudioQuality ==
                 com.android.internal.telephony.Connection.AUDIO_QUALITY_HIGH_DEFINITION) {
-            currentCapabilities = applyCapability(currentCapabilities, PhoneCapabilities.VoLTE);
+            currentCapabilities = applyCapability(currentCapabilities, CAPABILITY_VoLTE);
         } else {
-            currentCapabilities = removeCapability(currentCapabilities, PhoneCapabilities.VoLTE);
+            currentCapabilities = removeCapability(currentCapabilities, CAPABILITY_VoLTE);
         }
 
         return currentCapabilities;
@@ -707,17 +707,17 @@
      * Applies capabilities specific to conferences termination to the
      * {@code CallCapabilities} bit-mask.
      *
-     * @param callCapabilities The {@code CallCapabilities} bit-mask.
+     * @param capabilities The {@code CallCapabilities} bit-mask.
      * @return The capabilities with the IMS conference capabilities applied.
      */
-    private int applyConferenceTerminationCapabilities(int callCapabilities) {
-        int currentCapabilities = callCapabilities;
+    private int applyConferenceTerminationCapabilities(int capabilities) {
+        int currentCapabilities = capabilities;
 
         // An IMS call cannot be individually disconnected or separated from its parent conference.
         // If the call was IMS, even if it hands over to GMS, these capabilities are not supported.
         if (!mWasImsConnection) {
-            currentCapabilities |= PhoneCapabilities.DISCONNECT_FROM_CONFERENCE;
-            currentCapabilities |= PhoneCapabilities.SEPARATE_FROM_CONFERENCE;
+            currentCapabilities |= CAPABILITY_DISCONNECT_FROM_CONFERENCE;
+            currentCapabilities |= CAPABILITY_SEPARATE_FROM_CONFERENCE;
         }
 
         return currentCapabilities;
@@ -743,35 +743,35 @@
 
     /**
      * Sets whether video capability is present locally.  Used during rebuild of the
-     * {@link PhoneCapabilities} to set the video call capabilities.
+     * capabilities to set the video call capabilities.
      *
      * @param capable {@code True} if video capable.
      */
     public void setLocalVideoCapable(boolean capable) {
         mLocalVideoCapable = capable;
-        updateCallCapabilities();
+        updateConnectionCapabilities();
     }
 
     /**
      * Sets whether video capability is present remotely.  Used during rebuild of the
-     * {@link PhoneCapabilities} to set the video call capabilities.
+     * capabilities to set the video call capabilities.
      *
      * @param capable {@code True} if video capable.
      */
     public void setRemoteVideoCapable(boolean capable) {
         mRemoteVideoCapable = capable;
-        updateCallCapabilities();
+        updateConnectionCapabilities();
     }
 
     /**
-     * Sets the current call audio quality.  Used during rebuild of the
-     * {@link PhoneCapabilities} to set or unset the {@link PhoneCapabilities#VoLTE} capability.
+     * Sets the current call audio quality.  Used during rebuild of the capabilities
+     * to set or unset the {@link Connection#CAPABILITY_VoLTE} capability.
      *
      * @param audioQuality The audio quality.
      */
     public void setAudioQuality(int audioQuality) {
         mAudioQuality = audioQuality;
-        updateCallCapabilities();
+        updateConnectionCapabilities();
     }
 
     /**
@@ -907,7 +907,7 @@
         sb.append(" state:");
         sb.append(Connection.stateToString(getState()));
         sb.append(" capabilities:");
-        sb.append(PhoneCapabilities.toString(getCallCapabilities()));
+        sb.append(capabilitiesToString(getConnectionCapabilities()));
         sb.append(" address:");
         sb.append(Log.pii(getAddress()));
         sb.append(" originalConnection:");