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

Commit a7d298d1 authored by Felipe Leme's avatar Felipe Leme
Browse files

Fixed SystemService.dumpSupportedUsers()

It was not filtering out unsupported users.

Bug: 203885212
Test: adb shell dumpsys autofill|grep supported # on automotive

Change-Id: I692d1e24d327b4e400c79f05c88bb158b60b0244
parent 8b3ef5ab
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