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

Commit 8e9e3c69 authored by Danny Baumann's avatar Danny Baumann
Browse files

Proper supplementary service notification handling (1/5).

Change-Id: I4fa94d4ba68a1570d3f822be569ae124882c0e66
parent d6acb800
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -423,8 +423,20 @@ public final class Call {
         */
        public static final int PROPERTY_ASSISTED_DIALING_USED = 0x00000200;

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

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

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

        private final String mTelecomCallId;
@@ -587,6 +599,12 @@ public final class Call {
            if(hasProperty(properties, PROPERTY_ASSISTED_DIALING_USED)) {
                builder.append(" PROPERTY_ASSISTED_DIALING_USED");
            }
            if (hasProperty(properties, PROPERTY_WAS_FORWARDED)) {
                builder.append(" PROPERTY_WAS_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
@@ -685,9 +685,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());
+68 −1
Original line number Diff line number Diff line
@@ -407,8 +407,20 @@ public abstract class Connection extends Conferenceable {
     */
    public static final int PROPERTY_ASSISTED_DIALING_USED = 1 << 9;

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

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

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

    /**
@@ -575,6 +587,22 @@ public abstract class Connection extends Conferenceable {
    public static final String EVENT_CALL_REMOTELY_UNHELD =
            "android.telecom.event.CALL_REMOTELY_UNHELD";

    /**
     * Connection event used to inform {@link InCallService} when the dialing state
     * is waiting for the busy remote side.
     * @hide
     */
    public static final String EVENT_DIALING_IS_WAITING =
            "android.telecom.event.DIALING_IS_WAITING";

    /**
     * Connection event used to inform {@link InCallService} Whether an additional call came in
     * and was forwarded while the call was active.
     * @hide
     */
    public static final String EVENT_ADDITIONAL_CALL_FORWARDED =
            "android.telecom.event.ADDITIONAL_CALL_FORWARDED";

    /**
     * Connection event used to inform an {@link InCallService} which initiated a call handover via
     * {@link Call#EVENT_REQUEST_HANDOVER} that the handover from this {@link Connection} has
@@ -789,10 +817,49 @@ public abstract class Connection extends Conferenceable {
            builder.append(isLong ? " PROPERTY_HAS_CDMA_VOICE_PRIVACY" : " priv");
        }

        if (can(properties, PROPERTY_WAS_FORWARDED)) {
            builder.append(" PROPERTY_WAS_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
@@ -1077,7 +1077,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);
        }