Remove skipCache for RuntimeInfo
The argument was created for vintf_object_tests before VintfObject is
instantiated as an object. Now that an empty VintfObject is created
before each test, this argument can be safely dropped.
Also, fix VintfObjectRuntimeInfoTest.GetRuntimeInfo because that test
tests the behavior of skipCache. Now that it is removed, just test that
the information is fetched and subsequent calls won't fetch the
information again.
Test: unit tests
Bug: 110855270
Change-Id: Ib56d413e0cf188225595ae5f4da1aedcff1a14ce
diff --git a/VintfObject.cpp b/VintfObject.cpp
index af075d4..71588af 100644
--- a/VintfObject.cpp
+++ b/VintfObject.cpp
@@ -496,17 +496,14 @@
return OK;
}
-std::shared_ptr<const RuntimeInfo> VintfObject::GetRuntimeInfo(bool skipCache,
- RuntimeInfo::FetchFlags flags) {
- return GetInstance()->getRuntimeInfo(skipCache, flags);
+std::shared_ptr<const RuntimeInfo> VintfObject::GetRuntimeInfo(RuntimeInfo::FetchFlags flags) {
+ return GetInstance()->getRuntimeInfo(flags);
}
-std::shared_ptr<const RuntimeInfo> VintfObject::getRuntimeInfo(bool skipCache,
- RuntimeInfo::FetchFlags flags) {
+std::shared_ptr<const RuntimeInfo> VintfObject::getRuntimeInfo(RuntimeInfo::FetchFlags flags) {
std::unique_lock<std::mutex> _lock(mDeviceRuntimeInfo.mutex);
- if (!skipCache) {
- flags &= (~mDeviceRuntimeInfo.fetchedFlags);
- }
+ // Skip fetching information that has already been fetched previously.
+ flags &= (~mDeviceRuntimeInfo.fetchedFlags);
if (mDeviceRuntimeInfo.object == nullptr) {
mDeviceRuntimeInfo.object = getRuntimeInfoFactory()->make_shared();