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

Commit 3ac411db authored by Hall Liu's avatar Hall Liu
Browse files

RTT bugfixes, part 5

* Add support for properly setting the ImsStreamMediaProfile's RTT flag
when answering an incoming call
* Add logging

Bug: 72648661
Bug: 72762206
Test: manual, with telecom testapp dialer over the network
Change-Id: I93dfa217b9bf004e95919c3dded8a59cbb14b57e
Merged-In: I93dfa217b9bf004e95919c3dded8a59cbb14b57e
parent ddc08749
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2127,6 +2127,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            }
            ImsPhoneConnection conn = findConnection(imsCall);
            if (conn != null) {
                if (DBG) log("onCallUpdated: profile is " + imsCall.getCallProfile());
                processCallStateChange(imsCall, conn.getCall().mState,
                        DisconnectCause.NOT_DISCONNECTED, true /*ignore state update*/);
                mMetrics.writeImsCallState(mPhone.getPhoneId(),
+9 −3
Original line number Diff line number Diff line
@@ -105,6 +105,8 @@ public class ImsPhoneConnection extends Connection implements

    private ImsRttTextHandler mRttTextHandler;
    private android.telecom.Connection.RttTextStream mRttTextStream;
    // This reflects the RTT status as reported to us by the IMS stack via the media profile.
    private boolean mIsRttEnabledForCall = false;

    /**
     * Used to indicate that this call is in the midst of being merged into a conference.
@@ -893,15 +895,15 @@ public class ImsPhoneConnection extends Connection implements
                }

                if (negotiatedCallProfile.mMediaProfile != null) {
                    boolean isRttOn = negotiatedCallProfile.mMediaProfile.isRttCall();
                    mIsRttEnabledForCall = negotiatedCallProfile.mMediaProfile.isRttCall();

                    if (isRttOn && mRttTextHandler == null) {
                    if (mIsRttEnabledForCall && mRttTextHandler == null) {
                        Rlog.d(LOG_TAG, "updateMediaCapabilities -- turning RTT on, profile="
                                + negotiatedCallProfile);
                        startRttTextProcessing();
                        onRttInitiated();
                        changed = true;
                    } else if (!isRttOn && mRttTextHandler != null) {
                    } else if (!mIsRttEnabledForCall && mRttTextHandler != null) {
                        Rlog.d(LOG_TAG, "updateMediaCapabilities -- turning RTT off, profile="
                                + negotiatedCallProfile);
                        mRttTextHandler.tearDown();
@@ -1001,6 +1003,10 @@ public class ImsPhoneConnection extends Connection implements
        return mRttTextStream != null;
    }

    public boolean isRttEnabledForCall() {
        return mIsRttEnabledForCall;
    }

    public void startRttTextProcessing() {
        if (mRttTextStream == null) {
            Rlog.w(LOG_TAG, "startRttTextProcessing: no RTT text stream. Ignoring.");
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ public class ImsRttTextHandler extends Handler {
    // limiter. msg.arg1 should be set to N.
    private static final int EXPIRE_SENT_CODEPOINT_COUNT = 5;
    // Indicates that the call is over and we should teardown everything we have set up.
    private static final int TEARDOWN = 6;
    private static final int TEARDOWN = 9999;

    private Connection.RttTextStream mRttTextStream;
    // For synchronization during testing