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

Commit afdab527 authored by Sangyun Yun's avatar Sangyun Yun
Browse files

Consider provisioning and disallow reasons only with nb iot

Bug: 380387958
Test: Manally tested Satellite
FLAG: EXEMPT bugfix
Change-Id: I5a9d7bb1d65ad4fe31a34958c77fc9723c74d5d7
parent 32dcb50f
Loading
Loading
Loading
Loading
+5 −17
Original line number Diff line number Diff line
@@ -287,10 +287,6 @@ public class SatelliteSOSMessageRecommender extends Handler {

    private void handleEmergencyCallStartedEvent(@NonNull Connection connection) {
        plogd("handleEmergencyCallStartedEvent: connection=" + connection);
        if (!updateAndGetProvisionState() || !isSatelliteAllowedByReasons()) {
            plogd("handleEmergencyCallStartedEvent: not ready to handle emergency call start");
            return;
        }
        mSatelliteController.setLastEmergencyCallTime();

        if (sendEventDisplayEmergencyMessageForcefully(connection)) {
@@ -337,11 +333,7 @@ public class SatelliteSOSMessageRecommender extends Handler {
                return;
            }

            if (!updateAndGetProvisionState() || !isSatelliteAllowedByReasons()) {
                plogd("evaluateSendingConnectionEventDisplayEmergencyMessage: "
                        + "not ready to use satellite.");
                return;
            }
            updateAndGetProvisionState();

            /*
             * The device might be connected to satellite after the emergency call started. Thus, we
@@ -354,7 +346,7 @@ public class SatelliteSOSMessageRecommender extends Handler {
            boolean isCellularAvailable = SatelliteServiceUtils.isCellularAvailable();
            if (!isCellularAvailable
                    && isSatelliteAllowed()
                    && (isDeviceProvisioned()
                    && ((isDeviceProvisioned() && isSatelliteAllowedByReasons())
                    || isSatelliteConnectedViaCarrierWithinHysteresisTime())
                    && shouldTrackCall(mEmergencyConnection.getState())) {
                plogd("handleTimeoutEvent: Sent EVENT_DISPLAY_EMERGENCY_MESSAGE to Dialer");
@@ -409,12 +401,6 @@ public class SatelliteSOSMessageRecommender extends Handler {
            return;
        }

        if (!updateAndGetProvisionState() || !isSatelliteAllowedByReasons()) {
            plogd("handleEmergencyCallConnectionStateChangedEvent: not ready to use satellite.");
            cleanUpResources(false);
            return;
        }

        String callId = arg.first;
        int state = arg.second;
        if (!mEmergencyConnection.getTelecomCallId().equals(callId)) {
@@ -776,7 +762,9 @@ public class SatelliteSOSMessageRecommender extends Handler {

    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    public int getEmergencyCallToSatelliteHandoverType() {
        if (Flags.carrierRoamingNbIotNtn() && isDeviceProvisioned()
        if (Flags.carrierRoamingNbIotNtn()
                && isDeviceProvisioned()
                && isSatelliteAllowedByReasons()
                && isSatelliteConnectedViaCarrierWithinHysteresisTime()) {
            int satelliteSubId = mSatelliteController.getSelectedSatelliteSubId();
            return mSatelliteController.getCarrierRoamingNtnEmergencyCallToSatelliteHandoverType(