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

Commit 185b90de authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Enable MO SMS during ECBM when on LTE

W should allow MO SMS during ECBM when we are on LTE.
We will now only blockMO SMS when on ECBM and
CDMA radio tech.

Bug: 77223987
Test: Manual, MO SMS during ECBM on CDMA and LTE
Merged-In: I14326c1ae9c3f0ae485aaffe03b34f8a8a64994c
Change-Id: If2ab62881e0564c05e0f13cc82502d645a0a6250
parent 46719a0b
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.
     *