Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c350bbb authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Handle alternate status values.

Some carriers use sendrecv to indicate a call in a conference is active,
and sendonly to indicate that the remote party has held the call.
Adding support for these status values.

This ensures that remotely held calls for these carriers are set to held.

Test: Manual
Bug: 33272103
Merged-In: Ie386bdb4c77df1305d80f604f48174794c3ee0c1
Change-Id: I4a950c4e143d5ac396b30569dbda0b1cf4e92a3e
parent 47b23176
Loading
Loading
Loading
Loading
+42 −2
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ public class ImsConferenceState implements Parcelable {
    public static final String STATUS_DISCONNECTED = "disconnected";
    public static final String STATUS_MUTED_VIA_FOCUS = "muted-via-focus";
    public static final String STATUS_CONNECT_FAIL = "connect-fail";
    public static final String STATUS_SEND_ONLY = "sendonly";
    public static final String STATUS_SEND_RECV = "sendrecv";

    /**
     * conference-info : SIP status code (integer)
@@ -156,15 +158,53 @@ public class ImsConferenceState implements Parcelable {
        } else if (status.equals(STATUS_ALERTING) ||
                status.equals(STATUS_DIALING_OUT)) {
            return Connection.STATE_DIALING;
        } else if (status.equals(STATUS_ON_HOLD)) {
        } else if (status.equals(STATUS_ON_HOLD) ||
                status.equals(STATUS_SEND_ONLY)) {
            return Connection.STATE_HOLDING;
        } else if (status.equals(STATUS_CONNECTED) ||
                status.equals(STATUS_MUTED_VIA_FOCUS) ||
                status.equals(STATUS_DISCONNECTING)) {
                status.equals(STATUS_DISCONNECTING) ||
                status.equals(STATUS_SEND_RECV)) {
            return Connection.STATE_ACTIVE;
        } else if (status.equals(STATUS_DISCONNECTED)) {
            return Connection.STATE_DISCONNECTED;
        }
        return Call.STATE_ACTIVE;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("[");
        sb.append(ImsConferenceState.class.getSimpleName());
        sb.append(" ");
        if (mParticipants.size() > 0) {
            Set<Entry<String, Bundle>> entries = mParticipants.entrySet();

            if (entries != null) {
                Iterator<Entry<String, Bundle>> iterator = entries.iterator();
                sb.append("<");
                while (iterator.hasNext()) {
                    Entry<String, Bundle> entry = iterator.next();
                    sb.append(entry.getKey());
                    sb.append(": ");
                    Bundle participantData = entry.getValue();

                    for (String key : participantData.keySet()) {
                        sb.append(key);
                        sb.append("=");
                        if (ENDPOINT.equals(key) || USER.equals(key)) {
                            sb.append(android.telecom.Log.pii(participantData.get(key)));
                        } else {
                            sb.append(participantData.get(key));
                        }
                        sb.append(", ");
                    }
                }
                sb.append(">");
            }
        }
        sb.append("]");
        return sb.toString();
    }
}