Bidi wrap keyboard names before displaying them.
This is needed because keyboard names can contain characters from mixed locale. Without Bidi wrapping the labels will be garbled and not readable. Change-Id: I47668a65d7bef8828ad0424097834929ec12700d Fix: 37353900 Test: make RunSettingsRoboTests
This commit is contained in:
@@ -20,6 +20,7 @@ import android.app.admin.DevicePolicyManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.text.BidiFormatter;
|
||||
import android.view.inputmethod.InputMethodInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
@@ -76,12 +77,15 @@ public class VirtualKeyboardPreferenceController extends PreferenceController {
|
||||
return;
|
||||
}
|
||||
|
||||
final BidiFormatter bidiFormatter = BidiFormatter.getInstance();
|
||||
|
||||
String summary = null;
|
||||
for (String label : labels) {
|
||||
if (summary == null) {
|
||||
summary = label;
|
||||
summary = bidiFormatter.unicodeWrap(label);
|
||||
} else {
|
||||
summary = mContext.getString(R.string.join_many_items_middle, summary, label);
|
||||
summary = mContext.getString(R.string.join_many_items_middle, summary,
|
||||
bidiFormatter.unicodeWrap(label));
|
||||
}
|
||||
}
|
||||
preference.setSummary(summary);
|
||||
|
Reference in New Issue
Block a user