installd support for profman --dump-info-for
Bug: 28748264
Change-Id: Idcd3ed86294c1d0c75c26ca938b88744a25e387a
diff --git a/cmds/installd/installd.cpp b/cmds/installd/installd.cpp
index e8fce91..061359e 100644
--- a/cmds/installd/installd.cpp
+++ b/cmds/installd/installd.cpp
@@ -282,6 +282,19 @@
return 0;
}
+static int do_dump_profiles(char **arg, char reply[REPLY_MAX])
+{
+ uid_t uid = static_cast<uid_t>(atoi(arg[0]));
+ const char* pkgname = arg[1];
+ const char* dex_files = arg[2];
+ if (dump_profile(uid, pkgname, dex_files)) {
+ strncpy(reply, "true", REPLY_MAX);
+ } else {
+ strncpy(reply, "false", REPLY_MAX);
+ }
+ return 0;
+}
+
static int do_mark_boot_complete(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED)
{
return mark_boot_complete(arg[0] /* instruction set */);
@@ -428,6 +441,7 @@
{ "linkfile", 3, do_link_file },
{ "move_ab", 3, do_move_ab },
{ "merge_profiles", 2, do_merge_profiles },
+ { "dump_profiles", 3, do_dump_profiles },
};
static int readx(int s, void *_buf, int count)