lshal: add "Status" column and "Manifest HALs" section.
- Added "Status" column that has following values:
- alive: running hwbinder service
- registered;dead: registered, but service cannot accept calls
- declared: only in VINTF, not in hwservicemanager
- N/A: passthrough HALs
- Added a "Manifest HALs" section that lists all
HALs (hwbinder or passthrough) in device / framework manifest
Test: lshal_test
Bug: 71555570
Change-Id: I202b562ee73bcd49506bb43cc9af27b86f32651c
diff --git a/cmds/lshal/TableEntry.cpp b/cmds/lshal/TableEntry.cpp
index 4ad3e92..8e21975 100644
--- a/cmds/lshal/TableEntry.cpp
+++ b/cmds/lshal/TableEntry.cpp
@@ -62,6 +62,7 @@
case TableColumnType::RELEASED: return "R";
case TableColumnType::HASH: return "Hash";
case TableColumnType::VINTF: return "VINTF";
+ case TableColumnType::SERVICE_STATUS: return "Status";
default:
LOG(FATAL) << __func__ << "Should not reach here. " << static_cast<int>(type);
return "";
@@ -94,6 +95,8 @@
return hash;
case TableColumnType::VINTF:
return getVintfInfo();
+ case TableColumnType::SERVICE_STATUS:
+ return lshal::to_string(serviceStatus);
default:
LOG(FATAL) << __func__ << "Should not reach here. " << static_cast<int>(type);
return "";
@@ -129,6 +132,18 @@
return joined.empty() ? "X" : joined;
}
+std::string to_string(ServiceStatus s) {
+ switch (s) {
+ case ServiceStatus::ALIVE: return "alive";
+ case ServiceStatus::NON_RESPONSIVE: return "non-responsive";
+ case ServiceStatus::DECLARED: return "declared";
+ case ServiceStatus::UNKNOWN: return "N/A";
+ }
+
+ LOG(FATAL) << __func__ << "Should not reach here." << static_cast<int>(s);
+ return "";
+}
+
TextTable Table::createTextTable(bool neat,
const std::function<std::string(const std::string&)>& emitDebugInfo) const {