diff options
author | Tyler Gunn <tgunn@google.com> | 2014-10-29 21:32:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-29 21:32:53 +0000 |
commit | 167230987b3224c30f2ecefa90a83fc19d449cf9 (patch) | |
tree | 589396dc1d0ffeabf0086286ddadd799fc3cdb53 /telephony/java | |
parent | d86d7bce78a5f6e70bdac8f6d4bb1a968d440128 (diff) | |
parent | 3bffcf78b5e4bd8b60543126fc0bdb09808f28f5 (diff) | |
download | frameworks_base-167230987b3224c30f2ecefa90a83fc19d449cf9.zip frameworks_base-167230987b3224c30f2ecefa90a83fc19d449cf9.tar.gz frameworks_base-167230987b3224c30f2ecefa90a83fc19d449cf9.tar.bz2 |
Merge "Communicating participant changes to conference controller." into lmp-mr1-dev
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/com/android/ims/ImsConferenceState.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/telephony/java/com/android/ims/ImsConferenceState.java b/telephony/java/com/android/ims/ImsConferenceState.java index f708d5b..c57ef98 100644 --- a/telephony/java/com/android/ims/ImsConferenceState.java +++ b/telephony/java/com/android/ims/ImsConferenceState.java @@ -24,6 +24,8 @@ import java.util.Set; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; +import android.telecom.Call; +import android.telecom.Connection; /** * Provides the conference information (defined in RFC 4575) for IMS conference call. @@ -139,4 +141,30 @@ public class ImsConferenceState implements Parcelable { return new ImsConferenceState[size]; } }; + + /** + * Translates an {@code ImsConferenceState} status type to a telecom connection state. + * + * @param status The status type. + * @return The corresponding {@link android.telecom.Connection} state. + */ + public static int getConnectionStateForStatus(String status) { + if (status.equals(STATUS_PENDING)) { + return Connection.STATE_INITIALIZING; + } else if (status.equals(STATUS_DIALING_IN)) { + return Connection.STATE_RINGING; + } else if (status.equals(STATUS_ALERTING) || + status.equals(STATUS_DIALING_OUT)) { + return Connection.STATE_DIALING; + } else if (status.equals(STATUS_ON_HOLD)) { + return Connection.STATE_HOLDING; + } else if (status.equals(STATUS_CONNECTED) || + status.equals(STATUS_MUTED_VIA_FOCUS) || + status.equals(STATUS_DISCONNECTING)) { + return Connection.STATE_ACTIVE; + } else if (status.equals(STATUS_DISCONNECTED)) { + return Connection.STATE_DISCONNECTED; + } + return Call.STATE_ACTIVE; + } } |