Add API for runtime collectible kernel / sepolicy info.
Also makes a nit change to VendorManifest; clear it
immediately when fetchAllInformation fails.
Test: /system/bin/vintf produces output for
/proc/version and kernel sepolicy version.
Change-Id: If24a5d7de92c674bd2668c5f5f42f61e894335c4
diff --git a/parse_string.cpp b/parse_string.cpp
index f8f4b12..d0e655b 100644
--- a/parse_string.cpp
+++ b/parse_string.cpp
@@ -233,5 +233,23 @@
return oss.str();
}
+std::string dump(const KernelInfo &ki) {
+ std::ostringstream oss;
+
+ oss << "kernel = "
+ << ki.osName() << "/"
+ << ki.nodeName() << "/"
+ << ki.osRelease() << "/"
+ << ki.osVersion() << "/"
+ << ki.hardwareId() << ";"
+ << "kernelSepolicyVersion = " << ki.kernelSepolicyVersion() << ";"
+ << "#CONFIG's loaded = " << ki.kernelConfigs.size() << ";\n";
+ for (const auto &pair : ki.kernelConfigs) {
+ oss << pair.first << "=" << pair.second << "\n";
+ }
+
+ return oss.str();
+}
+
} // namespace vintf
} // namespace android