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

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

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

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

Change-Id: Ie1e32f9adab63b496d4f6b6597d04e355db832c9
parents cca0bc46 89f104be
Loading
Loading
Loading
Loading
+12 −16
Original line number Diff line number Diff line
@@ -2833,9 +2833,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) {
@@ -3173,8 +3172,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
@@ -3190,7 +3187,6 @@ public class GsmCdmaPhone extends Phone {
            }
        }
    }
    }

    /**
     * Retrieves the IccPhoneBookInterfaceManager of the GsmCdmaPhone
+7 −3
Original line number Diff line number Diff line
@@ -1983,10 +1983,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();
    }

    /**
@@ -2000,8 +2001,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
@@ -2014,7 +2018,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;
@@ -1216,10 +1211,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;
@@ -1627,10 +1620,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);
    }
@@ -1656,15 +1647,13 @@ 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(TelephonyResourceUtils.getTelephonyResourceContext(mContext).getText(
                        com.android.telephony.resources.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
@@ -1557,21 +1557,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]);
            }
        }
@@ -1637,10 +1632,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;
@@ -2280,6 +2274,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