summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2023-01-12 14:55:55 -0800
committerYifan Hong <elsk@google.com>2023-01-12 14:55:55 -0800
commitcb5a1abe2d29f426edc59b09c37487bee91e2d85 (patch)
tree6bbe33321bebbfc3433ea2be337cecae7216a004
parent1c5aa9cb5d7969ca1610a5566a64e912b2fd8724 (diff)
downloadnative-cb5a1abe2d29f426edc59b09c37487bee91e2d85.tar.gz
lshal: Use vintf::FqInstance for VINTF APIs.
libvintf stops using and depending on android::FqInstance. Convert objects to android::vintf::FqInstance before feeding into libvintf APIs. Test: TH Bug: 264267049 Change-Id: I5c8e640cac537c81e8eb7d0dc9ab6d68cf2cef0b
-rw-r--r--cmds/lshal/ListCommand.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmds/lshal/ListCommand.cpp b/cmds/lshal/ListCommand.cpp
index ff73c9499f..e54f9d3df7 100644
--- a/cmds/lshal/ListCommand.cpp
+++ b/cmds/lshal/ListCommand.cpp
@@ -353,8 +353,16 @@ bool ListCommand::addEntryWithInstance(const TableEntry& entry,
return false;
}
+ auto vintfFqInstance = vintf::FqInstance::from(fqInstance.string());
+ if (!vintfFqInstance.has_value()) {
+ err() << "Unable to convert " << fqInstance.string() << " to vintf::FqInstance"
+ << std::endl;
+ return false;
+ }
+
std::string e;
- if (!manifest->insertInstance(fqInstance, entry.transport, arch, vintf::HalFormat::HIDL, &e)) {
+ if (!manifest->insertInstance(*vintfFqInstance, entry.transport, arch, vintf::HalFormat::HIDL,
+ &e)) {
err() << "Warning: Cannot insert '" << fqInstance.string() << ": " << e << std::endl;
return false;
}