Changed output of get-main-user.

It will be just the user id when the device supports it, and "None"
when it doesn't.

Test: adb shell cmd user get-main-user
Fixes: 271295369

Change-Id: I1d4ad4765cddade369ce1d7ce515fe5907d84932
This commit is contained in:
Felipe Leme
2023-03-01 18:50:16 +00:00
parent bc952dca38
commit 695ab4cb7d

View File

@@ -530,10 +530,10 @@ public class UserManagerServiceShellCommand extends ShellCommand {
PrintWriter pw = getOutPrintWriter();
final int mainUserId = mService.getMainUserId();
if (mainUserId == UserHandle.USER_NULL) {
pw.println("Couldn't get main user.");
pw.println("None");
return 1;
}
pw.println("Main user id: " + mainUserId);
pw.println(mainUserId);
return 0;
}