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

Commit 71a0307d authored by Adam Bookatz's avatar Adam Bookatz
Browse files

Improve dumpsys user readability

The tabbing had some minor issues; fixed here.

Test: look at bugreport's dumpsys user section (adb shell dumpsys user)
Change-Id: Ib5cf166048cbdadc7b84f3ff58284100f12bcec0
parent 75301c4b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4698,6 +4698,7 @@ public class UserManagerService extends IUserManager.Stub {
            pw.println("N/A");
        }

        pw.println();
        StringBuilder sb = new StringBuilder();
        synchronized (mPackagesLock) {
            synchronized (mUsersLock) {
@@ -4785,6 +4786,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:");
@@ -4821,7 +4823,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);