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

Commit 1e077be1 authored by Brad Ebinger's avatar Brad Ebinger Committed by Android (Google) Code Review
Browse files

Merge "Enable MO SMS during ECBM when on LTE" into pi-dev

parents c7107f09 127f5f22
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
@@ -73,8 +73,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
@@ -106,8 +106,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.
     *