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

Commit dbe94262 authored by Eric Rahm's avatar Eric Rahm
Browse files

Fix outpput of dumpsys package

`dumpsys package` intends to print user state attributes as one line and
then additional install state with additional indentation on new lines.
In ag/24359877 we added an additional quarantine user state that ended
up getting prefixed to the install reason line:

User 0: ceDataInode=1919 ...
 quarantined=false      installReason=0
    firstInstallTime=2023-08-04 15:14:41
    uninstallReason=0

This led to CTS failures where the tests depended on the output of `adb
shell dumpsys package`, in particular anything using `bedstead` with
instant apps.

This change restores the proper line separation and splits out the code
with a comment to help avoid breaking the output again in the future:

User 0: ceDataInode=1919 ... quarantined=false
    installReason=0
    firstInstallTime=2023-08-04 15:14:41
    uninstallReason=0

Fixes: 286970682
Test: atest --instant CtsContentTestCases:android.content.cts.ContentProviderTest
Change-Id: I4359fccba2d03cc9e1c1cca45bcaa87d2de75905
parent af3eb24f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -5186,9 +5186,12 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
            pw.print(" instant=");
            pw.print(userState.isInstantApp());
            pw.print(" virtual=");
            pw.println(userState.isVirtualPreload());
            pw.print(userState.isVirtualPreload());
            pw.print(" quarantined=");
            pw.print(userState.isQuarantined());

            // Dump install state with additional indentation on their own lines.
            pw.println();
            pw.print("      installReason=");
            pw.println(userState.getInstallReason());