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

Commit d0124294 authored by Jay Shrauner's avatar Jay Shrauner Committed by Android (Google) Code Review
Browse files

Merge "Remove connection substate"

parents 54832cdb 8f988439
Loading
Loading
Loading
Loading
+4 −18
Original line number Diff line number Diff line
@@ -234,7 +234,6 @@ public final class Call {
        private final int mVideoState;
        private final StatusHints mStatusHints;
        private final Bundle mExtras;
        private final int mCallSubstate;

        /**
         * Whether the supplied capabilities  supports the specified capability.
@@ -431,14 +430,6 @@ public final class Call {
            return mExtras;
        }

        /**
         * @return The substate of the {@code Call}.
         * @hide
         */
        public int getCallSubstate() {
            return mCallSubstate;
        }

        @Override
        public boolean equals(Object o) {
            if (o instanceof Details) {
@@ -457,8 +448,7 @@ public final class Call {
                        Objects.equals(mGatewayInfo, d.mGatewayInfo) &&
                        Objects.equals(mVideoState, d.mVideoState) &&
                        Objects.equals(mStatusHints, d.mStatusHints) &&
                        Objects.equals(mExtras, d.mExtras) &&
                        Objects.equals(mCallSubstate, d.mCallSubstate);
                        Objects.equals(mExtras, d.mExtras);
            }
            return false;
        }
@@ -478,8 +468,7 @@ public final class Call {
                    Objects.hashCode(mGatewayInfo) +
                    Objects.hashCode(mVideoState) +
                    Objects.hashCode(mStatusHints) +
                    Objects.hashCode(mExtras) +
                    Objects.hashCode(mCallSubstate);
                    Objects.hashCode(mExtras);
        }

        /** {@hide} */
@@ -496,8 +485,7 @@ public final class Call {
                GatewayInfo gatewayInfo,
                int videoState,
                StatusHints statusHints,
                Bundle extras,
                int callSubstate) {
                Bundle extras) {
            mHandle = handle;
            mHandlePresentation = handlePresentation;
            mCallerDisplayName = callerDisplayName;
@@ -511,7 +499,6 @@ public final class Call {
            mVideoState = videoState;
            mStatusHints = statusHints;
            mExtras = extras;
            mCallSubstate = callSubstate;
        }
    }

@@ -925,8 +912,7 @@ public final class Call {
                parcelableCall.getGatewayInfo(),
                parcelableCall.getVideoState(),
                parcelableCall.getStatusHints(),
                parcelableCall.getExtras(),
                parcelableCall.getCallSubstate());
                parcelableCall.getExtras());
        boolean detailsChanged = !Objects.equals(mDetails, details);
        if (detailsChanged) {
            mDetails = details;
+0 −78
Original line number Diff line number Diff line
@@ -200,48 +200,6 @@ public abstract class Connection implements IConferenceable {
    // Next CAPABILITY value: 0x00200000
    //**********************************************************************************************

    /**
     * Call substate bitmask values
     */

    /* Default case */
    /**
     * @hide
     */
    public static final int SUBSTATE_NONE = 0;

    /* Indicates that the call is connected but audio attribute is suspended */
    /**
     * @hide
     */
    public static final int SUBSTATE_AUDIO_CONNECTED_SUSPENDED = 0x1;

    /* Indicates that the call is connected but video attribute is suspended */
    /**
     * @hide
     */
    public static final int SUBSTATE_VIDEO_CONNECTED_SUSPENDED = 0x2;

    /* Indicates that the call is established but media retry is needed */
    /**
     * @hide
     */
    public static final int SUBSTATE_AVP_RETRY = 0x4;

    /* Indicates that the call is multitasking */
    /**
     * @hide
     */
    public static final int SUBSTATE_MEDIA_PAUSED = 0x8;

    /* Mask containing all the call substate bits set */
    /**
     * @hide
     */
    public static final int SUBSTATE_ALL = SUBSTATE_AUDIO_CONNECTED_SUSPENDED |
        SUBSTATE_VIDEO_CONNECTED_SUSPENDED | SUBSTATE_AVP_RETRY |
        SUBSTATE_MEDIA_PAUSED;

    // Flag controlling whether PII is emitted into the logs
    private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG);

@@ -380,7 +338,6 @@ public abstract class Connection implements IConferenceable {
        public void onConferenceParticipantsChanged(Connection c,
                List<ConferenceParticipant> participants) {}
        public void onConferenceStarted() {}
        public void onCallSubstateChanged(Connection c, int substate) {}
    }

    public static abstract class VideoProvider {
@@ -807,7 +764,6 @@ public abstract class Connection implements IConferenceable {
    private DisconnectCause mDisconnectCause;
    private Conference mConference;
    private ConnectionService mConnectionService;
    private int mCallSubstate;

    /**
     * Create a new Connection.
@@ -865,21 +821,6 @@ public abstract class Connection implements IConferenceable {
        return mVideoState;
    }

    /**
     * Returns the call substate of the call.
     * Valid values: {@link Connection#SUBSTATE_NONE},
     * {@link Connection#SUBSTATE_AUDIO_CONNECTED_SUSPENDED},
     * {@link Connection#SUBSTATE_VIDEO_CONNECTED_SUSPENDED},
     * {@link Connection#SUBSTATE_AVP_RETRY},
     * {@link Connection#SUBSTATE_MEDIA_PAUSED}.
     *
     * @param callSubstate The new call substate.
     * @hide
     */
    public final int getCallSubstate() {
        return mCallSubstate;
    }

    /**
     * @return The audio state of the connection, describing how its audio is currently
     *         being routed by the system. This is {@code null} if this Connection
@@ -1053,25 +994,6 @@ public abstract class Connection implements IConferenceable {
        }
    }

    /**
     * Set the call substate for the connection.
     * Valid values: {@link Connection#SUBSTATE_NONE},
     * {@link Connection#SUBSTATE_AUDIO_CONNECTED_SUSPENDED},
     * {@link Connection#SUBSTATE_VIDEO_CONNECTED_SUSPENDED},
     * {@link Connection#SUBSTATE_AVP_RETRY},
     * {@link Connection#SUBSTATE_MEDIA_PAUSED}.
     *
     * @param callSubstate The new call substate.
     * @hide
     */
    public final void setCallSubstate(int callSubstate) {
        Log.d(this, "setCallSubstate %d", callSubstate);
        mCallSubstate = callSubstate;
        for (Listener l : mListeners) {
            l.onCallSubstateChanged(this, mCallSubstate);
        }
    }

    /**
     * Sets state to active (e.g., an ongoing connection where two or more parties can actively
     * communicate).
+2 −10
Original line number Diff line number Diff line
@@ -556,13 +556,6 @@ public abstract class ConnectionService extends Service {
                mAdapter.setIsConferenced(id, conferenceId);
            }
        }

        @Override
        public void onCallSubstateChanged(Connection c, int callSubstate) {
            String id = mIdByConnection.get(c);
            Log.d(this, "Adapter set call substate %d", callSubstate);
            mAdapter.setCallSubstate(id, callSubstate);
        }
    };

    /** {@inheritDoc} */
@@ -632,8 +625,7 @@ public abstract class ConnectionService extends Service {
                        connection.getAudioModeIsVoip(),
                        connection.getStatusHints(),
                        connection.getDisconnectCause(),
                        createIdList(connection.getConferenceables()),
                        connection.getCallSubstate()));
                        createIdList(connection.getConferenceables())));
    }

    private void abort(String callId) {
@@ -956,7 +948,7 @@ public abstract class ConnectionService extends Service {
                    connection.getAudioModeIsVoip(),
                    connection.getStatusHints(),
                    connection.getDisconnectCause(),
                    emptyList, connection.getCallSubstate());
                    emptyList);
            mAdapter.addExistingConnection(id, parcelableConnection);
        }
    }
+0 −22
Original line number Diff line number Diff line
@@ -369,26 +369,4 @@ final class ConnectionServiceAdapter implements DeathRecipient {
            }
        }
    }

    /**
     * Set the call substate for the connection.
     * Valid values: {@link Connection#CALL_SUBSTATE_NONE},
     * {@link Connection#CALL_SUBSTATE_AUDIO_CONNECTED_SUSPENDED},
     * {@link Connection#CALL_SUBSTATE_VIDEO_CONNECTED_SUSPENDED},
     * {@link Connection#CALL_SUBSTATE_AVP_RETRY},
     * {@link Connection#CALL_SUBSTATE_MEDIA_PAUSED}.
     *
     * @param callId The unique ID of the call to set the substate for.
     * @param callSubstate The new call substate.
     * @hide
     */
    public final void setCallSubstate(String callId, int callSubstate) {
        Log.v(this, "setCallSubstate: %d", callSubstate);
        for (IConnectionServiceAdapter adapter : mAdapters) {
            try {
                adapter.setCallSubstate(callId, callSubstate);
            } catch (RemoteException ignored) {
            }
        }
    }
}
+0 −11
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ final class ConnectionServiceAdapterServant {
    private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20;
    private static final int MSG_ADD_EXISTING_CONNECTION = 21;
    private static final int MSG_ON_POST_DIAL_CHAR = 22;
    private static final int MSG_SET_CALL_SUBSTATE = 23;

    private final IConnectionServiceAdapter mDelegate;

@@ -221,10 +220,6 @@ final class ConnectionServiceAdapterServant {
                    }
                    break;
                }
                case MSG_SET_CALL_SUBSTATE: {
                    mDelegate.setCallSubstate((String) msg.obj, msg.arg1);
                    break;
                }
            }
        }
    };
@@ -389,12 +384,6 @@ final class ConnectionServiceAdapterServant {
            args.arg2 = connection;
            mHandler.obtainMessage(MSG_ADD_EXISTING_CONNECTION, args).sendToTarget();
        }

        @Override
        public void setCallSubstate(String connectionId, int callSubstate) {
            mHandler.obtainMessage(MSG_SET_CALL_SUBSTATE, callSubstate, 0,
                connectionId).sendToTarget();
        }
    };

    public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {
Loading