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

Commit 8b3ac5de authored by Danny Baumann's avatar Danny Baumann Committed by Steve Kondik
Browse files

Proper supplementary service notification handling (1/5).

Change-Id: I4fa94d4ba68a1570d3f822be569ae124882c0e66
parent 44e26c70
Loading
Loading
Loading
Loading
+47 −1
Original line number Diff line number Diff line
@@ -321,8 +321,38 @@ public final class Call {
         */
        public static final int PROPERTY_IS_EXTERNAL_CALL = 0x00000040;

        /*
         * Whether the call was forwarded from another party (GSM only)
         * @hide
         */
        public static final int PROPERTY_WAS_FORWARDED = 0x00000080;

        /**
         * Whether the call is held remotely
         * @hide
         */
        public static final int PROPERTY_HELD_REMOTELY = 0x00000100;

        /**
         * Whether the dialing state is waiting for the busy remote side
         * @hide
         */
        public static final int PROPERTY_DIALING_IS_WAITING = 0x00000200;

        /**
         * Whether an additional call came in and was forwarded while the call was active
         * @hide
         */
        public static final int PROPERTY_ADDITIONAL_CALL_FORWARDED = 0x00000400;

        /**
         * Whether incoming calls are barred at the remote side
         * @hide
         */
        public static final int PROPERTY_REMOTE_INCOMING_CALLS_BARRED = 0x00000800;

        //******************************************************************************************
        // Next PROPERTY value: 0x00000100
        // Next PROPERTY value: 0x00001000
        //******************************************************************************************

        private final String mTelecomCallId;
@@ -483,6 +513,22 @@ public final class Call {
            if (hasProperty(properties, PROPERTY_IS_EXTERNAL_CALL)) {
                builder.append(" PROPERTY_IS_EXTERNAL_CALL");
            }
            if (hasProperty(properties, PROPERTY_WAS_FORWARDED)) {
                builder.append(" PROPERTY_WAS_FORWARDED");
            }
            if (hasProperty(properties, PROPERTY_HELD_REMOTELY)) {
                builder.append(" PROPERTY_HELD_REMOTELY");
            }
            if (hasProperty(properties, PROPERTY_DIALING_IS_WAITING)) {
                builder.append(" PROPERTY_DIALING_IS_WAITING");
            }
            if (hasProperty(properties, PROPERTY_ADDITIONAL_CALL_FORWARDED)) {
                builder.append(" PROPERTY_ADDITIONAL_CALL_FORWARDED");
            }
            if (hasProperty(properties, PROPERTY_REMOTE_INCOMING_CALLS_BARRED)) {
                builder.append(" PROPERTY_REMOTE_INCOMING_CALLS_BARRED");
            }

            builder.append("]");
            return builder.toString();
        }
+3 −1
Original line number Diff line number Diff line
@@ -656,9 +656,11 @@ public abstract class Conference extends Conferenceable {
    @Override
    public String toString() {
        return String.format(Locale.US,
                "[State: %s,Capabilites: %s, VideoState: %s, VideoProvider: %s, ThisObject %s]",
                "[State: %s, Capabilites: %s, Properties: %s, " +
                "VideoState: %s, VideoProvider: %s, ThisObject %s]",
                Connection.stateToString(mState),
                Call.Details.capabilitiesToString(mConnectionCapabilities),
                Call.Details.propertiesToString(mConnectionProperties),
                getVideoState(),
                getVideoProvider(),
                super.toString());
+82 −1
Original line number Diff line number Diff line
@@ -350,9 +350,39 @@ public abstract class Connection extends Conferenceable {
     */
    public static final int PROPERTY_IS_EXTERNAL_CALL = 1<<4;

    /**
     * Whether the call was forwarded from another party (GSM only)
     * @hide
     */
    public static final int PROPERTY_WAS_FORWARDED = 1 << 5;

    /**
     * Whether the call is held remotely
     * @hide
     */
    public static final int PROPERTY_HELD_REMOTELY = 1 << 6;

    /**
     * Whether the dialing state is waiting for the busy remote side
     * @hide
     */
    public static final int PROPERTY_DIALING_IS_WAITING = 1 << 7;

    /**
     * Whether an additional call came in and was forwarded while the call was active
     * @hide
     */
    public static final int PROPERTY_ADDITIONAL_CALL_FORWARDED = 1 << 8;

    /**
     * Whether incoming calls are barred at the remote side
     * @hide
     */
    public static final int PROPERTY_REMOTE_INCOMING_CALLS_BARRED = 1 << 9;


    //**********************************************************************************************
    // Next PROPERTY value: 1<<5
    // Next PROPERTY value: 1<<10
    //**********************************************************************************************

    /**
@@ -555,10 +585,61 @@ public abstract class Connection extends Conferenceable {
            builder.append(" PROPERTY_IS_EXTERNAL_CALL");
        }

        if (can(properties, PROPERTY_WAS_FORWARDED)) {
            builder.append(" PROPERTY_WAS_FORWARDED");
        }

        if (can(properties, PROPERTY_HELD_REMOTELY)) {
            builder.append(" PROPERTY_HELD_REMOTELY");
        }

        if (can(properties, PROPERTY_DIALING_IS_WAITING)) {
            builder.append(" PROPERTY_DIALING_IS_WAITING");
        }

        if (can(properties, PROPERTY_ADDITIONAL_CALL_FORWARDED)) {
            builder.append(" PROPERTY_ADDITIONAL_CALL_FORWARDED");
        }

        if (can(properties, PROPERTY_REMOTE_INCOMING_CALLS_BARRED)) {
            builder.append(" PROPERTY_REMOTE_INCOMING_CALLS_BARRED");
        }

        builder.append("]");
        return builder.toString();
    }

    /**
     * Whether the properties of this {@code Connection} include the specified property.
     *
     * @param property The property to look for.
     * @return Whether the specified property is present.
     * @hide
     */
    public boolean hasProperty(int property) {
        return can(mConnectionProperties, property);
    }

    /**
     * Removes the specified property from the set of properties of this {@code Connection}.
     *
     * @param property The property to remove from the set.
     * @hide
     */
    public void removeProperty(int property) {
        setConnectionProperties(mConnectionProperties & ~property);
    }

    /**
     * Adds the specified property to the set of propertes of this {@code Connection}.
     *
     * @param property The property to add to the set.
     * @hide
     */
    public void addProperty(int property) {
        setConnectionProperties(mConnectionProperties | property);
    }

    /** @hide */
    public abstract static class Listener {
        public void onStateChanged(Connection c, int state) {}
+1 −1
Original line number Diff line number Diff line
@@ -520,7 +520,7 @@ public abstract class ConnectionService extends Service {
                Conference conference,
                int connectionProperties) {
            String id = mIdByConference.get(conference);
            Log.d(this, "call capabilities: conference: %s",
            Log.d(this, "call properties: conference: %s",
                    Connection.propertiesToString(connectionProperties));
            mAdapter.setConnectionProperties(id, connectionProperties);
        }
+1 −0
Original line number Diff line number Diff line
@@ -218,6 +218,7 @@ final class RemoteConnectionService {

            conference.setState(parcel.getState());
            conference.setConnectionCapabilities(parcel.getConnectionCapabilities());
            conference.setConnectionProperties(parcel.getConnectionProperties());
            mConferenceById.put(callId, conference);
            conference.registerCallback(new RemoteConference.Callback() {
                @Override
Loading