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

Commit 553db651 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Ensure connection extras set before connection start are passed through.

In ImsPhoneConnection, the extras pertaining to a "Child number" were
set on the ImsCallProfile prior to the connection being created.  Turns
out we only pass along extras when they're changed.  However, when the
connection is new we never call the callback to indicate the connection
extras changed.

Added code in ImsPhoneConnection to set the extras when the connection
is first created.

This ensures the extras make it to InCall for incoming calls.

Bug: 24585039
Change-Id: I90993a278b76371bf514fd332adf78bc58505357
parent 36767c5d
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ public abstract class Connection {
    private int mCallSubstate;
    private android.telecom.Connection.VideoProvider mVideoProvider;
    public Call.State mPreHandoverState = Call.State.IDLE;
    private Bundle mExtras;

    /* Instance Methods */

@@ -632,11 +633,20 @@ public abstract class Connection {
     * @param extras New connection extras.
     */
    public void setConnectionExtras(Bundle extras) {
        mExtras = extras;
        for (Listener l : mListeners) {
            l.onExtrasChanged(extras);
        }
    }

    /**
     * Retrieves the current connection extras.
     * @return the connection extras.
     */
    public Bundle getConnectionExtras() {
        return mExtras;
    }

    /**
     * Sets the call substate for the current connection and reports the changes to all listeners.
     * Valid call substates are defined in {@link android.telecom.Connection}.
+5 −0
Original line number Diff line number Diff line
@@ -165,6 +165,11 @@ public class ImsPhoneConnection extends Connection {

        updateWifiState();

        // Ensure any extras set on the ImsCallProfile at the start of the call are cached locally
        // in the ImsPhoneConnection.  This isn't going to inform any listeners (since the original
        // connection is not likely to be associated with a TelephonyConnection yet).
        updateExtras(imsCall);

        mParent = parent;
        mParent.attach(this,
                (mIsIncoming? ImsPhoneCall.State.INCOMING: ImsPhoneCall.State.DIALING));