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

Commit 4bebdf00 authored by Tyler Gunn's avatar Tyler Gunn Committed by Automerger Merge Worker
Browse files

Merge "Move Call state into Call.Details" into sc-dev am: 4fcf638e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13924367

Change-Id: Id94f5364ee005eadae32b566c03ea83c615e38c0
parents f92149a0 4fcf638e
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -39186,7 +39186,7 @@ package android.telecom {
    method public android.telecom.Call getParent();
    method public android.telecom.Call getParent();
    method public String getRemainingPostDialSequence();
    method public String getRemainingPostDialSequence();
    method @Nullable public android.telecom.Call.RttCall getRttCall();
    method @Nullable public android.telecom.Call.RttCall getRttCall();
    method public int getState();
    method @Deprecated public int getState();
    method public android.telecom.InCallService.VideoCall getVideoCall();
    method public android.telecom.InCallService.VideoCall getVideoCall();
    method public void handoverTo(android.telecom.PhoneAccountHandle, int, android.os.Bundle);
    method public void handoverTo(android.telecom.PhoneAccountHandle, int, android.os.Bundle);
    method public void hold();
    method public void hold();
@@ -39281,6 +39281,7 @@ package android.telecom {
    method public android.net.Uri getHandle();
    method public android.net.Uri getHandle();
    method public int getHandlePresentation();
    method public int getHandlePresentation();
    method public android.os.Bundle getIntentExtras();
    method public android.os.Bundle getIntentExtras();
    method public final int getState();
    method public android.telecom.StatusHints getStatusHints();
    method public android.telecom.StatusHints getStatusHints();
    method public int getVideoState();
    method public int getVideoState();
    method public static boolean hasProperty(int, int);
    method public static boolean hasProperty(int, int);
+66 −4
Original line number Original line Diff line number Diff line
@@ -137,6 +137,27 @@ public final class Call {
     */
     */
    public static final int STATE_SIMULATED_RINGING = 13;
    public static final int STATE_SIMULATED_RINGING = 13;


    /**
     * @hide
     */
    @IntDef(prefix = { "STATE_" },
            value = {
                    STATE_NEW,
                    STATE_DIALING,
                    STATE_RINGING,
                    STATE_HOLDING,
                    STATE_ACTIVE,
                    STATE_DISCONNECTED,
                    STATE_SELECT_PHONE_ACCOUNT,
                    STATE_CONNECTING,
                    STATE_DISCONNECTING,
                    STATE_PULLING_CALL,
                    STATE_AUDIO_PROCESSING,
                    STATE_SIMULATED_RINGING
            })
    @Retention(RetentionPolicy.SOURCE)
    public @interface CallState {};

    /**
    /**
     * The key to retrieve the optional {@code PhoneAccount}s Telecom can bundle with its Call
     * The key to retrieve the optional {@code PhoneAccount}s Telecom can bundle with its Call
     * extras. Used to pass the phone accounts to display on the front end to the user in order to
     * extras. Used to pass the phone accounts to display on the front end to the user in order to
@@ -674,6 +695,7 @@ public final class Call {
        // Next PROPERTY value: 0x00004000
        // Next PROPERTY value: 0x00004000
        //******************************************************************************************
        //******************************************************************************************


        private final @CallState int mState;
        private final String mTelecomCallId;
        private final String mTelecomCallId;
        private final Uri mHandle;
        private final Uri mHandle;
        private final int mHandlePresentation;
        private final int mHandlePresentation;
@@ -868,6 +890,13 @@ public final class Call {
            return builder.toString();
            return builder.toString();
        }
        }


        /**
         * @return the state of the {@link Call} represented by this {@link Call.Details}.
         */
        public final @CallState int getState() {
            return mState;
        }

        /** {@hide} */
        /** {@hide} */
        @TestApi
        @TestApi
        public String getTelecomCallId() {
        public String getTelecomCallId() {
@@ -1069,6 +1098,7 @@ public final class Call {
            if (o instanceof Details) {
            if (o instanceof Details) {
                Details d = (Details) o;
                Details d = (Details) o;
                return
                return
                        Objects.equals(mState, d.mState) &&
                        Objects.equals(mHandle, d.mHandle) &&
                        Objects.equals(mHandle, d.mHandle) &&
                        Objects.equals(mHandlePresentation, d.mHandlePresentation) &&
                        Objects.equals(mHandlePresentation, d.mHandlePresentation) &&
                        Objects.equals(mCallerDisplayName, d.mCallerDisplayName) &&
                        Objects.equals(mCallerDisplayName, d.mCallerDisplayName) &&
@@ -1095,7 +1125,8 @@ public final class Call {


        @Override
        @Override
        public int hashCode() {
        public int hashCode() {
            return Objects.hash(mHandle,
            return Objects.hash(mState,
                            mHandle,
                            mHandlePresentation,
                            mHandlePresentation,
                            mCallerDisplayName,
                            mCallerDisplayName,
                            mCallerDisplayNamePresentation,
                            mCallerDisplayNamePresentation,
@@ -1117,6 +1148,7 @@ public final class Call {


        /** {@hide} */
        /** {@hide} */
        public Details(
        public Details(
                @CallState int state,
                String telecomCallId,
                String telecomCallId,
                Uri handle,
                Uri handle,
                int handlePresentation,
                int handlePresentation,
@@ -1136,6 +1168,7 @@ public final class Call {
                String contactDisplayName,
                String contactDisplayName,
                int callDirection,
                int callDirection,
                int callerNumberVerificationStatus) {
                int callerNumberVerificationStatus) {
            mState = state;
            mTelecomCallId = telecomCallId;
            mTelecomCallId = telecomCallId;
            mHandle = handle;
            mHandle = handle;
            mHandlePresentation = handlePresentation;
            mHandlePresentation = handlePresentation;
@@ -1160,6 +1193,7 @@ public final class Call {
        /** {@hide} */
        /** {@hide} */
        public static Details createFromParcelableCall(ParcelableCall parcelableCall) {
        public static Details createFromParcelableCall(ParcelableCall parcelableCall) {
            return new Details(
            return new Details(
                    parcelableCall.getState(),
                    parcelableCall.getId(),
                    parcelableCall.getId(),
                    parcelableCall.getHandle(),
                    parcelableCall.getHandle(),
                    parcelableCall.getHandlePresentation(),
                    parcelableCall.getHandlePresentation(),
@@ -1186,6 +1220,8 @@ public final class Call {
            StringBuilder sb = new StringBuilder();
            StringBuilder sb = new StringBuilder();
            sb.append("[id: ");
            sb.append("[id: ");
            sb.append(mTelecomCallId);
            sb.append(mTelecomCallId);
            sb.append(", state: ");
            sb.append(Call.stateToString(mState));
            sb.append(", pa: ");
            sb.append(", pa: ");
            sb.append(mAccountHandle);
            sb.append(mAccountHandle);
            sb.append(", hdl: ");
            sb.append(", hdl: ");
@@ -1302,7 +1338,7 @@ public final class Call {
         * @param call The {@code Call} invoking this method.
         * @param call The {@code Call} invoking this method.
         * @param state The new state of the {@code Call}.
         * @param state The new state of the {@code Call}.
         */
         */
        public void onStateChanged(Call call, int state) {}
        public void onStateChanged(Call call, @CallState int state) {}


        /**
        /**
         * Invoked when the parent of this {@code Call} has changed. See {@link #getParent()}.
         * Invoked when the parent of this {@code Call} has changed. See {@link #getParent()}.
@@ -2171,9 +2207,11 @@ public final class Call {
    /**
    /**
     * Obtains the state of this {@code Call}.
     * Obtains the state of this {@code Call}.
     *
     *
     * @return A state value, chosen from the {@code STATE_*} constants.
     * @return The call state.
     * @deprecated The call state is available via {@link Call.Details#getState()}.
     */
     */
    public int getState() {
    @Deprecated
    public @CallState int getState() {
        return mState;
        return mState;
    }
    }


@@ -2551,6 +2589,30 @@ public final class Call {
    final void internalSetDisconnected() {
    final void internalSetDisconnected() {
        if (mState != Call.STATE_DISCONNECTED) {
        if (mState != Call.STATE_DISCONNECTED) {
            mState = Call.STATE_DISCONNECTED;
            mState = Call.STATE_DISCONNECTED;
            if (mDetails != null) {
                mDetails = new Details(mState,
                        mDetails.getTelecomCallId(),
                        mDetails.getHandle(),
                        mDetails.getHandlePresentation(),
                        mDetails.getCallerDisplayName(),
                        mDetails.getCallerDisplayNamePresentation(),
                        mDetails.getAccountHandle(),
                        mDetails.getCallCapabilities(),
                        mDetails.getCallProperties(),
                        mDetails.getDisconnectCause(),
                        mDetails.getConnectTimeMillis(),
                        mDetails.getGatewayInfo(),
                        mDetails.getVideoState(),
                        mDetails.getStatusHints(),
                        mDetails.getExtras(),
                        mDetails.getIntentExtras(),
                        mDetails.getCreationTimeMillis(),
                        mDetails.getContactDisplayName(),
                        mDetails.getCallDirection(),
                        mDetails.getCallerNumberVerificationStatus()
                        );
                fireDetailsChanged(mDetails);
            }
            fireStateChanged(mState);
            fireStateChanged(mState);
            fireCallDestroyed();
            fireCallDestroyed();
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -399,7 +399,7 @@ public final class ParcelableCall implements Parcelable {
    }
    }


    /** The current state of the call. */
    /** The current state of the call. */
    public int getState() {
    public @Call.CallState int getState() {
        return mState;
        return mState;
    }
    }