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

Commit f5388051 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "callforwarding: Re-arrange call forward indicator" am: 6f004714

Change-Id: Ie86524f9b00d547cf97f11c1d9fa949fc1fa2eef
parents c42e34d4 6f004714
Loading
Loading
Loading
Loading
+12 −16
Original line number Diff line number Diff line
@@ -2797,9 +2797,8 @@ public class GsmCdmaPhone extends Phone {

            case EVENT_SET_CALL_FORWARD_DONE:
                ar = (AsyncResult)msg.obj;
                IccRecords r = mIccRecords.get();
                Cfu cfu = (Cfu) ar.userObj;
                if (ar.exception == null && r != null) {
                if (ar.exception == null) {
                    setVoiceCallForwardingFlag(1, msg.arg1 == 1, cfu.mSetCfNumber);
                }
                if (cfu.mOnComplete != null) {
@@ -3137,8 +3136,6 @@ public class GsmCdmaPhone extends Phone {
    }

    private void handleCfuQueryResult(CallForwardInfo[] infos) {
        IccRecords r = mIccRecords.get();
        if (r != null) {
        if (infos == null || infos.length == 0) {
            // Assume the default is not active
            // Set unconditional CFF in SIM to false
@@ -3154,7 +3151,6 @@ public class GsmCdmaPhone extends Phone {
            }
        }
    }
    }

    /**
     * Retrieves the IccPhoneBookInterfaceManager of the GsmCdmaPhone
+7 −3
Original line number Diff line number Diff line
@@ -1968,10 +1968,11 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {

    public void setVoiceCallForwardingFlag(int line, boolean enable, String number) {
        setCallForwardingIndicatorInSharedPref(enable);
        IccRecords r = mIccRecords.get();
        IccRecords r = getIccRecords();
        if (r != null) {
            r.setVoiceCallForwardingFlag(line, enable, number);
        }
        notifyCallForwardingIndicator();
    }

    /**
@@ -1985,8 +1986,11 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    public void setVoiceCallForwardingFlag(IccRecords r, int line, boolean enable,
                                              String number) {
        setCallForwardingIndicatorInSharedPref(enable);
        if (r != null) {
            r.setVoiceCallForwardingFlag(line, enable, number);
        }
        notifyCallForwardingIndicator();
    }

    /**
     * Get voice call forwarding indicator status. No change notification
@@ -1999,7 +2003,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
            Rlog.e(LOG_TAG, "getCallForwardingIndicator: not possible in CDMA");
            return false;
        }
        IccRecords r = mIccRecords.get();
        IccRecords r = getIccRecords();
        int callForwardingIndicator = IccRecords.CALL_FORWARDING_STATUS_UNKNOWN;
        if (r != null) {
            callForwardingIndicator = r.getVoiceCallForwardingFlag();
+5 −16
Original line number Diff line number Diff line
@@ -380,12 +380,7 @@ public final class GsmMmiCode extends Handler implements MmiCode {
                            isServiceClassVoiceorNone(ssData.serviceClass));

                    Rlog.d(LOG_TAG, "setVoiceCallForwardingFlag cffEnabled: " + cffEnabled);
                    if (mIccRecords != null) {
                    mPhone.setVoiceCallForwardingFlag(1, cffEnabled, null);
                        Rlog.d(LOG_TAG, "setVoiceCallForwardingFlag done from SS Info.");
                    } else {
                        Rlog.e(LOG_TAG, "setVoiceCallForwardingFlag aborted. sim records is null.");
                    }
                }
                onSetComplete(null, new AsyncResult(null, ssData.cfInfo, ex));
                break;
@@ -1209,10 +1204,8 @@ public final class GsmMmiCode extends Handler implements MmiCode {
                */
                if ((ar.exception == null) && (msg.arg1 == 1)) {
                    boolean cffEnabled = (msg.arg2 == 1);
                    if (mIccRecords != null) {
                    mPhone.setVoiceCallForwardingFlag(1, cffEnabled, mDialingNumber);
                }
                }

                onSetComplete(msg, ar);
                break;
@@ -1585,10 +1578,8 @@ public final class GsmMmiCode extends Handler implements MmiCode {
                (info.serviceClass & serviceClassMask)
                        == CommandsInterface.SERVICE_CLASS_VOICE) {
            boolean cffEnabled = (info.status == 1);
            if (mIccRecords != null) {
            mPhone.setVoiceCallForwardingFlag(1, cffEnabled, info.number);
        }
        }

        return TextUtils.replace(template, sources, destinations);
    }
@@ -1614,14 +1605,12 @@ public final class GsmMmiCode extends Handler implements MmiCode {

            infos = (CallForwardInfo[]) ar.result;

            if (infos.length == 0) {
            if (infos == null || infos.length == 0) {
                // Assume the default is not active
                sb.append(mContext.getText(com.android.internal.R.string.serviceDisabled));

                // Set unconditional CFF in SIM to false
                if (mIccRecords != null) {
                mPhone.setVoiceCallForwardingFlag(1, false, null);
                }
            } else {

                SpannableStringBuilder tb = new SpannableStringBuilder();
+11 −13
Original line number Diff line number Diff line
@@ -1569,21 +1569,16 @@ public class ImsPhone extends ImsPhoneBase {
            cfInfos = new CallForwardInfo[infos.length];
        }

        IccRecords r = mDefaultPhone.getIccRecords();
        if (infos == null || infos.length == 0) {
            if (r != null) {
            // Assume the default is not active
            // Set unconditional CFF in SIM to false
                setVoiceCallForwardingFlag(r, 1, false, null);
            }
            setVoiceCallForwardingFlag(getIccRecords(), 1, false, null);
        } else {
            for (int i = 0, s = infos.length; i < s; i++) {
                if (infos[i].getCondition() == ImsUtInterface.CDIV_CF_UNCONDITIONAL) {
                    if (r != null) {
                        setVoiceCallForwardingFlag(r, 1, (infos[i].getStatus() == 1),
                    setVoiceCallForwardingFlag(getIccRecords(), 1, (infos[i].getStatus() == 1),
                        infos[i].getNumber());
                }
                }
                cfInfos[i] = getCallForwardInfo(infos[i]);
            }
        }
@@ -1649,10 +1644,9 @@ public class ImsPhone extends ImsPhoneBase {
        if (DBG) logd("handleMessage what=" + msg.what);
        switch (msg.what) {
            case EVENT_SET_CALL_FORWARD_DONE:
                IccRecords r = mDefaultPhone.getIccRecords();
                Cf cf = (Cf) ar.userObj;
                if (cf.mIsCfu && ar.exception == null && r != null) {
                    setVoiceCallForwardingFlag(r, 1, msg.arg1 == 1, cf.mSetCfNumber);
                if (cf.mIsCfu && ar.exception == null) {
                    setVoiceCallForwardingFlag(getIccRecords(), 1, msg.arg1 == 1, cf.mSetCfNumber);
                }
                sendResponse(cf.mOnComplete, null, ar.exception);
                break;
@@ -2291,6 +2285,10 @@ public class ImsPhone extends ImsPhoneBase {
        }
    };

    public IccRecords getIccRecords() {
        return mDefaultPhone.getIccRecords();
    }

    @Override
    public void dump(FileDescriptor fd, PrintWriter printWriter, String[] args) {
        IndentingPrintWriter pw = new IndentingPrintWriter(printWriter, "  ");
+0 −5
Original line number Diff line number Diff line
@@ -167,11 +167,6 @@ abstract class ImsPhoneBase extends Phone {
        return false;
    }

    @Override
    public boolean getCallForwardingIndicator() {
        return false;
    }

    @Override
    public List<? extends MmiCode> getPendingMmiCodes() {
        return new ArrayList<MmiCode>(0);
Loading