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

Commit d0160cd4 authored by joonhunshin's avatar joonhunshin Committed by Joonhun Shin
Browse files

Update to check carrier config

Add condiction when checking for carrier roaming non-terrestrial network connectivity
Add condiction when starting screen off timer

Bug: 360245799
Test: atest SatelliteControllerTest, SatelliteSessionControllerTest
      atest SatelliteManaterTestOnMockService before/after enabling carrier_roaming_nb_iot_ntn
      Completed demo mode test
      Regression test b/370906604
Flag: EXEMPT refactor
Change-Id: Id302e9772a92c407bc298586c3c4683e16db10f7
parent 937f7e25
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -6509,6 +6509,11 @@ public class SatelliteController extends Handler {
        }

        int subId = phone.getSubId();
        if (!isSatelliteRoamingP2pSmSSupported(subId)) {
            plogd("isCarrierRoamingNtnEligible: doesn't support P2P SMS");
            return false;
        }

        if (!isSatelliteSupportedViaCarrier(subId)) {
            plogd("isCarrierRoamingNtnEligible[phoneId=" + phone.getPhoneId()
                    + "]: satellite is not supported via carrier");
+6 −1
Original line number Diff line number Diff line
@@ -1558,8 +1558,13 @@ public class SatelliteSessionController extends StateMachine {
            return;
        }

        if (!mSatelliteController.isInCarrierRoamingNbIotNtn()) {
            logd("registerScreenOnOffChanged: device is not in CarrierRoamingNbIotNtn");
            return;
        }

        if (mSatelliteController.getRequestIsEmergency()) {
            if (DBG) logd("registerScreenOnOffChanged: Emergency mode");
            logd("registerScreenOnOffChanged: not register, device is in Emergency mode");
            // screen on/off timer is available in not emergency mode
            return;
        }
+3 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPOR
import static android.telephony.CarrierConfigManager.KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT;
import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ESOS_SUPPORTED_BOOL;
import static android.telephony.CarrierConfigManager.KEY_SATELLITE_NIDD_APN_NAME_STRING;
import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ROAMING_P2P_SMS_SUPPORTED_BOOL;
import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ROAMING_TURN_OFF_SESSION_FOR_EMERGENCY_CALL_BOOL;
import static android.telephony.NetworkRegistrationInfo.SERVICE_TYPE_DATA;
import static android.telephony.SubscriptionManager.SATELLITE_ENTITLEMENT_STATUS;
@@ -4018,6 +4019,7 @@ public class SatelliteControllerTest extends TelephonyTest {
        when(mServiceState2.getState()).thenReturn(ServiceState.STATE_OUT_OF_SERVICE);
        mCarrierConfigBundle.putBoolean(KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, true);
        mCarrierConfigBundle.putInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT, 1);
        mCarrierConfigBundle.putBoolean(KEY_SATELLITE_ROAMING_P2P_SMS_SUPPORTED_BOOL, true);
        int[] supportedServices2 = {2};
        int[] supportedServices3 = {1, 3};
        PersistableBundle carrierSupportedSatelliteServicesPerProvider = new PersistableBundle();
@@ -4077,6 +4079,7 @@ public class SatelliteControllerTest extends TelephonyTest {
        mCarrierConfigBundle.putInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT, 1);
        mCarrierConfigBundle.putInt(
                KEY_CARRIER_SUPPORTED_SATELLITE_NOTIFICATION_HYSTERESIS_SEC_INT, 1 * 60);
        mCarrierConfigBundle.putBoolean(KEY_SATELLITE_ROAMING_P2P_SMS_SUPPORTED_BOOL, true);
        int[] supportedServices2 = {2};
        int[] supportedServices3 = {1, 3};
        PersistableBundle carrierSupportedSatelliteServicesPerProvider = new PersistableBundle();
+2 −0
Original line number Diff line number Diff line
@@ -216,6 +216,7 @@ public class SatelliteSessionControllerTest extends TelephonyTest {
        bundle.putInt(KEY_SATELLITE_ROAMING_SCREEN_OFF_INACTIVITY_TIMEOUT_SEC_INT,
                SCREEN_OFF_INACTIVITY_TIMEOUT_SEC);
        when(mMockSatelliteController.getPersistableBundle(anyInt())).thenReturn(bundle);
        when(mMockSatelliteController.isInCarrierRoamingNbIotNtn()).thenReturn(true);

        // Since satellite is supported, SatelliteSessionController should move to POWER_OFF state.
        assertNotNull(mTestSatelliteSessionController);
@@ -255,6 +256,7 @@ public class SatelliteSessionControllerTest extends TelephonyTest {
        bundle.putInt(KEY_SATELLITE_ROAMING_SCREEN_OFF_INACTIVITY_TIMEOUT_SEC_INT,
                SCREEN_OFF_INACTIVITY_TIMEOUT_SEC);
        when(mMockSatelliteController.getPersistableBundle(anyInt())).thenReturn(bundle);
        when(mMockSatelliteController.isInCarrierRoamingNbIotNtn()).thenReturn(true);

        // Since satellite is supported, SatelliteSessionController should move to POWER_OFF state.
        assertNotNull(mTestSatelliteSessionController);