summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2014-10-28 13:51:27 -0700
committerTyler Gunn <tgunn@google.com>2014-10-28 13:51:27 -0700
commit3bffcf78b5e4bd8b60543126fc0bdb09808f28f5 (patch)
treee81febe969c08503645c059bce1ddde9e2659764 /telephony
parentbd6f4a818ef36764eb69ef7308eb6a9bf3740138 (diff)
downloadframeworks_base-3bffcf78b5e4bd8b60543126fc0bdb09808f28f5.zip
frameworks_base-3bffcf78b5e4bd8b60543126fc0bdb09808f28f5.tar.gz
frameworks_base-3bffcf78b5e4bd8b60543126fc0bdb09808f28f5.tar.bz2
Communicating participant changes to conference controller.
- Add new ConferenceParticipant parcelable class which represents a single participant contained in the conference event package. - Adding callbacks/listeners to Connection to handle changes to participant state. Bug: 18057361 Change-Id: Iadfebe84959f30f8e835f282aa994c0b92768aa6
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/ims/ImsConferenceState.java28
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;
+ }
}