Add packageInstaller to packages.list.

This will be used by the profilers.

Bug: 170284829
Change-Id: Ie06da26331a87811d571b4975ab35aa2cfd0ff55
This commit is contained in:
Florian Mayer
2021-04-28 19:48:52 +01:00
parent 6ea939f3bf
commit cd426751d2

View File

@@ -2560,6 +2560,8 @@ public final class Settings implements Watchable, Snappable {
// profileableFromShellFlag - 0 or 1 if the package is profileable from shell.
// longVersionCode - integer version of the package.
// profileable - 0 or 1 if the package is profileable by the platform.
// packageInstaller - the package that installed this app, or @system, @product or
// @null.
//
// NOTE: We prefer not to expose all ApplicationInfo flags for now.
//
@@ -2592,6 +2594,17 @@ public final class Settings implements Watchable, Snappable {
sb.append(pkg.pkg.getLongVersionCode());
sb.append(" ");
sb.append(pkg.pkg.isProfileable() ? "1" : "0");
sb.append(" ");
if (pkg.isSystem()) {
sb.append("@system");
} else if (pkg.isProduct()) {
sb.append("@product");
} else if (pkg.installSource.installerPackageName != null
&& !pkg.installSource.installerPackageName.isEmpty()) {
sb.append(pkg.installSource.installerPackageName);
} else {
sb.append("@null");
}
sb.append("\n");
writer.append(sb);
}