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

Commit a066b0dd authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Keyguard: Replace "Emergency" to "Emergency call""

parents 6a306bfe e9b89c11
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -399,4 +399,5 @@ number">%d</xliff:g> remaining attempt before SIM becomes permanently unusable.
number">%d</xliff:g> remaining attempts before SIM becomes permanently unusable. Contact carrier for details.</item>
    </plurals>

    <string name="button_lockscreen_emergency_call">Emergency call</string>
</resources>
+18 −1
Original line number Diff line number Diff line
@@ -76,6 +76,10 @@ public class EmergencyButton extends Button {

    private final boolean mIsVoiceCapable;
    private final boolean mEnableEmergencyCallWhileSimLocked;
    private final boolean mIsCarrierSupported = isCarrierOneSupported();

    public static final String PROPERTY_RADIO_ATEL_CARRIER = "persist.radio.atel.carrier";
    public static final String CARRIER_ONE_DEFAULT_MCC_MNC = "405854";

    public EmergencyButton(Context context) {
        this(context, null);
@@ -172,9 +176,14 @@ public class EmergencyButton extends Button {
            int textId;
            if (isInCall()) {
                textId = com.android.internal.R.string.lockscreen_return_to_call;
            } else {
                if (mIsCarrierSupported) {
                    // Text "Emergency call"
                    textId = R.string.button_lockscreen_emergency_call;
                } else {
                    textId = com.android.internal.R.string.lockscreen_emergency_call;
                }
            }
            setText(textId);
        } else {
            setVisibility(View.GONE);
@@ -202,4 +211,12 @@ public class EmergencyButton extends Button {
    private TelecomManager getTelecommManager() {
        return (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE);
    }

    /**
     * Check is carrier one supported or not
     */
    public static boolean isCarrierOneSupported() {
        String property = SystemProperties.get(PROPERTY_RADIO_ATEL_CARRIER);
        return CARRIER_ONE_DEFAULT_MCC_MNC.equals(property);
    }
}