diff options
author | Steven Moreland <smoreland@google.com> | 2019-10-15 14:53:19 -0700 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2019-10-15 14:59:18 -0700 |
commit | 422a758568aa4461ceaf04820d6c16cb7faab4ec (patch) | |
tree | 9347f77188ddb18a3c64d084f23b279f4d681806 /init/interface_utils.cpp | |
parent | f5bad500f33f090a296fe79df5b63a50619339d4 (diff) |
host_init_verifier: use libhidlmetadata
Since it's available in C++, it's easier to build host_init_verifier
with this than create a new way to export the json file.
Bug: 141567104
Test: manually change hidl interface in a manifest
host_init_verifier: system/core/rootdir/init.rc: 69:
host_init_verifier: Interface is not in the known set of hidl_interfaces: 'android.hardwar.edne@1.0::IFoo'. Please ensure the interface is spelled correctly and built by a hidl_interface target.
Change-Id: Ic73dcb51855cb751734bc497d8e69f379966c511
Diffstat (limited to 'init/interface_utils.cpp')
-rw-r--r-- | init/interface_utils.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/init/interface_utils.cpp b/init/interface_utils.cpp index ddbacd763..1b76bba5f 100644 --- a/init/interface_utils.cpp +++ b/init/interface_utils.cpp @@ -21,7 +21,6 @@ #include <android-base/strings.h> #include <hidl-util/FqInstance.h> -#include <json/json.h> using android::FqInstance; using android::FQName; @@ -42,37 +41,6 @@ std::string FQNamesToString(const std::set<FQName>& fqnames) { } // namespace -Result<InterfaceInheritanceHierarchyMap> ReadInterfaceInheritanceHierarchy( - const std::string& path) { - Json::Value root; - Json::Reader reader; - std::ifstream stream(path); - if (!reader.parse(stream, root)) { - return Error() << "Failed to read interface inheritance hierarchy file: " << path << "\n" - << reader.getFormattedErrorMessages(); - } - - InterfaceInheritanceHierarchyMap result; - for (const Json::Value& entry : root) { - std::set<FQName> inherited_interfaces; - for (const Json::Value& intf : entry["inheritedInterfaces"]) { - FQName fqname; - if (!fqname.setTo(intf.asString())) { - return Error() << "Unable to parse interface '" << intf.asString() << "'"; - } - inherited_interfaces.insert(fqname); - } - std::string intf_string = entry["interface"].asString(); - FQName fqname; - if (!fqname.setTo(intf_string)) { - return Error() << "Unable to parse interface '" << intf_string << "'"; - } - result[fqname] = inherited_interfaces; - } - - return result; -} - Result<void> CheckInterfaceInheritanceHierarchy(const std::set<std::string>& instances, const InterfaceInheritanceHierarchyMap& hierarchy) { std::set<FQName> interface_fqnames; |