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

Commit 9a4b9030 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "IMS-VT: Do not allow changing the TTY mode during a Video call"

parents 2b30225d b095866d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1985,4 +1985,6 @@ public interface Phone {
     * @param lchStatus, true if call is in lch state
     */
    public void setLocalCallHold(int lchStatus);

    public boolean isImsVtCallPresent();
}
+26 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import com.android.ims.ImsManager;
import com.android.internal.R;
import com.android.internal.telephony.dataconnection.DcTrackerBase;
import com.android.internal.telephony.imsphone.ImsPhone;
import com.android.internal.telephony.imsphone.ImsPhoneConnection;
import com.android.internal.telephony.test.SimulatedRadioControl;
import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType;
import com.android.internal.telephony.uicc.IccFileHandler;
@@ -1462,6 +1463,31 @@ public abstract class PhoneBase extends Handler implements Phone {
        return false;
    }

    public static int getVideoState(Call call) {
        int videoState = VideoProfile.VideoState.AUDIO_ONLY;
        ImsPhoneConnection conn = (ImsPhoneConnection) call.getEarliestConnection();
        if (conn != null) {
            videoState = conn.getVideoState();
        }
        return videoState;
    }

    private boolean isImsVideoCall(Call call) {
        int videoState = getVideoState(call);
        return (VideoProfile.VideoState.isVideo(videoState));
    }

    public boolean isImsVtCallPresent() {
        boolean isVideoCallActive = false;
        if (mImsPhone != null) {
            isVideoCallActive = isImsVideoCall(mImsPhone.getForegroundCall()) ||
                    isImsVideoCall(mImsPhone.getBackgroundCall()) ||
                    isImsVideoCall(mImsPhone.getRingingCall());
        }
        Rlog.d(LOG_TAG, "isVideoCallActive: " + isVideoCallActive);
        return isVideoCallActive;
    }

    @Override
    public abstract int getPhoneType();

+4 −0
Original line number Diff line number Diff line
@@ -302,6 +302,10 @@ public class PhoneProxy extends Handler implements Phone {
        return ((PhoneBase)mActivePhone).getIccFileHandler();
    }

    public boolean isImsVtCallPresent() {
        return mActivePhone.isImsVtCallPresent();
    }

    @Override
    public void updatePhoneObject(int voiceRadioTech) {
        logd("updatePhoneObject: radioTechnology=" + voiceRadioTech);