diff options
Diffstat (limited to 'ManifestHal.cpp')
-rw-r--r-- | ManifestHal.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ManifestHal.cpp b/ManifestHal.cpp index c0f4c8e..2d0e246 100644 --- a/ManifestHal.cpp +++ b/ManifestHal.cpp | |||
@@ -51,15 +51,20 @@ bool ManifestHal::operator==(const ManifestHal &other) const { | |||
51 | bool ManifestHal::forEachInstance(const std::function<bool(const ManifestInstance&)>& func) const { | 51 | bool ManifestHal::forEachInstance(const std::function<bool(const ManifestInstance&)>& func) const { |
52 | for (const auto& v : versions) { | 52 | for (const auto& v : versions) { |
53 | for (const auto& intf : iterateValues(interfaces)) { | 53 | for (const auto& intf : iterateValues(interfaces)) { |
54 | for (const auto& instance : intf.instances) { | 54 | bool cont = intf.forEachInstance([&](const auto& interface, const auto& instance, |
55 | bool /* isRegex */) { | ||
55 | // TODO(b/73556059): Store ManifestInstance as well to avoid creating temps | 56 | // TODO(b/73556059): Store ManifestInstance as well to avoid creating temps |
56 | FqInstance fqInstance; | 57 | FqInstance fqInstance; |
57 | if (fqInstance.setTo(getName(), v.majorVer, v.minorVer, intf.name, instance)) { | 58 | if (fqInstance.setTo(getName(), v.majorVer, v.minorVer, interface, instance)) { |
58 | if (!func(ManifestInstance(std::move(fqInstance), TransportArch{transportArch}, | 59 | if (!func(ManifestInstance(std::move(fqInstance), TransportArch{transportArch}, |
59 | format))) { | 60 | format))) { |
60 | return false; | 61 | return false; |
61 | } | 62 | } |
62 | } | 63 | } |
64 | return true; | ||
65 | }); | ||
66 | if (!cont) { | ||
67 | return false; | ||
63 | } | 68 | } |
64 | } | 69 | } |
65 | } | 70 | } |
@@ -135,5 +140,12 @@ bool ManifestHal::insertInstances(const std::set<FqInstance>& fqInstances, std:: | |||
135 | return true; | 140 | return true; |
136 | } | 141 | } |
137 | 142 | ||
143 | void ManifestHal::insertLegacyInstance(const std::string& interface, const std::string& instance) { | ||
144 | auto it = interfaces.find(interface); | ||
145 | if (it == interfaces.end()) | ||
146 | it = interfaces.emplace(interface, HalInterface{interface, {}}).first; | ||
147 | it->second.insertInstance(instance, false /* isRegex */); | ||
148 | } | ||
149 | |||
138 | } // namespace vintf | 150 | } // namespace vintf |
139 | } // namespace android | 151 | } // namespace android |