diff options
author | Daniel Norman <danielnorman@google.com> | 2019-06-27 12:18:08 -0700 |
---|---|---|
committer | Daniel Norman <danielnorman@google.com> | 2019-06-28 13:31:54 -0700 |
commit | 3df8dc58b2b5b1f60d45793e6a7c1f51a2fd2383 (patch) | |
tree | a888e3b89fc5abe85c0c2f9f7352f7f10424ced2 /init/service_parser.h | |
parent | c4117afdc9144e925bfb663d25c15a16b0700842 (diff) |
Checks each interface in an init_rc file is a known hidl_interface.
Test: Adding a misspelling to an init_rc's interface line and observing
build failure.
Bug: 77646540
Change-Id: I58f66d73f0bd9b4203e8259161843b56ad428d73
Diffstat (limited to 'init/service_parser.h')
-rw-r--r-- | init/service_parser.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/init/service_parser.h b/init/service_parser.h index 0a5b29114..5a1676803 100644 --- a/init/service_parser.h +++ b/init/service_parser.h @@ -28,8 +28,12 @@ namespace init { class ServiceParser : public SectionParser { public: - ServiceParser(ServiceList* service_list, std::vector<Subcontext>* subcontexts) - : service_list_(service_list), subcontexts_(subcontexts), service_(nullptr) {} + ServiceParser(ServiceList* service_list, std::vector<Subcontext>* subcontexts, + const std::optional<std::set<std::string>>& known_interfaces) + : service_list_(service_list), + subcontexts_(subcontexts), + known_interfaces_(known_interfaces), + service_(nullptr) {} Result<void> ParseSection(std::vector<std::string>&& args, const std::string& filename, int line) override; Result<void> ParseLineSection(std::vector<std::string>&& args, int line) override; @@ -81,6 +85,7 @@ class ServiceParser : public SectionParser { ServiceList* service_list_; std::vector<Subcontext>* subcontexts_; + std::optional<std::set<std::string>> known_interfaces_; std::unique_ptr<Service> service_; std::string filename_; }; |