Only show "Emergency calls only" if a GSM device is voice capable.
This fix uses the config_voice_capable compile time switch to be
sure GsmServiceStateTracker.mEmergencyOnly is false if the device
isn't voice capable. Thus GsmServiceStateTracker.updateSpnDisplay
will not send the SPN_STRINGS_UPDATED_ACTION intent with
emergency_calls_only as the PLMN. Instead, it will aways be the
string defined by the lockscreen_carrier_default, typically
"No service".
Bug: 9422921
Change-Id: I74e89c4a29d0d8e3d5cc1726adedb0c2634cf257
diff --git a/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index 1ce08c3..acb4972 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -642,10 +642,13 @@
mNewSS.setState(regCodeToServiceState(regState));
mNewSS.setRilVoiceRadioTechnology(type);
- if (regState == ServiceState.RIL_REG_STATE_DENIED_EMERGENCY_CALL_ENABLED
+ boolean isVoiceCapable = mPhoneBase.getContext().getResources()
+ .getBoolean(com.android.internal.R.bool.config_voice_capable);
+ if ((regState == ServiceState.RIL_REG_STATE_DENIED_EMERGENCY_CALL_ENABLED
|| regState == ServiceState.RIL_REG_STATE_NOT_REG_EMERGENCY_CALL_ENABLED
|| regState == ServiceState.RIL_REG_STATE_SEARCHING_EMERGENCY_CALL_ENABLED
- || regState == ServiceState.RIL_REG_STATE_UNKNOWN_EMERGENCY_CALL_ENABLED) {
+ || regState == ServiceState.RIL_REG_STATE_UNKNOWN_EMERGENCY_CALL_ENABLED)
+ && isVoiceCapable) {
mEmergencyOnly = true;
} else {
mEmergencyOnly = false;