Add in-service wait timer config for ECC dialed in APM
When emergency call is dialed in airplane mode, telephony must turn
radio power on and start the emergency call. In previous solution, modem
starts network search when radio power is turned on. However, we found
another modem's behavior that it doesn't start network search when
radio power is turned on for emergency call. For this type of modem,
APDS shouldn't wait for modem to get in-service state, and should start
the right away. To support both type of modem, new configuration is
added. If the in-service wait timer value is 0, APDS won't wait for
modem to get in-service.
Flag: EXEMPT bugfix
Bug: 372376726
Test: atest PhoneGlobalsTest TelephonyConnectionServiceTest
Test: Manual test
1. Dialing ECC in APM.
2. Verify that APDS waits for modem to get in-service state up to the
time configured.
Change-Id: I190d60fe3026eade1d4d1f0e2d92201ce42f9c81
diff --git a/res/values/config.xml b/res/values/config.xml
index 847c4c5..03da05b 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -394,4 +394,10 @@
<!-- Whether to turn off OEM-enabled satellite during emergency call -->
<bool name="config_turn_off_oem_enabled_satellite_during_emergency_call">false</bool>
+
+ <!-- The timeout duration in milliseconds used to determine how long does it wait for modem to
+ get in-service state when dialing emergency routing emergency calls in airplane mode before
+ starting the call. If the value is 0, it doesn't wait and starts the call right after
+ turning radio power on. -->
+ <integer name="config_in_service_wait_timer_when_dialing_emergency_routing_ecc_in_apm">3000</integer>
</resources>
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index dcddf2b..bab260c 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -571,8 +571,10 @@
// Initialize EmergencyStateTracker if domain selection is supported
boolean isSuplDdsSwitchRequiredForEmergencyCall = getResources()
.getBoolean(R.bool.config_gnss_supl_requires_default_data_for_emergency);
+ int inServiceWaitTimeWhenDialEccInApm = getResources().getInteger(R.integer
+ .config_in_service_wait_timer_when_dialing_emergency_routing_ecc_in_apm);
EmergencyStateTracker.make(this, isSuplDdsSwitchRequiredForEmergencyCall,
- mFeatureFlags);
+ inServiceWaitTimeWhenDialEccInApm, mFeatureFlags);
DynamicRoutingController.getInstance().initialize(this);
}