am 8e9aca37: am 7ac21204: Merge "Use localized name for guest user" into mnc-dev

* commit '8e9aca37c6045aeffe83f13a0664cb950a7f7fef':
  Use localized name for guest user
This commit is contained in:
Amith Yamasani
2015-07-07 20:54:18 +00:00
committed by Android Git Automerger

View File

@@ -923,11 +923,13 @@ public final class Utils {
* Returns a label for the user, in the form of "User: user name" or "Work profile". * Returns a label for the user, in the form of "User: user name" or "Work profile".
*/ */
public static String getUserLabel(Context context, UserInfo info) { public static String getUserLabel(Context context, UserInfo info) {
String name = info != null ? info.name : null;
if (info.isManagedProfile()) { if (info.isManagedProfile()) {
// We use predefined values for managed profiles // We use predefined values for managed profiles
return context.getString(R.string.managed_user_title); return context.getString(R.string.managed_user_title);
} else if (info.isGuest()) {
name = context.getString(R.string.user_guest);
} }
String name = info != null ? info.name : null;
if (name == null && info != null) { if (name == null && info != null) {
name = Integer.toString(info.id); name = Integer.toString(info.id);
} else if (info == null) { } else if (info == null) {