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

Commit e55be25f authored by Haiyang Liu's avatar Haiyang Liu
Browse files

Keyguard: Add config for showing emergency call only

Add a config item config_showEmergencyCallOnlyInLockScreen to
control whether show "Emergency call only" tips on lock screen
or not.

Change-Id: Ib113ab200bd47fe657d2c64554f69ee623614359
CRs-Fixed: 653516
parent f4c9c223
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,4 +37,5 @@

    <!-- monitor locale change -->
    <bool name="config_monitor_locale_change">false</bool>
    <bool name="config_showEmergencyCallOnlyInLockScreen">false</bool>
</resources>
+9 −1
Original line number Diff line number Diff line
@@ -1009,8 +1009,16 @@ public class KeyguardUpdateMonitor {
    private CharSequence getTelephonyPlmnFrom(Intent intent) {
        if (intent.getBooleanExtra(TelephonyIntents.EXTRA_SHOW_PLMN, false)) {
            final String plmn = intent.getStringExtra(TelephonyIntents.EXTRA_PLMN);
            String strEmergencyCallOnly = mContext.getResources().getText(
                    com.android.internal.R.string.emergency_calls_only).toString();
            if (mContext.getResources().getBoolean(
                    R.bool.config_showEmergencyCallOnlyInLockScreen)
                && plmn.equalsIgnoreCase(strEmergencyCallOnly)) {
                    return getDefaultPlmn();
            } else {
                return (plmn != null) ? plmn : getDefaultPlmn();
            }
        }
        return null;
    }