@@ -43,7 +43,6 @@ class KeyguardMessageArea extends TextView {
4343
4444 static final int SECURITY_MESSAGE_DURATION = 5000 ;
4545 protected static final int FADE_DURATION = 750 ;
46- static final String SEPARATOR = " " ;
4746
4847 // are we showing battery information?
4948 boolean mShowingBatteryInfo = false ;
@@ -143,6 +142,8 @@ public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) {
143142 }
144143 };
145144
145+ private CharSequence mSeparator ;
146+
146147 public KeyguardMessageArea (Context context ) {
147148 this (context , null );
148149 }
@@ -158,6 +159,8 @@ public KeyguardMessageArea(Context context, AttributeSet attrs) {
158159 mUpdateMonitor .registerCallback (mInfoCallback );
159160 mHandler = new Handler (Looper .myLooper ());
160161
162+ mSeparator = getResources ().getString (R .string .kg_text_message_separator );
163+
161164 update ();
162165 }
163166
@@ -186,23 +189,23 @@ void update() {
186189 setText (status );
187190 }
188191
189-
190- private CharSequence concat (Object ... args ) {
192+ private CharSequence concat (CharSequence ... args ) {
191193 StringBuilder b = new StringBuilder ();
192- for (int i = 0 ; i < args .length ; i ++) {
193- final Object arg = args [i ];
194- if (arg instanceof CharSequence ) {
195- b .append ((CharSequence )args [i ]);
196- b .append (SEPARATOR );
197- } else if (arg instanceof String ) {
198- b .append ((String )args [i ]);
199- b .append (SEPARATOR );
194+ if (!TextUtils .isEmpty (args [0 ])) {
195+ b .append (args [0 ]);
196+ }
197+ for (int i = 1 ; i < args .length ; i ++) {
198+ CharSequence text = args [i ];
199+ if (!TextUtils .isEmpty (text )) {
200+ if (b .length () > 0 ) {
201+ b .append (mSeparator );
202+ }
203+ b .append (text );
200204 }
201205 }
202206 return b .toString ();
203207 }
204208
205-
206209 CharSequence getCurrentMessage () {
207210 return mShowingMessage ? mMessage : null ;
208211 }
0 commit comments