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

Commit 7c7ebb5e authored by pengfeix's avatar pengfeix Committed by Hall Liu
Browse files

IMS: Add CF and CW support over CDMA-IMS

-Introduce CDMA-over-IMS support for (two) supplementary services
(call forwarding and call waiting)
-Call Forwarding and call waiting MMI codes are not supported.

Bug: 38401219
Change-Id: Ia96061ddc13002d87ca39eb17e38d190acdb5cc1
parent 6ca66f59
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -1730,9 +1730,15 @@ public class GsmCdmaPhone extends Phone {
        return (action == CF_ACTION_ENABLE) || (action == CF_ACTION_REGISTRATION);
    }

    private boolean isImsUtEnabledOverCdma() {
        return isPhoneTypeCdmaLte()
            && mImsPhone != null
            && mImsPhone.isUtEnabled();
    }

    @Override
    public void getCallForwardingOption(int commandInterfaceCFReason, Message onComplete) {
        if (isPhoneTypeGsm()) {
        if (isPhoneTypeGsm() || isImsUtEnabledOverCdma()) {
            Phone imsPhone = mImsPhone;
            if ((imsPhone != null)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
@@ -1753,7 +1759,7 @@ public class GsmCdmaPhone extends Phone {
                        CommandsInterface.SERVICE_CLASS_VOICE, null, resp);
            }
        } else {
            loge("getCallForwardingOption: not possible in CDMA");
            loge("getCallForwardingOption: not possible in CDMA without IMS");
        }
    }

@@ -1763,7 +1769,7 @@ public class GsmCdmaPhone extends Phone {
            String dialingNumber,
            int timerSeconds,
            Message onComplete) {
        if (isPhoneTypeGsm()) {
        if (isPhoneTypeGsm() || isImsUtEnabledOverCdma()) {
            Phone imsPhone = mImsPhone;
            if ((imsPhone != null)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
@@ -1792,7 +1798,7 @@ public class GsmCdmaPhone extends Phone {
                        resp);
            }
        } else {
            loge("setCallForwardingOption: not possible in CDMA");
            loge("setCallForwardingOption: not possible in CDMA without IMS");
        }
    }

@@ -1885,7 +1891,7 @@ public class GsmCdmaPhone extends Phone {

    @Override
    public void getCallWaiting(Message onComplete) {
        if (isPhoneTypeGsm()) {
        if (isPhoneTypeGsm() || isImsUtEnabledOverCdma()) {
            Phone imsPhone = mImsPhone;
            if ((imsPhone != null)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
@@ -1904,7 +1910,7 @@ public class GsmCdmaPhone extends Phone {

    @Override
    public void setCallWaiting(boolean enable, Message onComplete) {
        if (isPhoneTypeGsm()) {
        if (isPhoneTypeGsm() || isImsUtEnabledOverCdma()) {
            Phone imsPhone = mImsPhone;
            if ((imsPhone != null)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
@@ -1915,7 +1921,7 @@ public class GsmCdmaPhone extends Phone {

            mCi.setCallWaiting(enable, CommandsInterface.SERVICE_CLASS_VOICE, onComplete);
        } else {
            loge("method setCallWaiting is NOT supported in CDMA!");
            loge("method setCallWaiting is NOT supported in CDMA without IMS!");
        }
    }