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

Commit d6ed1211 authored by Tyler Gunn's avatar Tyler Gunn Committed by Gerrit Code Review
Browse files

Merge "Add workaround for modem issue where pause bit is not set when on hold."

parents 52650f79 65cd1559
Loading
Loading
Loading
Loading
+24 −2
Original line number Diff line number Diff line
@@ -2332,10 +2332,21 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    mPhone.stopOnHoldTone(conn);
                    mOnHoldToneStarted = false;
                }

                conn.onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_UNHELD, null);
            }

            boolean useVideoPauseWorkaround = mPhone.getContext().getResources().getBoolean(
                    com.android.internal.R.bool.config_useVideoPauseWorkaround);
            if (useVideoPauseWorkaround && mSupportPauseVideo &&
                    VideoProfile.isVideo(conn.getVideoState())) {
                // If we are using the video pause workaround, the vendor IMS code has issues
                // with video pause signalling.  In this case, when a call is remotely
                // held, the modem does not reliably change the video state of the call to be
                // paused.
                // As a workaround, we will turn on that bit now.
                conn.changeToUnPausedState();
            }

            SuppServiceNotification supp = new SuppServiceNotification();
            // Type of notification: 0 = MO; 1 = MT
            // Refer SuppServiceNotification class documentation.
@@ -2357,8 +2368,19 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    mOnHoldToneStarted = true;
                    mOnHoldToneId = System.identityHashCode(conn);
                }

                conn.onConnectionEvent(android.telecom.Connection.EVENT_CALL_REMOTELY_HELD, null);

                boolean useVideoPauseWorkaround = mPhone.getContext().getResources().getBoolean(
                        com.android.internal.R.bool.config_useVideoPauseWorkaround);
                if (useVideoPauseWorkaround && mSupportPauseVideo &&
                        VideoProfile.isVideo(conn.getVideoState())) {
                    // If we are using the video pause workaround, the vendor IMS code has issues
                    // with video pause signalling.  In this case, when a call is remotely
                    // held, the modem does not reliably change the video state of the call to be
                    // paused.
                    // As a workaround, we will turn on that bit now.
                    conn.changeToPausedState();
                }
            }

            SuppServiceNotification supp = new SuppServiceNotification();
+22 −4
Original line number Diff line number Diff line
@@ -828,10 +828,7 @@ public class ImsPhoneConnection extends Connection implements
                    }

                    if (!mShouldIgnoreVideoStateChanges) {
                        if (mImsVideoCallProviderWrapper != null) {
                            mImsVideoCallProviderWrapper.onVideoStateChanged(newVideoState);
                        }
                        setVideoState(newVideoState);
                        updateVideoState(newVideoState);
                        changed = true;
                    } else {
                        Rlog.d(LOG_TAG, "updateMediaCapabilities - ignoring video state change " +
@@ -894,6 +891,13 @@ public class ImsPhoneConnection extends Connection implements
        return changed;
    }

    private void updateVideoState(int newVideoState) {
        if (mImsVideoCallProviderWrapper != null) {
            mImsVideoCallProviderWrapper.onVideoStateChanged(newVideoState);
        }
        setVideoState(newVideoState);
    }

    public void sendRttModifyRequest(android.telecom.Connection.RttTextStream textStream) {
        getImsCall().sendRttModifyRequest();
        setCurrentRttTextStream(textStream);
@@ -1175,4 +1179,18 @@ public class ImsPhoneConnection extends Connection implements

        return mImsVideoCallProviderWrapper.wasVideoPausedFromSource(source);
    }

    public void changeToPausedState() {
        int newVideoState = getVideoState() | VideoProfile.STATE_PAUSED;
        Rlog.i(LOG_TAG, "ImsPhoneConnection: changeToPausedState - setting paused bit; "
                + "newVideoState=" + VideoProfile.videoStateToString(newVideoState));
        updateVideoState(newVideoState);
    }

    public void changeToUnPausedState() {
        int newVideoState = getVideoState() & ~VideoProfile.STATE_PAUSED;
        Rlog.i(LOG_TAG, "ImsPhoneConnection: changeToUnPausedState - unsetting paused bit; "
                + "newVideoState=" + VideoProfile.videoStateToString(newVideoState));
        updateVideoState(newVideoState);
    }
}