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

Commit 289be7a2 authored by Treehugger Robot's avatar Treehugger Robot
Browse files

Merge "callforwarding: Modify the interface regarding service class" am: fc53c155

Change-Id: Iabfc75e429d9f13e13143424a54ee28535646d12
parents 3fedb2e7 fc53c155
Loading
Loading
Loading
Loading
+24 −5
Original line number Diff line number Diff line
@@ -2020,12 +2020,20 @@ public class GsmCdmaPhone extends Phone {

    @Override
    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()) {
            Phone imsPhone = mImsPhone;
            if ((imsPhone != null)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
                    || imsPhone.isUtEnabled())) {
                imsPhone.getCallForwardingOption(commandInterfaceCFReason, onComplete);
                imsPhone.getCallForwardingOption(commandInterfaceCFReason, serviceClass,
                        onComplete);
                return;
            }

@@ -2037,8 +2045,7 @@ public class GsmCdmaPhone extends Phone {
                } else {
                    resp = onComplete;
                }
                mCi.queryCallForwardStatus(commandInterfaceCFReason,
                        CommandsInterface.SERVICE_CLASS_VOICE, null, resp);
                mCi.queryCallForwardStatus(commandInterfaceCFReason, serviceClass, null, resp);
            }
        } else {
            loge("getCallForwardingOption: not possible in CDMA without IMS");
@@ -2051,13 +2058,25 @@ public class GsmCdmaPhone extends Phone {
            String dialingNumber,
            int timerSeconds,
            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()) {
            Phone imsPhone = mImsPhone;
            if ((imsPhone != null)
                    && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)
                    || imsPhone.isUtEnabled())) {
                imsPhone.setCallForwardingOption(commandInterfaceCFAction,
                        commandInterfaceCFReason, dialingNumber, timerSeconds, onComplete);
                        commandInterfaceCFReason, dialingNumber, serviceClass,
                        timerSeconds, onComplete);
                return;
            }

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

    /**
     * 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.
     *
     * @param commandInterfaceCFReason is one of the valid call forwarding
@@ -592,6 +592,43 @@ public interface PhoneInternalInterface {
    void getCallForwardingOption(int commandInterfaceCFReason,
                                  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
     * sets a call forwarding option.
@@ -603,6 +640,8 @@ public interface PhoneInternalInterface {
     *        CF_REASONS, as defined in
     *        <code>com.android.internal.telephony.CommandsInterface.</code>
     * @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
     *        forwarding is attempted.
     * @param onComplete a callback message when the action is completed.
@@ -610,6 +649,7 @@ public interface PhoneInternalInterface {
    void setCallForwardingOption(int commandInterfaceCFAction,
                                 int commandInterfaceCFReason,
                                 String dialingNumber,
                                 int serviceClass,
                                 int timerSeconds,
                                 Message onComplete);

+8 −0
Original line number Diff line number Diff line
@@ -1023,6 +1023,13 @@ public class ImsPhone extends ImsPhoneBase {
    @Override
    public void getCallForwardingOption(int commandInterfaceCFReason,
            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 (isValidCommandInterfaceCFReason(commandInterfaceCFReason)) {
            if (DBG) logd("requesting call forwarding query.");
@@ -1051,6 +1058,7 @@ public class ImsPhone extends ImsPhoneBase {
    }

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

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

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

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

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

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