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

Commit 481414fe authored by Adam Bookatz's avatar Adam Bookatz Committed by Android (Google) Code Review
Browse files

Merge "Improve dumpsys user readability"

parents 6eb73fa2 71a0307d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4699,6 +4699,7 @@ public class UserManagerService extends IUserManager.Stub {
            pw.println("N/A");
        }

        pw.println();
        StringBuilder sb = new StringBuilder();
        synchronized (mPackagesLock) {
            synchronized (mUsersLock) {
@@ -4786,6 +4787,7 @@ public class UserManagerService extends IUserManager.Stub {
                }
            }
            pw.println();
            pw.println("Device properties:");
            pw.println("  Device owner id:" + mDeviceOwnerUserId);
            pw.println();
            pw.println("  Guest restrictions:");
@@ -4822,7 +4824,7 @@ public class UserManagerService extends IUserManager.Stub {
        pw.println("User types (" + mUserTypes.size() + " types):");
        for (int i = 0; i < mUserTypes.size(); i++) {
            pw.println("    " + mUserTypes.keyAt(i) + ": ");
            mUserTypes.valueAt(i).dump(pw);
            mUserTypes.valueAt(i).dump(pw, "        ");
        }

        // Dump package whitelist
+5 −5
Original line number Diff line number Diff line
@@ -271,8 +271,7 @@ public final class UserTypeDetails {
    }

    /** Dumps details of the UserTypeDetails. Do not parse this. */
    public void dump(PrintWriter pw) {
        final String prefix = "        ";
    public void dump(PrintWriter pw, String prefix) {
        pw.print(prefix); pw.print("mName: "); pw.println(mName);
        pw.print(prefix); pw.print("mBaseType: "); pw.println(UserInfo.flagsToString(mBaseType));
        pw.print(prefix); pw.print("mEnabled: "); pw.println(mEnabled);
@@ -282,6 +281,7 @@ public final class UserTypeDetails {
        pw.println(UserInfo.flagsToString(mDefaultUserInfoPropertyFlags));
        pw.print(prefix); pw.print("mLabel: "); pw.println(mLabel);

        final String restrictionsPrefix = prefix + "    ";
        if (isSystem()) {
            pw.print(prefix); pw.println("config_defaultFirstUserRestrictions: ");
            try {
@@ -293,13 +293,13 @@ public final class UserTypeDetails {
                        restrictions.putBoolean(userRestriction, true);
                    }
                }
                UserRestrictionsUtils.dumpRestrictions(pw, prefix + "    ", restrictions);
                UserRestrictionsUtils.dumpRestrictions(pw, restrictionsPrefix, restrictions);
            } catch (Resources.NotFoundException e) {
                pw.print(prefix); pw.println("    none - resource not found");
                pw.print(restrictionsPrefix); pw.println("none - resource not found");
            }
        } else {
            pw.print(prefix); pw.println("mDefaultRestrictions: ");
            UserRestrictionsUtils.dumpRestrictions(pw, prefix + "    ", mDefaultRestrictions);
            UserRestrictionsUtils.dumpRestrictions(pw, restrictionsPrefix, mDefaultRestrictions);
        }

        pw.print(prefix); pw.print("mIconBadge: "); pw.println(mIconBadge);