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

Commit 08efc5f6 authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Merge "Do not remove local video capabilities for Wifi call when mobile data is off"

am: 87182edc

Change-Id: I60fc5e4d4e2f7af6fa42625810419bd1a93f0066
parents 0fdc0ee4 87182edc
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -2782,7 +2782,15 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    }
                    }
                }
                }


                if (isHandoverToWifi && mIsViLteDataMetered) {
                    conn.setLocalVideoCapable(true);
                }

                if (isHandoverFromWifi && imsCall.isVideoCall()) {
                if (isHandoverFromWifi && imsCall.isVideoCall()) {
                    if (mIsViLteDataMetered) {
                        conn.setLocalVideoCapable(mIsDataEnabled);
                    }

                    if (mNotifyHandoverVideoFromWifiToLTE &&    mIsDataEnabled) {
                    if (mNotifyHandoverVideoFromWifiToLTE &&    mIsDataEnabled) {
                        if (conn.getDisconnectCause() == DisconnectCause.NOT_DISCONNECTED) {
                        if (conn.getDisconnectCause() == DisconnectCause.NOT_DISCONNECTED) {
                            log("onCallHandover :: notifying of WIFI to LTE handover.");
                            log("onCallHandover :: notifying of WIFI to LTE handover.");
@@ -3768,7 +3776,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        // Inform connections that data has been disabled to ensure we turn off video capability
        // Inform connections that data has been disabled to ensure we turn off video capability
        // if this is an LTE call.
        // if this is an LTE call.
        for (ImsPhoneConnection conn : mConnections) {
        for (ImsPhoneConnection conn : mConnections) {
            conn.handleDataEnabledChange(enabled);
            ImsCall imsCall = conn.getImsCall();
            boolean isLocalVideoCapable = enabled || (imsCall != null && imsCall.isWifiCall());
            conn.setLocalVideoCapable(isLocalVideoCapable);
        }
        }


        int reasonCode;
        int reasonCode;
+5 −5
Original line number Original line Diff line number Diff line
@@ -121,7 +121,7 @@ public class ImsPhoneConnection extends Connection implements
     * currently available, but mobile data is off and the carrier is metering data for video
     * currently available, but mobile data is off and the carrier is metering data for video
     * calls.
     * calls.
     */
     */
    private boolean mIsVideoEnabled = true;
    private boolean mIsLocalVideoCapable = true;


    //***** Event Constants
    //***** Event Constants
    private static final int EVENT_DTMF_DONE = 1;
    private static final int EVENT_DTMF_DONE = 1;
@@ -264,7 +264,7 @@ public class ImsPhoneConnection extends Connection implements
        capabilities = removeCapability(capabilities,
        capabilities = removeCapability(capabilities,
                Connection.Capability.SUPPORTS_VT_LOCAL_BIDIRECTIONAL);
                Connection.Capability.SUPPORTS_VT_LOCAL_BIDIRECTIONAL);


        if (!mIsVideoEnabled) {
        if (!mIsLocalVideoCapable) {
            Rlog.i(LOG_TAG, "applyLocalCallCapabilities - disabling video (overidden)");
            Rlog.i(LOG_TAG, "applyLocalCallCapabilities - disabling video (overidden)");
            return capabilities;
            return capabilities;
        }
        }
@@ -1355,9 +1355,9 @@ public class ImsPhoneConnection extends Connection implements
        mShouldIgnoreVideoStateChanges = false;
        mShouldIgnoreVideoStateChanges = false;
    }
    }


    public void handleDataEnabledChange(boolean isDataEnabled) {
    public void setLocalVideoCapable(boolean isVideoEnabled) {
        mIsVideoEnabled = isDataEnabled;
        mIsLocalVideoCapable = isVideoEnabled;
        Rlog.i(LOG_TAG, "handleDataEnabledChange: isDataEnabled=" + isDataEnabled
        Rlog.i(LOG_TAG, "setLocalVideoCapable: mIsLocalVideoCapable = " + mIsLocalVideoCapable
                + "; updating local video availability.");
                + "; updating local video availability.");
        updateMediaCapabilities(getImsCall());
        updateMediaCapabilities(getImsCall());
    }
    }