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

Commit 42580f0d authored by Ashit Sood's avatar Ashit Sood
Browse files

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

- When we get a notification that mobile data has been enabled/disabled
  we notify the connections of the change

- Remove video capability only for LTE calls when mobile data change is
  reported to ImsPhoneConnection

Test: Manual
Bug: 70292536
Change-Id: I78cb34b0def3d3150804b6e2ece12b3dbd94b10f
parent a93fdf36
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -2694,7 +2694,15 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    }
                }

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

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

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

        int reasonCode;
+5 −5
Original line number 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
     * calls.
     */
    private boolean mIsVideoEnabled = true;
    private boolean mIsLocalVideoCapable = true;

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

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

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