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

Commit b19a0bcd authored by Ihab Awad's avatar Ihab Awad
Browse files

Final structural tweaks to Telecomm API (1/8)

Bug: 16416927
Bug: 16494880
Change-Id: I45fbe287c410cbb5e1b985f320b862d732811f43
parent 4a8dddbf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -350,8 +350,8 @@ LOCAL_SRC_FILES += \
	media/java/android/media/tv/ITvInputServiceCallback.aidl \
	media/java/android/media/tv/ITvInputSession.aidl \
	media/java/android/media/tv/ITvInputSessionCallback.aidl \
	telecomm/java/com/android/internal/telecomm/IVideoCallCallback.aidl \
	telecomm/java/com/android/internal/telecomm/IVideoCallProvider.aidl \
	telecomm/java/com/android/internal/telecomm/IVideoCallback.aidl \
	telecomm/java/com/android/internal/telecomm/IVideoProvider.aidl \
	telecomm/java/com/android/internal/telecomm/IConnectionService.aidl \
	telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl \
	telecomm/java/com/android/internal/telecomm/IInCallAdapter.aidl \
+91 −257

File changed.

Preview size limit exceeded, changes collapsed.

+4 −1
Original line number Diff line number Diff line
@@ -16,4 +16,7 @@

package android.telecomm;

parcelable CallAudioState;
/**
 * {@hide}
 */
parcelable AudioState;
+14 −14
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import java.util.Locale;
/**
 *  Encapsulates all audio states during a call.
 */
public final class CallAudioState implements Parcelable {
public final class AudioState implements Parcelable {
    /** Direct the audio stream through the device's earpiece. */
    public static int ROUTE_EARPIECE      = 0x00000001;

@@ -57,14 +57,14 @@ public final class CallAudioState implements Parcelable {
    public final int supportedRouteMask;

    /** @hide */
    public CallAudioState(boolean isMuted, int route, int supportedRouteMask) {
    public AudioState(boolean isMuted, int route, int supportedRouteMask) {
        this.isMuted = isMuted;
        this.route = route;
        this.supportedRouteMask = supportedRouteMask;
    }

    /** @hide */
    public CallAudioState(CallAudioState state) {
    public AudioState(AudioState state) {
        isMuted = state.isMuted;
        route = state.route;
        supportedRouteMask = state.supportedRouteMask;
@@ -75,10 +75,10 @@ public final class CallAudioState implements Parcelable {
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof CallAudioState)) {
        if (!(obj instanceof AudioState)) {
            return false;
        }
        CallAudioState state = (CallAudioState) obj;
        AudioState state = (AudioState) obj;
        return isMuted == state.isMuted && route == state.route &&
                supportedRouteMask == state.supportedRouteMask;
    }
@@ -86,7 +86,7 @@ public final class CallAudioState implements Parcelable {
    @Override
    public String toString() {
        return String.format(Locale.US,
                "[CallAudioState isMuted: %b, route; %s, supportedRouteMask: %s]",
                "[AudioState isMuted: %b, route; %s, supportedRouteMask: %s]",
                isMuted, audioRouteToString(route), audioRouteToString(supportedRouteMask));
    }

@@ -121,22 +121,22 @@ public final class CallAudioState implements Parcelable {
    }

    /**
     * Responsible for creating CallAudioState objects for deserialized Parcels.
     * Responsible for creating AudioState objects for deserialized Parcels.
     */
    public static final Parcelable.Creator<CallAudioState> CREATOR =
            new Parcelable.Creator<CallAudioState> () {
    public static final Parcelable.Creator<AudioState> CREATOR =
            new Parcelable.Creator<AudioState> () {

        @Override
        public CallAudioState createFromParcel(Parcel source) {
        public AudioState createFromParcel(Parcel source) {
            boolean isMuted = source.readByte() == 0 ? false : true;
            int route = source.readInt();
            int supportedRouteMask = source.readInt();
            return new CallAudioState(isMuted, route, supportedRouteMask);
            return new AudioState(isMuted, route, supportedRouteMask);
        }

        @Override
        public CallAudioState[] newArray(int size) {
            return new CallAudioState[size];
        public AudioState[] newArray(int size) {
            return new AudioState[size];
        }
    };

@@ -149,7 +149,7 @@ public final class CallAudioState implements Parcelable {
    }

    /**
     * Writes CallAudioState object into a serializeable Parcel.
     * Writes AudioState object into a serializeable Parcel.
     */
    @Override
    public void writeToParcel(Parcel destination, int flags) {
+22 −32
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import java.util.Objects;

/**
 * Represents an ongoing phone call that the in-call app should present to the user.
 *
 * {@hide}
 */
public final class Call {
    /**
@@ -84,7 +86,7 @@ public final class Call {
        private final PhoneAccountHandle mAccountHandle;
        private final int mCallCapabilities;
        private final int mDisconnectCauseCode;
        private final String mDisconnectCauseMsg;
        private final String mDisconnectCauseMessage;
        private final long mConnectTimeMillis;
        private final GatewayInfo mGatewayInfo;
        private final int mVideoState;
@@ -100,7 +102,7 @@ public final class Call {

        /**
         * @return The presentation requirements for the handle. See
         * {@link android.telecomm.CallPropertyPresentation} for valid values.
         * {@link PropertyPresentation} for valid values.
         */
        public int getHandlePresentation() {
            return mHandlePresentation;
@@ -115,7 +117,7 @@ public final class Call {

        /**
         * @return The presentation requirements for the caller display name. See
         * {@link android.telecomm.CallPropertyPresentation} for valid values.
         * {@link PropertyPresentation} for valid values.
         */
        public int getCallerDisplayNamePresentation() {
            return mCallerDisplayNamePresentation;
@@ -131,7 +133,7 @@ public final class Call {

        /**
         * @return A bitmask of the capabilities of the {@code Call}, as defined in
         *         {@link CallCapabilities}.
         *         {@link PhoneCapabilities}.
         */
        public int getCallCapabilities() {
            return mCallCapabilities;
@@ -149,8 +151,8 @@ public final class Call {
         * @return For a {@link #STATE_DISCONNECTED} {@code Call}, an optional reason for
         * disconnection expressed as a free text message.
         */
        public String getDisconnectCauseMsg() {
            return mDisconnectCauseMsg;
        public String getDisconnectCauseMessage() {
            return mDisconnectCauseMessage;
        }

        /**
@@ -197,7 +199,7 @@ public final class Call {
                        Objects.equals(mAccountHandle, d.mAccountHandle) &&
                        Objects.equals(mCallCapabilities, d.mCallCapabilities) &&
                        Objects.equals(mDisconnectCauseCode, d.mDisconnectCauseCode) &&
                        Objects.equals(mDisconnectCauseMsg, d.mDisconnectCauseMsg) &&
                        Objects.equals(mDisconnectCauseMessage, d.mDisconnectCauseMessage) &&
                        Objects.equals(mConnectTimeMillis, d.mConnectTimeMillis) &&
                        Objects.equals(mGatewayInfo, d.mGatewayInfo) &&
                        Objects.equals(mVideoState, d.mVideoState) &&
@@ -216,7 +218,7 @@ public final class Call {
                    Objects.hashCode(mAccountHandle) +
                    Objects.hashCode(mCallCapabilities) +
                    Objects.hashCode(mDisconnectCauseCode) +
                    Objects.hashCode(mDisconnectCauseMsg) +
                    Objects.hashCode(mDisconnectCauseMessage) +
                    Objects.hashCode(mConnectTimeMillis) +
                    Objects.hashCode(mGatewayInfo) +
                    Objects.hashCode(mVideoState) +
@@ -232,7 +234,7 @@ public final class Call {
                PhoneAccountHandle accountHandle,
                int capabilities,
                int disconnectCauseCode,
                String disconnectCauseMsg,
                String disconnectCauseMessage,
                long connectTimeMillis,
                GatewayInfo gatewayInfo,
                int videoState,
@@ -244,7 +246,7 @@ public final class Call {
            mAccountHandle = accountHandle;
            mCallCapabilities = capabilities;
            mDisconnectCauseCode = disconnectCauseCode;
            mDisconnectCauseMsg = disconnectCauseMsg;
            mDisconnectCauseMessage = disconnectCauseMessage;
            mConnectTimeMillis = connectTimeMillis;
            mGatewayInfo = gatewayInfo;
            mVideoState = videoState;
@@ -256,8 +258,6 @@ public final class Call {
        /**
         * Invoked when the state of this {@code Call} has changed. See {@link #getState()}.
         *
         * TODO: Provide previous state also?
         *
         * @param call The {@code Call} invoking this method.
         * @param state The new state of the {@code Call}.
         */
@@ -459,8 +459,6 @@ public final class Call {

    /**
     * Notifies this {@code Call} that the phone account user interface element was touched.
     *
     * TODO: Figure out if and how we can generalize this
     */
    public void phoneAccountClicked() {
        mInCallAdapter.phoneAccountClicked(mTelecommCallId);
@@ -494,14 +492,6 @@ public final class Call {
        mInCallAdapter.splitFromConference(mTelecommCallId);
    }

    /**
     * Instructs this {@code Call} to swap itself with an existing background call, if one
     * such call exists.
     */
    public void swapWithBackgroundCall() {
        mInCallAdapter.swapWithBackgroundCall(mTelecommCallId);
    }

    /**
     * Obtains the parent of this {@code Call} in a conference, if any.
     *
@@ -774,25 +764,25 @@ public final class Call {
        }
    }

    private int stateFromParcelableCallState(CallState parcelableCallState) {
    private int stateFromParcelableCallState(int parcelableCallState) {
        switch (parcelableCallState) {
            case NEW:
            case CallState.NEW:
                return STATE_NEW;
            case CONNECTING:
            case CallState.CONNECTING:
                return STATE_CONNECTING;
            case PRE_DIAL_WAIT:
            case CallState.PRE_DIAL_WAIT:
                return STATE_PRE_DIAL_WAIT;
            case DIALING:
            case CallState.DIALING:
                return STATE_DIALING;
            case RINGING:
            case CallState.RINGING:
                return STATE_RINGING;
            case ACTIVE:
            case CallState.ACTIVE:
                return STATE_ACTIVE;
            case ON_HOLD:
            case CallState.ON_HOLD:
                return STATE_HOLDING;
            case DISCONNECTED:
            case CallState.DISCONNECTED:
                return STATE_DISCONNECTED;
            case ABORTED:
            case CallState.ABORTED:
                return STATE_DISCONNECTED;
            default:
                Log.wtf(this, "Unrecognized CallState %s", parcelableCallState);
Loading