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

Commit fdebdebd authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5285806 from ba0b55d4 to pi-qpr3-release

Change-Id: Idb6e4f62cf60d2473f0a898882eaf70dc249afeb
parents be52a390 ba0b55d4
Loading
Loading
Loading
Loading
+21 −4
Original line number Diff line number Diff line
@@ -2654,9 +2654,20 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        @Override
        public void onCallHandover(ImsCall imsCall, int srcAccessTech, int targetAccessTech,
            ImsReasonInfo reasonInfo) {
            // Check with the DCTracker to see if data is enabled; there may be a case when
            // ImsPhoneCallTracker isn't being informed of the right data enabled state via its
            // registration, so we'll refresh now.
            boolean isDataEnabled = mPhone.getDefaultPhone().mDcTracker.isDataEnabled();
            if (DBG) {
                log("onCallHandover ::  srcAccessTech=" + srcAccessTech + ", targetAccessTech=" +
                        targetAccessTech + ", reasonInfo=" + reasonInfo);
                log("onCallHandover ::  srcAccessTech=" + srcAccessTech + ", targetAccessTech="
                        + targetAccessTech + ", reasonInfo=" + reasonInfo + ", dataEnabled="
                        + mIsDataEnabled + "/" + isDataEnabled + ", dataMetered="
                        + mIsViLteDataMetered);
            }
            if (mIsDataEnabled != isDataEnabled) {
                loge("onCallHandover: data enabled state doesn't match! (was=" + mIsDataEnabled
                        + ", actually=" + isDataEnabled);
                mIsDataEnabled = isDataEnabled;
            }

            // Only consider it a valid handover to WIFI if the source radio tech is known.
@@ -2710,6 +2721,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    if (!mIsDataEnabled && mIsViLteDataMetered) {
                        // Call was downgraded from WIFI to LTE and data is metered; downgrade the
                        // call now.
                        log("onCallHandover :: data is not enabled; attempt to downgrade.");
                        downgradeVideoCall(ImsReasonInfo.CODE_WIFI_LOST, conn);
                    }
                }
@@ -3746,16 +3758,21 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            if (conn.hasCapabilities(
                    Connection.Capability.SUPPORTS_DOWNGRADE_TO_VOICE_LOCAL |
                            Connection.Capability.SUPPORTS_DOWNGRADE_TO_VOICE_REMOTE)) {

                log("downgradeVideoCall :: callId=" + conn.getTelecomCallId()
                        + " Downgrade to audio");
                // If the carrier supports downgrading to voice, then we can simply issue a
                // downgrade to voice instead of terminating the call.
                modifyVideoCall(imsCall, VideoProfile.STATE_AUDIO_ONLY);
            } else if (mSupportPauseVideo && reasonCode != ImsReasonInfo.CODE_WIFI_LOST) {
                // The carrier supports video pause signalling, so pause the video if we didn't just
                // lose wifi; in that case just disconnect.
                log("downgradeVideoCall :: callId=" + conn.getTelecomCallId()
                        + " Pause audio");
                mShouldUpdateImsConfigOnDisconnect = true;
                conn.pauseVideo(VideoPauseTracker.SOURCE_DATA_ENABLED);
            } else {
                log("downgradeVideoCall :: callId=" + conn.getTelecomCallId()
                        + " Disconnect call.");
                // At this point the only choice we have is to terminate the call.
                try {
                    imsCall.terminate(ImsReasonInfo.CODE_USER_TERMINATED, reasonCode);
+2 −0
Original line number Diff line number Diff line
@@ -383,6 +383,8 @@ public abstract class TelephonyTest {
        doReturn(mServiceState).when(mPhone).getServiceState();
        doReturn(mServiceState).when(mImsPhone).getServiceState();
        doReturn(mPhone).when(mImsPhone).getDefaultPhone();
        mPhone.mDcTracker = mDcTracker;
        doReturn(true).when(mDcTracker).isDataEnabled();
        doReturn(true).when(mPhone).isPhoneTypeGsm();
        doReturn(PhoneConstants.PHONE_TYPE_GSM).when(mPhone).getPhoneType();
        doReturn(mCT).when(mPhone).getCallTracker();