summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author Thomas Nguyen <tnd@google.com> 2025-03-18 13:38:20 -0700
committer Thomas Nguyen <tnd@google.com> 2025-03-18 13:38:20 -0700
commit3f3c3062cd7108a211ed4bdc9667811f412c2269 (patch)
tree0bccd5a1f68ff58f261abf8cca78a18a45f36a93 /src
parentd3414f5e683a3d9eb4942052a029c267956437bc (diff)
Don't send disable request to modem when enable is in progress if device does not support this feature
Flag: EXEMPT bugfix Bug: 396157049 Test: SatelliteManagerTestOnMockService SatelliteControllerTest Manual system tests Change-Id: I3eb0acbd9ad9b6330b5742b213ee0fc7f52cab74
Diffstat (limited to 'src')
-rw-r--r--src/java/com/android/internal/telephony/satellite/SatelliteController.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/java/com/android/internal/telephony/satellite/SatelliteController.java b/src/java/com/android/internal/telephony/satellite/SatelliteController.java
index 93d222b512..07286e045f 100644
--- a/src/java/com/android/internal/telephony/satellite/SatelliteController.java
+++ b/src/java/com/android/internal/telephony/satellite/SatelliteController.java
@@ -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")
@@ -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;
}
}
@@ -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) {
@@ -3588,6 +3604,31 @@ public class SatelliteController extends Handler {
}
/**
+ * 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.
*