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

Commit 25dc0e20 authored by Brad Ebinger's avatar Brad Ebinger Committed by Gerrit Code Review
Browse files

Merge "Enable MO SMS during ECBM when on LTE"

parents 46719a0b 185b90de
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -247,8 +247,10 @@ public class ImsSmsDispatcher extends SMSDispatcher {
    }

    @Override
    protected boolean shouldBlockSms() {
        return SMSDispatcherUtil.shouldBlockSms(isCdmaMo(), mPhone);
    protected boolean shouldBlockSmsForEcbm() {
        // We should not block outgoing SMS during ECM on IMS. It only applies to outgoing CDMA
        // SMS.
        return false;
    }

    @Override
+3 −3
Original line number Diff line number Diff line
@@ -628,7 +628,7 @@ public abstract class SMSDispatcher extends Handler {
     * Send an SMS PDU. Usually just calls {@link sendRawPdu}.
     */
    private void sendSubmitPdu(SmsTracker tracker) {
        if (shouldBlockSms()) {
        if (shouldBlockSmsForEcbm()) {
            Rlog.d(TAG, "Block SMS in Emergency Callback mode");
            tracker.onFailed(mContext, SmsManager.RESULT_ERROR_NO_SERVICE, 0/*errorCode*/);
        } else {
@@ -637,9 +637,9 @@ public abstract class SMSDispatcher extends Handler {
    }

    /**
     * @return true if MO SMS should be blocked.
     * @return true if MO SMS should be blocked for Emergency Callback Mode.
     */
    protected abstract boolean shouldBlockSms();
    protected abstract boolean shouldBlockSmsForEcbm();

    /**
     * Called when SMS send completes. Broadcasts a sentIntent on success.
+3 −2
Original line number Diff line number Diff line
@@ -68,8 +68,9 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
    }

    @Override
    protected boolean shouldBlockSms() {
        return SMSDispatcherUtil.shouldBlockSms(isCdmaMo(), mPhone);
    protected boolean shouldBlockSmsForEcbm() {
        // We only block outgoing SMS during ECBM when using CDMA.
        return mPhone.isInEcm() && isCdmaMo() && !isIms();
    }

    @Override
+3 −2
Original line number Diff line number Diff line
@@ -101,8 +101,9 @@ public final class GsmSMSDispatcher extends SMSDispatcher {
    }

    @Override
    protected boolean shouldBlockSms() {
        return SMSDispatcherUtil.shouldBlockSms(isCdmaMo(), mPhone);
    protected boolean shouldBlockSmsForEcbm() {
        // There is no such thing as ECBM for GSM. This only applies to CDMA.
        return false;
    }

    @Override
+0 −11
Original line number Diff line number Diff line
@@ -35,17 +35,6 @@ public final class SMSDispatcherUtil {
    // Prevent instantiation.
    private SMSDispatcherUtil() {}

    /**
     * Whether to block SMS or not.
     *
     * @param isCdma true if cdma format should be used.
     * @param phone the Phone to use
     * @return true to block sms; false otherwise.
     */
    public static boolean shouldBlockSms(boolean isCdma, Phone phone) {
        return isCdma && phone.isInEcm();
    }

    /**
     * Trigger the proper implementation for getting submit pdu for text sms based on format.
     *