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

Commit 7313e64f authored by Aishwarya Mallampati's avatar Aishwarya Mallampati
Browse files

Replace isInCarrierRoamingNbIotNtn() with

shouldSendSmsToDatagramDispatcher.

Check whether shouldSendSmsToDatagramDispatcher() is true:
- onSmsReceived()
- DatagramDispatcher#shouldPollMtSms

Bug: 378020987
Test: atest DatagramDispatcherTest
Test: Manullay tested SMS/MMS/CALLS/DATA
FLAG: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn

Change-Id: I5eb9c11fe186ec6bab68c4dc261ac5a1ed32ff8b
parent d800f9a2
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -692,13 +692,12 @@ public abstract class InboundSmsHandler extends StateMachine {
        if (mFeatureFlags.carrierRoamingNbIotNtn()) {
            if (result == Intents.RESULT_SMS_HANDLED) {
                SatelliteController satelliteController = SatelliteController.getInstance();
                if (satelliteController == null) {
                    log("SatelliteController is not initialized");
                    return;
                }
                if (satelliteController != null
                        && satelliteController.shouldSendSmsToDatagramDispatcher(mPhone)) {
                    satelliteController.onSmsReceived(mPhone.getSubId());
                }
            }
        }

        // RESULT_OK means that the SMS will be acknowledged by special handling,
        // e.g. for SMS-PP data download. Any other result, we should ack here.
+3 −1
Original line number Diff line number Diff line
@@ -1257,8 +1257,10 @@ public class DatagramDispatcher extends Handler {
    }

    private boolean shouldPollMtSms() {
        SatelliteController satelliteController = SatelliteController.getInstance();
        Phone satellitePhone = satelliteController.getSatellitePhone();
        return isEnabledMtSmsPolling()
                && SatelliteController.getInstance().isInCarrierRoamingNbIotNtn();
                && satelliteController.shouldSendSmsToDatagramDispatcher(satellitePhone);
    }

    @GuardedBy("mLock")
+1 −1
Original line number Diff line number Diff line
@@ -7762,7 +7762,7 @@ public class SatelliteController extends Handler {
    }

    /** Returns whether to send SMS to DatagramDispatcher or not. */
    public boolean shouldSendSmsToDatagramDispatcher(@NonNull Phone phone) {
    public boolean shouldSendSmsToDatagramDispatcher(@Nullable Phone phone) {
        if (!isInCarrierRoamingNbIotNtn(phone)) {
            return false;
        }