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

Commit 8868af26 authored by Joonhun Shin's avatar Joonhun Shin Committed by Android (Google) Code Review
Browse files

Merge "Update to check carrier config" into main

parents 9b5c7475 d0160cd4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -6612,6 +6612,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;
@@ -4019,6 +4020,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();
@@ -4078,6 +4080,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);