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

Commit b095866d authored by Ravi Paluri's avatar Ravi Paluri Committed by Gerrit - the friendly Code Review server
Browse files

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

When the device is already in a video call, the user SHOULD NOT
be allowed to change the TTY mode. If the user tries to change,
then an UI alert message will be displayed explaining it cannot
be changed during video calls.

Change-Id: Id7fdeb7d90fbbdf94a6418eb58fd4bf00a5c241c
CRs-Fixed: 734258
parent dca77760
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1979,4 +1979,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;
@@ -1459,6 +1460,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);