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

Commit 2c6869cf authored by Basudev Achary Konderpu's avatar Basudev Achary Konderpu Committed by Gerrit - the friendly Code Review server
Browse files

IMS: CLIR support on IMS

1) Now, If CLIR gets triggered from UI,
   request will go through IMS socket based
   on IMS service or UT service availability.
2) Intention behind sending CLIR request on
   Ims Socket is to get cached value from lower.

Change-Id: I966b3b4c563dc8fd196a03d9507c03b4ae45cb8f
CRs-Fixed: 784473
parent 695cf5ab
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1364,12 +1364,27 @@ public class GSMPhone extends PhoneBase {

    @Override
    public void getOutgoingCallerIdDisplay(Message onComplete) {
        ImsPhone imsPhone = mImsPhone;
        if ((imsPhone != null)
                && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE
                || imsPhone.isUtEnabled())) {
            imsPhone.getOutgoingCallerIdDisplay(onComplete);
            return;
        }
        mCi.getCLIR(onComplete);
    }

    @Override
    public void setOutgoingCallerIdDisplay(int commandInterfaceCLIRMode,
                                           Message onComplete) {
        ImsPhone imsPhone = mImsPhone;
        if ((imsPhone != null)
                && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE
                || imsPhone.isUtEnabled())) {
            imsPhone.setOutgoingCallerIdDisplay(commandInterfaceCLIRMode,
            obtainMessage(EVENT_SET_CLIR_COMPLETE, commandInterfaceCLIRMode, 0, onComplete));
            return;
        }
        mCi.setCLIR(commandInterfaceCLIRMode,
                obtainMessage(EVENT_SET_CLIR_COMPLETE, commandInterfaceCLIRMode, 0, onComplete));
    }
+39 −0
Original line number Diff line number Diff line
@@ -99,6 +99,8 @@ public class ImsPhone extends ImsPhoneBase {
    protected static final int EVENT_GET_CALL_BARRING_DONE          = EVENT_LAST + 2;
    protected static final int EVENT_SET_CALL_WAITING_DONE          = EVENT_LAST + 3;
    protected static final int EVENT_GET_CALL_WAITING_DONE          = EVENT_LAST + 4;
    protected static final int EVENT_SET_CLIR_DONE                  = EVENT_LAST + 5;
    protected static final int EVENT_GET_CLIR_DONE                  = EVENT_LAST + 6;

    public static final String CS_FALLBACK = "cs_fallback";

@@ -702,6 +704,33 @@ public class ImsPhone extends ImsPhoneBase {
        return ImsUtInterface.INVALID;
    }

    @Override
    public void getOutgoingCallerIdDisplay(Message onComplete) {
        if (DBG) Rlog.d(LOG_TAG, "getCLIR");
        Message resp;
        resp = obtainMessage(EVENT_GET_CLIR_DONE, onComplete);

        try {
            ImsUtInterface ut = mCT.getUtInterface();
            ut.queryCLIR(resp);
        } catch (ImsException e) {
            sendErrorResponse(onComplete, e);
        }
    }

    @Override
    public void setOutgoingCallerIdDisplay(int clirMode, Message onComplete) {
        if (DBG) Rlog.d(LOG_TAG, "setCLIR action= " + clirMode);
        Message resp;
        resp = obtainMessage(EVENT_SET_CLIR_DONE, onComplete);
        try {
            ImsUtInterface ut = mCT.getUtInterface();
            ut.updateCLIR(clirMode, resp);
        } catch (ImsException e) {
            sendErrorResponse(onComplete, e);
        }
    }

    @Override
    public void getCallForwardingOption(int commandInterfaceCFReason,
            Message onComplete) {
@@ -1231,6 +1260,16 @@ public class ImsPhone extends ImsPhoneBase {
                sendResponse((Message) ar.userObj, ssInfos, ar.exception);
                break;

              case EVENT_GET_CLIR_DONE:
                Bundle ssInfo = (Bundle) ar.result;
                int[] clirInfo = null;
                if (ssInfo != null) {
                    clirInfo = ssInfo.getIntArray(ImsPhoneMmiCode.UT_BUNDLE_KEY_CLIR);
                }
                sendResponse((Message) ar.userObj, clirInfo, ar.exception);
                break;

             case EVENT_SET_CLIR_DONE:
             case EVENT_SET_CALL_BARRING_DONE:
             case EVENT_SET_CALL_WAITING_DONE:
                sendResponse((Message) ar.userObj, null, ar.exception);