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

Commit 7ad39e83 authored by Jang Hayeong's avatar Jang Hayeong Committed by Sungjae
Browse files

callforwarding: Modify the interface regarding service class



The service class should be delivered as user input
regarding video call forwarding and MMI code(by CSFB SS).
Change parameter order between dialingNumber and serviceClass
in setCallForwardingOption of ImsPhone.
Fix parameter name regarding order for Reason and Action.

Bug: 146531990

Change-Id: I0575de501ebf8490cbcc11a114414e52e7c73ab3
Signed-off-by: default avatarJang Hayeong <hayeong.jang@samsung.com>
parent 873f7ed4
Loading
Loading
Loading
Loading
+24 −5
Original line number Original line Diff line number Diff line
@@ -2020,12 +2020,20 @@ public class GsmCdmaPhone extends Phone {


    @Override
    @Override
    public void getCallForwardingOption(int commandInterfaceCFReason, Message onComplete) {
    public void getCallForwardingOption(int commandInterfaceCFReason, Message onComplete) {
        getCallForwardingOption(commandInterfaceCFReason,
                CommandsInterface.SERVICE_CLASS_VOICE, onComplete);
    }

    @Override
    public void getCallForwardingOption(int commandInterfaceCFReason, int serviceClass,
            Message onComplete) {
        if (isPhoneTypeGsm() || isImsUtEnabledOverCdma()) {
        if (isPhoneTypeGsm() || isImsUtEnabledOverCdma()) {
            Phone imsPhone = mImsPhone;
            Phone imsPhone = mImsPhone;
            if ((imsPhone != null)
            if ((imsPhone != null)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
                    || imsPhone.isUtEnabled())) {
                    || imsPhone.isUtEnabled())) {
                imsPhone.getCallForwardingOption(commandInterfaceCFReason, onComplete);
                imsPhone.getCallForwardingOption(commandInterfaceCFReason, serviceClass,
                        onComplete);
                return;
                return;
            }
            }


@@ -2037,8 +2045,7 @@ public class GsmCdmaPhone extends Phone {
                } else {
                } else {
                    resp = onComplete;
                    resp = onComplete;
                }
                }
                mCi.queryCallForwardStatus(commandInterfaceCFReason,
                mCi.queryCallForwardStatus(commandInterfaceCFReason, serviceClass, null, resp);
                        CommandsInterface.SERVICE_CLASS_VOICE, null, resp);
            }
            }
        } else {
        } else {
            loge("getCallForwardingOption: not possible in CDMA without IMS");
            loge("getCallForwardingOption: not possible in CDMA without IMS");
@@ -2051,13 +2058,25 @@ public class GsmCdmaPhone extends Phone {
            String dialingNumber,
            String dialingNumber,
            int timerSeconds,
            int timerSeconds,
            Message onComplete) {
            Message onComplete) {
        setCallForwardingOption(commandInterfaceCFAction, commandInterfaceCFReason,
                dialingNumber, CommandsInterface.SERVICE_CLASS_VOICE, timerSeconds, onComplete);
    }

    @Override
    public void setCallForwardingOption(int commandInterfaceCFAction,
            int commandInterfaceCFReason,
            String dialingNumber,
            int serviceClass,
            int timerSeconds,
            Message onComplete) {
        if (isPhoneTypeGsm() || isImsUtEnabledOverCdma()) {
        if (isPhoneTypeGsm() || isImsUtEnabledOverCdma()) {
            Phone imsPhone = mImsPhone;
            Phone imsPhone = mImsPhone;
            if ((imsPhone != null)
            if ((imsPhone != null)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
                    || imsPhone.isUtEnabled())) {
                    || imsPhone.isUtEnabled())) {
                imsPhone.setCallForwardingOption(commandInterfaceCFAction,
                imsPhone.setCallForwardingOption(commandInterfaceCFAction,
                        commandInterfaceCFReason, dialingNumber, timerSeconds, onComplete);
                        commandInterfaceCFReason, dialingNumber, serviceClass,
                        timerSeconds, onComplete);
                return;
                return;
            }
            }


@@ -2074,7 +2093,7 @@ public class GsmCdmaPhone extends Phone {
                }
                }
                mCi.setCallForward(commandInterfaceCFAction,
                mCi.setCallForward(commandInterfaceCFAction,
                        commandInterfaceCFReason,
                        commandInterfaceCFReason,
                        CommandsInterface.SERVICE_CLASS_VOICE,
                        serviceClass,
                        dialingNumber,
                        dialingNumber,
                        timerSeconds,
                        timerSeconds,
                        resp);
                        resp);
+41 −1
Original line number Original line Diff line number Diff line
@@ -577,7 +577,7 @@ public interface PhoneInternalInterface {


    /**
    /**
     * getCallForwardingOptions
     * getCallForwardingOptions
     * gets a call forwarding option. The return value of
     * gets a call forwarding option for SERVICE_CLASS_VOICE. The return value of
     * ((AsyncResult)onComplete.obj) is an array of CallForwardInfo.
     * ((AsyncResult)onComplete.obj) is an array of CallForwardInfo.
     *
     *
     * @param commandInterfaceCFReason is one of the valid call forwarding
     * @param commandInterfaceCFReason is one of the valid call forwarding
@@ -589,6 +589,43 @@ public interface PhoneInternalInterface {
    void getCallForwardingOption(int commandInterfaceCFReason,
    void getCallForwardingOption(int commandInterfaceCFReason,
                                  Message onComplete);
                                  Message onComplete);


    /**
     * getCallForwardingOptions
     * gets a call forwarding option. The return value of
     * ((AsyncResult)onComplete.obj) is an array of CallForwardInfo.
     *
     * @param commandInterfaceCFReason is one of the valid call forwarding
     *        CF_REASONS, as defined in
     *        <code>com.android.internal.telephony.CommandsInterface.</code>
     * @param serviceClass is a sum of SERVICE_CLASS_* as defined in
     *        <code>com.android.internal.telephony.CommandsInterface.</code>
     * @param onComplete a callback message when the action is completed.
     *        @see com.android.internal.telephony.CallForwardInfo for details.
     */
    void getCallForwardingOption(int commandInterfaceCFReason, int serviceClass,
                                  Message onComplete);

    /**
     * setCallForwardingOptions
     * sets a call forwarding option for SERVICE_CLASS_VOICE.
     *
     * @param commandInterfaceCFAction is one of the valid call forwarding
     *        CF_ACTIONS, as defined in
     *        <code>com.android.internal.telephony.CommandsInterface.</code>
     * @param commandInterfaceCFReason is one of the valid call forwarding
     *        CF_REASONS, as defined in
     *        <code>com.android.internal.telephony.CommandsInterface.</code>
     * @param dialingNumber is the target phone number to forward calls to
     * @param timerSeconds is used by CFNRy to indicate the timeout before
     *        forwarding is attempted.
     * @param onComplete a callback message when the action is completed.
     */
    void setCallForwardingOption(int commandInterfaceCFAction,
                                 int commandInterfaceCFReason,
                                 String dialingNumber,
                                 int timerSeconds,
                                 Message onComplete);

    /**
    /**
     * setCallForwardingOptions
     * setCallForwardingOptions
     * sets a call forwarding option.
     * sets a call forwarding option.
@@ -600,6 +637,8 @@ public interface PhoneInternalInterface {
     *        CF_REASONS, as defined in
     *        CF_REASONS, as defined in
     *        <code>com.android.internal.telephony.CommandsInterface.</code>
     *        <code>com.android.internal.telephony.CommandsInterface.</code>
     * @param dialingNumber is the target phone number to forward calls to
     * @param dialingNumber is the target phone number to forward calls to
     * @param serviceClass is a sum of SERVICE_CLASS_* as defined in
     *        <code>com.android.internal.telephony.CommandsInterface.</code>
     * @param timerSeconds is used by CFNRy to indicate the timeout before
     * @param timerSeconds is used by CFNRy to indicate the timeout before
     *        forwarding is attempted.
     *        forwarding is attempted.
     * @param onComplete a callback message when the action is completed.
     * @param onComplete a callback message when the action is completed.
@@ -607,6 +646,7 @@ public interface PhoneInternalInterface {
    void setCallForwardingOption(int commandInterfaceCFAction,
    void setCallForwardingOption(int commandInterfaceCFAction,
                                 int commandInterfaceCFReason,
                                 int commandInterfaceCFReason,
                                 String dialingNumber,
                                 String dialingNumber,
                                 int serviceClass,
                                 int timerSeconds,
                                 int timerSeconds,
                                 Message onComplete);
                                 Message onComplete);


+8 −0
Original line number Original line Diff line number Diff line
@@ -1023,6 +1023,13 @@ public class ImsPhone extends ImsPhoneBase {
    @Override
    @Override
    public void getCallForwardingOption(int commandInterfaceCFReason,
    public void getCallForwardingOption(int commandInterfaceCFReason,
            Message onComplete) {
            Message onComplete) {
        getCallForwardingOption(commandInterfaceCFReason,
                SERVICE_CLASS_VOICE, onComplete);
    }

    @Override
    public void getCallForwardingOption(int commandInterfaceCFReason, int serviceClass,
            Message onComplete) {
        if (DBG) logd("getCallForwardingOption reason=" + commandInterfaceCFReason);
        if (DBG) logd("getCallForwardingOption reason=" + commandInterfaceCFReason);
        if (isValidCommandInterfaceCFReason(commandInterfaceCFReason)) {
        if (isValidCommandInterfaceCFReason(commandInterfaceCFReason)) {
            if (DBG) logd("requesting call forwarding query.");
            if (DBG) logd("requesting call forwarding query.");
@@ -1051,6 +1058,7 @@ public class ImsPhone extends ImsPhoneBase {
    }
    }


    @UnsupportedAppUsage
    @UnsupportedAppUsage
    @Override
    public void setCallForwardingOption(int commandInterfaceCFAction,
    public void setCallForwardingOption(int commandInterfaceCFAction,
            int commandInterfaceCFReason,
            int commandInterfaceCFReason,
            String dialingNumber,
            String dialingNumber,
+11 −0
Original line number Original line Diff line number Diff line
@@ -364,12 +364,23 @@ abstract class ImsPhoneBase extends Phone {
    public void getCallForwardingOption(int commandInterfaceCFReason, Message onComplete) {
    public void getCallForwardingOption(int commandInterfaceCFReason, Message onComplete) {
    }
    }


    @Override
    public void getCallForwardingOption(int commandInterfaceCFReason, int serviceClass,
            Message onComplete) {
    }

    @Override
    @Override
    public void setCallForwardingOption(int commandInterfaceCFAction,
    public void setCallForwardingOption(int commandInterfaceCFAction,
            int commandInterfaceCFReason, String dialingNumber,
            int commandInterfaceCFReason, String dialingNumber,
            int timerSeconds, Message onComplete) {
            int timerSeconds, Message onComplete) {
    }
    }


    @Override
    public void setCallForwardingOption(int commandInterfaceCFAction,
            int commandInterfaceCFReason, String dialingNumber, int serviceClass,
            int timerSeconds, Message onComplete) {
    }

    @Override
    @Override
    public void getOutgoingCallerIdDisplay(Message onComplete) {
    public void getOutgoingCallerIdDisplay(Message onComplete) {
        // FIXME: what to reply?
        // FIXME: what to reply?
+1 −1
Original line number Original line Diff line number Diff line
@@ -818,7 +818,7 @@ public final class ImsPhoneMmiCode extends Handler implements MmiCode {
                int time = siToTime(mSic);
                int time = siToTime(mSic);


                if (isInterrogate()) {
                if (isInterrogate()) {
                    mPhone.getCallForwardingOption(reason,
                    mPhone.getCallForwardingOption(reason, serviceClass,
                            obtainMessage(EVENT_QUERY_CF_COMPLETE, this));
                            obtainMessage(EVENT_QUERY_CF_COMPLETE, this));
                } else {
                } else {
                    int cfAction;
                    int cfAction;
Loading