Add user type to 'user list -v' output

Shows the user type in the verbose user list.

For convenient readability, the phrase 'android.os.usertype.' is
stripped from the output. So, e.g.,
type=android.os.usertype.full.GUEST
will appear as
type=full.GUEST

Test: adb shell cmd user list -v
Change-Id: I87b03b74c8ca2d83a609822597b3c80a178827be
This commit is contained in:
Adam Bookatz
2021-08-03 11:25:45 -07:00
parent 567fe7b464
commit 607dc521fa

View File

@@ -5071,8 +5071,11 @@ public class UserManagerService extends IUserManager.Stub {
Binder.restoreCallingIdentity(ident);
}
}
pw.printf("%d: id=%d, name=%s, flags=%s%s%s%s%s%s%s%s%s\n", i, user.id,
pw.printf("%d: id=%d, name=%s, type=%s, flags=%s%s%s%s%s%s%s%s%s\n",
i,
user.id,
user.name,
user.userType.replace("android.os.usertype.", ""),
UserInfo.flagsToString(user.flags),
hasParent ? " (parentId=" + user.profileGroupId + ")" : "",
running ? " (running)" : "",