diff options
| author | Yabin Cui <yabinc@google.com> | 2019-01-10 16:24:20 -0800 |
|---|---|---|
| committer | Yabin Cui <yabinc@google.com> | 2019-01-10 16:24:20 -0800 |
| commit | b9fcfc8b98690a4cbcafe6400484c6aca5b8b8a6 (patch) | |
| tree | d8843423d2329a0f0efe96bb4991ef13f661df5b /libpackagelistparser | |
| parent | 37b5edf61b06417d68c58ceb0fb900287fe0433e (diff) | |
| download | system_core-b9fcfc8b98690a4cbcafe6400484c6aca5b8b8a6.tar.gz system_core-b9fcfc8b98690a4cbcafe6400484c6aca5b8b8a6.tar.bz2 system_core-b9fcfc8b98690a4cbcafe6400484c6aca5b8b8a6.zip | |
libpackagelistparser: export profileable_from_shell flag.
Bug: 118835348
Test: test manually on apps that the flag is set properly.
Change-Id: Idd86dca6c7d767be985bb27f4dd3116d79029868
Diffstat (limited to 'libpackagelistparser')
| -rw-r--r-- | libpackagelistparser/include/packagelistparser/packagelistparser.h | 1 | ||||
| -rw-r--r-- | libpackagelistparser/packagelistparser.c | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/libpackagelistparser/include/packagelistparser/packagelistparser.h b/libpackagelistparser/include/packagelistparser/packagelistparser.h index d602c26dc..8bcc1e225 100644 --- a/libpackagelistparser/include/packagelistparser/packagelistparser.h +++ b/libpackagelistparser/include/packagelistparser/packagelistparser.h @@ -53,6 +53,7 @@ struct pkg_info { char *seinfo; gid_list gids; void *private_data; + bool profileable_from_shell; }; /** diff --git a/libpackagelistparser/packagelistparser.c b/libpackagelistparser/packagelistparser.c index 3e1a3d193..4ce2363df 100644 --- a/libpackagelistparser/packagelistparser.c +++ b/libpackagelistparser/packagelistparser.c @@ -223,6 +223,23 @@ extern bool packagelist_parse(pfn_on_package callback, void *userdata) } } + cur = strsep(&next, " \t\r\n"); + if (cur) { + tmp = strtoul(cur, &endptr, 10); + if (*endptr != '\0') { + errmsg = "Could not convert field \"profileable_from_shell\" to integer value"; + goto err; + } + + /* should be a valid boolean of 1 or 0 */ + if (!(tmp == 0 || tmp == 1)) { + errmsg = "Field \"profileable_from_shell\" is not 0 or 1 boolean value"; + goto err; + } + + pkg_info->profileable_from_shell = (bool)tmp; + } + rc = callback(pkg_info, userdata); if (rc == false) { /* |
