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

Commit 9c430a4d authored by Wink Saville's avatar Wink Saville
Browse files

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
parent 0c5a2697
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -642,10 +642,13 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
                    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;