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

Commit b4adc62b authored by Winson's avatar Winson
Browse files

Print minExtensionVersions to Settings package dump

This is necessary to assert on the value inside a host side CTS test.

Output is formatted like an array of pairs:
    minExtensionVersions=[30=0,31=1]

Bug: 187110971

Test: TODO, will not be merged yet, see bug

Change-Id: Ie609b36100940671915052e9f8fe5ab9a8e56761
parent 9ebad8e1
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -4439,7 +4439,23 @@ public final class Settings implements Watchable, Snappable {
        pw.print(prefix); pw.print("  versionCode="); pw.print(ps.versionCode);
        if (pkg != null) {
            pw.print(" minSdk="); pw.print(pkg.getMinSdkVersion());
            pw.print(" targetSdk="); pw.print(pkg.getTargetSdkVersion());
            pw.print(" targetSdk="); pw.println(pkg.getTargetSdkVersion());

            SparseIntArray minExtensionVersions = pkg.getMinExtensionVersions();

            pw.print(prefix); pw.print("  minExtensionVersions=[");
            if (minExtensionVersions != null) {
                List<String> minExtVerStrings = new ArrayList<>();
                int size = minExtensionVersions.size();
                for (int index = 0; index < size; index++) {
                    int key = minExtensionVersions.keyAt(index);
                    int value = minExtensionVersions.valueAt(index);
                    minExtVerStrings.add(key + "=" + value);
                }

                pw.print(TextUtils.join(", ", minExtVerStrings));
            }
            pw.print("]");
        }
        pw.println();
        if (pkg != null) {