diff options
author | Tyler Gunn <tgunn@google.com> | 2014-10-30 23:44:03 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-30 23:44:03 +0000 |
commit | 2a369533947c5552ba8e1c5cc9fb657952e3f0e0 (patch) | |
tree | 1d0d1016eaf557f006958a1ab6c05550560b7d00 /telephony | |
parent | bfc8599f43971fc11a7d1e67e557a83b3d476609 (diff) | |
parent | 7577f3dd8b738d73253f0c6bfe2383ef71a9ba20 (diff) | |
download | frameworks_base-2a369533947c5552ba8e1c5cc9fb657952e3f0e0.zip frameworks_base-2a369533947c5552ba8e1c5cc9fb657952e3f0e0.tar.gz frameworks_base-2a369533947c5552ba8e1c5cc9fb657952e3f0e0.tar.bz2 |
am 7577f3dd: am 16723098: Merge "Communicating participant changes to conference controller." into lmp-mr1-dev
* commit '7577f3dd8b738d73253f0c6bfe2383ef71a9ba20':
Communicating participant changes to conference controller.
Diffstat (limited to 'telephony')
-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; + } } |