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

Commit a247762f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Put SIM locked text in parenthesis" into qt-dev

parents 46f1b094 2fb343af
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -112,6 +112,8 @@
         whether it is valid, and to unlock the sim if it is valid.  we display a
         progress dialog in the meantime.  this is the emssage. -->
    <string name="keyguard_sim_unlock_progress_dialog_message">Unlocking SIM card\u2026</string>
    <!-- Composes together the carrier name and the SIM card locked message. Example: CarrierName (SIM LOCKED) -->
    <string name="keyguard_carrier_name_with_sim_locked_template" translatable="false"><xliff:g id="carrier">%s</xliff:g> (<xliff:g id="message">%s</xliff:g>)</string>

    <!-- Time format strings for fall-back clock widget -->
    <string name="keyguard_widget_12_hours_format" translatable="false">h:mm</string>
+22 −2
Original line number Diff line number Diff line
@@ -481,13 +481,13 @@ public class CarrierTextController {
                break;

            case SimLocked:
                carrierText = makeCarrierStringOnEmergencyCapable(
                carrierText = makeCarrierStringOnLocked(
                        getContext().getText(R.string.keyguard_sim_locked_message),
                        text);
                break;

            case SimPukLocked:
                carrierText = makeCarrierStringOnEmergencyCapable(
                carrierText = makeCarrierStringOnLocked(
                        getContext().getText(R.string.keyguard_sim_puk_locked_message),
                        text);
                break;
@@ -515,6 +515,26 @@ public class CarrierTextController {
        return simMessage;
    }

    /*
     * Add "SIM card is locked" in parenthesis after carrier name, so it is easily associated in
     * DSDS
     */
    private CharSequence makeCarrierStringOnLocked(CharSequence simMessage,
            CharSequence carrierName) {
        final boolean simMessageValid = !TextUtils.isEmpty(simMessage);
        final boolean carrierNameValid = !TextUtils.isEmpty(carrierName);
        if (simMessageValid && carrierNameValid) {
            return mContext.getString(R.string.keyguard_carrier_name_with_sim_locked_template,
                    carrierName, simMessage);
        } else if (simMessageValid) {
            return simMessage;
        } else if (carrierNameValid) {
            return carrierName;
        } else {
            return "";
        }
    }

    /**
     * Determine the current status of the lock screen given the SIM state and other stuff.
     */