Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc89b434 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed SystemService.dumpSupportedUsers()"

parents bbd05d76 a7d298d1
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -301,18 +301,21 @@ public abstract class SystemService {
    protected void dumpSupportedUsers(@NonNull PrintWriter pw, @NonNull String prefix) {
        final List<UserInfo> allUsers = UserManager.get(mContext).getUsers();
        final List<Integer> supportedUsers = new ArrayList<>(allUsers.size());
        for (UserInfo user : allUsers) {
        for (int i = 0; i < allUsers.size(); i++) {
            final UserInfo user = allUsers.get(i);
            if (isUserSupported(new TargetUser(user))) {
                supportedUsers.add(user.id);
            }
        if (allUsers.isEmpty()) {
        }
        if (supportedUsers.isEmpty()) {
            pw.print(prefix); pw.println("No supported users");
        } else {
            return;
        }
        final int size = supportedUsers.size();
        pw.print(prefix); pw.print(size); pw.print(" supported user");
        if (size > 1) pw.print("s");
        pw.print(": "); pw.println(supportedUsers);
    }
    }

    /**
     * Called when a new user is starting, for system services to initialize any per-user