Loading src/java/com/android/internal/telephony/satellite/SatelliteController.java +41 −0 Original line number Diff line number Diff line Loading @@ -692,6 +692,7 @@ public class SatelliteController extends Handler { private AtomicBoolean mOverrideNtnEligibility; private String mDefaultSmsPackageName = ""; private String mSatelliteGatewayServicePackageName = ""; private Boolean mOverriddenDisableSatelliteWhileEnableInProgressSupported = null; private final Object mNtnSmsSupportedByMessagesAppLock = new Object(); @GuardedBy("mNtnSmsSupportedByMessagesAppLock") Loading Loading @@ -2503,6 +2504,13 @@ public class SatelliteController extends Handler { SatelliteManager.SATELLITE_RESULT_ENABLE_IN_PROGRESS, result); return; } if (!isDisableSatelliteWhileEnableInProgressSupported()) { plogd("requestSatelliteEnabled: disable satellite while enable in progress" + " is not supported"); sendErrorAndReportSessionMetrics( SatelliteManager.SATELLITE_RESULT_ENABLE_IN_PROGRESS, result); return; } mSatelliteDisabledRequest = request; } } Loading @@ -2523,6 +2531,14 @@ public class SatelliteController extends Handler { } } private boolean isDisableSatelliteWhileEnableInProgressSupported() { if (mOverriddenDisableSatelliteWhileEnableInProgressSupported != null) { return mOverriddenDisableSatelliteWhileEnableInProgressSupported; } return mContext.getResources().getBoolean( R.bool.config_support_disable_satellite_while_enable_in_progress); } private void checkNetworkSelectionModeAuto(RequestSatelliteEnabledArgument argument) { plogd("checkNetworkSelectionModeAuto"); if (argument.isEmergency) { Loading Loading @@ -3587,6 +3603,31 @@ public class SatelliteController extends Handler { return mSatelliteSessionController.setSatelliteIgnoreCellularServiceState(enabled); } /** * This API can be used by only CTS to control the feature * {@code config_support_disable_satellite_while_enable_in_progress}. * * @param reset Whether to reset the override. * @param supported Whether to support the feature. * @return {@code true} if the value is set successfully, {@code false} otherwise. */ public boolean setSupportDisableSatelliteWhileEnableInProgress( boolean reset, boolean supported) { if (!isMockModemAllowed()) { plogd("setSupportDisableSatelliteWhileEnableInProgress: mock modem not allowed"); return false; } plogd("setSupportDisableSatelliteWhileEnableInProgress - reset=" + reset + ", supported=" + supported); if (reset) { mOverriddenDisableSatelliteWhileEnableInProgressSupported = null; } else { mOverriddenDisableSatelliteWhileEnableInProgressSupported = supported; } return true; } /** * This API can be used by only CTS to override timeout durations used by DatagramController * module. Loading tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -643,6 +643,8 @@ public class SatelliteControllerTest extends TelephonyTest { mContextFixture.putIntArrayResource( R.array.config_foldedDeviceStates, new int[0]); mContextFixture.putBooleanResource( R.bool.config_support_disable_satellite_while_enable_in_progress, true); doReturn(ACTIVE_SUB_IDS).when(mMockSubscriptionManagerService).getActiveSubIdList(true); mCarrierConfigBundle = mContextFixture.getCarrierConfigBundle(); Loading Loading @@ -4617,6 +4619,8 @@ public class SatelliteControllerTest extends TelephonyTest { eq(R.string.config_satellite_gateway_service_package)); doReturn("className").when(mResources).getString( eq(R.string.config_satellite_carrier_roaming_esos_provisioned_class)); doReturn(true).when(mResources).getBoolean( eq(R.bool.config_support_disable_satellite_while_enable_in_progress)); } private List<SatelliteSubscriberInfo> getExpectedSatelliteSubscriberInfoList() { Loading Loading
src/java/com/android/internal/telephony/satellite/SatelliteController.java +41 −0 Original line number Diff line number Diff line Loading @@ -692,6 +692,7 @@ public class SatelliteController extends Handler { private AtomicBoolean mOverrideNtnEligibility; private String mDefaultSmsPackageName = ""; private String mSatelliteGatewayServicePackageName = ""; private Boolean mOverriddenDisableSatelliteWhileEnableInProgressSupported = null; private final Object mNtnSmsSupportedByMessagesAppLock = new Object(); @GuardedBy("mNtnSmsSupportedByMessagesAppLock") Loading Loading @@ -2503,6 +2504,13 @@ public class SatelliteController extends Handler { SatelliteManager.SATELLITE_RESULT_ENABLE_IN_PROGRESS, result); return; } if (!isDisableSatelliteWhileEnableInProgressSupported()) { plogd("requestSatelliteEnabled: disable satellite while enable in progress" + " is not supported"); sendErrorAndReportSessionMetrics( SatelliteManager.SATELLITE_RESULT_ENABLE_IN_PROGRESS, result); return; } mSatelliteDisabledRequest = request; } } Loading @@ -2523,6 +2531,14 @@ public class SatelliteController extends Handler { } } private boolean isDisableSatelliteWhileEnableInProgressSupported() { if (mOverriddenDisableSatelliteWhileEnableInProgressSupported != null) { return mOverriddenDisableSatelliteWhileEnableInProgressSupported; } return mContext.getResources().getBoolean( R.bool.config_support_disable_satellite_while_enable_in_progress); } private void checkNetworkSelectionModeAuto(RequestSatelliteEnabledArgument argument) { plogd("checkNetworkSelectionModeAuto"); if (argument.isEmergency) { Loading Loading @@ -3587,6 +3603,31 @@ public class SatelliteController extends Handler { return mSatelliteSessionController.setSatelliteIgnoreCellularServiceState(enabled); } /** * This API can be used by only CTS to control the feature * {@code config_support_disable_satellite_while_enable_in_progress}. * * @param reset Whether to reset the override. * @param supported Whether to support the feature. * @return {@code true} if the value is set successfully, {@code false} otherwise. */ public boolean setSupportDisableSatelliteWhileEnableInProgress( boolean reset, boolean supported) { if (!isMockModemAllowed()) { plogd("setSupportDisableSatelliteWhileEnableInProgress: mock modem not allowed"); return false; } plogd("setSupportDisableSatelliteWhileEnableInProgress - reset=" + reset + ", supported=" + supported); if (reset) { mOverriddenDisableSatelliteWhileEnableInProgressSupported = null; } else { mOverriddenDisableSatelliteWhileEnableInProgressSupported = supported; } return true; } /** * This API can be used by only CTS to override timeout durations used by DatagramController * module. Loading
tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -643,6 +643,8 @@ public class SatelliteControllerTest extends TelephonyTest { mContextFixture.putIntArrayResource( R.array.config_foldedDeviceStates, new int[0]); mContextFixture.putBooleanResource( R.bool.config_support_disable_satellite_while_enable_in_progress, true); doReturn(ACTIVE_SUB_IDS).when(mMockSubscriptionManagerService).getActiveSubIdList(true); mCarrierConfigBundle = mContextFixture.getCarrierConfigBundle(); Loading Loading @@ -4617,6 +4619,8 @@ public class SatelliteControllerTest extends TelephonyTest { eq(R.string.config_satellite_gateway_service_package)); doReturn("className").when(mResources).getString( eq(R.string.config_satellite_carrier_roaming_esos_provisioned_class)); doReturn(true).when(mResources).getBoolean( eq(R.bool.config_support_disable_satellite_while_enable_in_progress)); } private List<SatelliteSubscriberInfo> getExpectedSatelliteSubscriberInfoList() { Loading