you will be asked to unlock your phone using an email account.\n\n
Try again in <xliff:g id="number">%d</xliff:g> seconds.
</string>
+ <!-- Sequence of characters used to separate message strings in keyguard. Typically just em-dash
+ with spaces on either side. [CHAR LIMIT=3] -->
+ <string name="kg_text_message_separator" product="default"> \u2014 </string>
<!-- Message shown in dialog when user is attempting to set the music volume above the
recommended maximum level for headphones -->
<java-symbol type="string" name="kg_failed_attempts_almost_at_login" />
<java-symbol type="string" name="kg_enter_confirm_pin_hint" />
<java-symbol type="string" name="kg_invalid_confirm_pin_hint" />
+ <java-symbol type="string" name="kg_text_message_separator" />
<!-- From services -->
<java-symbol type="anim" name="screen_rotate_0_enter" />
import com.android.internal.widget.LockPatternUtils;
public class CarrierText extends TextView {
+ private static CharSequence mSeparator;
+
private LockPatternUtils mLockPatternUtils;
private KeyguardUpdateMonitorCallback mCallback = new KeyguardUpdateMonitorCallback() {
@Override
protected void onFinishInflate() {
super.onFinishInflate();
+ mSeparator = getResources().getString(R.string.kg_text_message_separator);
KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mCallback);
setSelected(true); // Allow marquee to work.
}
final boolean plmnValid = !TextUtils.isEmpty(plmn);
final boolean spnValid = !TextUtils.isEmpty(spn);
if (plmnValid && spnValid) {
- return plmn + "|" + spn;
+ return new StringBuilder().append(plmn).append(mSeparator).append(spn).toString();
} else if (plmnValid) {
return plmn;
} else if (spnValid) {
static final int SECURITY_MESSAGE_DURATION = 5000;
protected static final int FADE_DURATION = 750;
- static final String SEPARATOR = " ";
// are we showing battery information?
boolean mShowingBatteryInfo = false;
}
};
+ private CharSequence mSeparator;
+
public KeyguardMessageArea(Context context) {
this(context, null);
}
mUpdateMonitor.registerCallback(mInfoCallback);
mHandler = new Handler(Looper.myLooper());
+ mSeparator = getResources().getString(R.string.kg_text_message_separator);
+
update();
}
setText(status);
}
-
- private CharSequence concat(Object... args) {
+ private CharSequence concat(CharSequence... args) {
StringBuilder b = new StringBuilder();
- for (int i = 0; i < args.length; i++) {
- final Object arg = args[i];
- if (arg instanceof CharSequence) {
- b.append((CharSequence)args[i]);
- b.append(SEPARATOR);
- } else if (arg instanceof String) {
- b.append((String)args[i]);
- b.append(SEPARATOR);
+ if (!TextUtils.isEmpty(args[0])) {
+ b.append(args[0]);
+ }
+ for (int i = 1; i < args.length; i++) {
+ CharSequence text = args[i];
+ if (!TextUtils.isEmpty(text)) {
+ if (b.length() > 0) {
+ b.append(mSeparator);
+ }
+ b.append(text);
}
}
return b.toString();
}
-
CharSequence getCurrentMessage() {
return mShowingMessage ? mMessage : null;
}