Runtime warning for unenforced VINTF manifest.
It's currently tested in VTS. However, if this flag is not enabled,
there can be race conditions where the framework starts up after
a HAL, and so a HAL is unused. In order to prevent this race
condition (and also to simplify logic here and elsewhere), all
devices should set this flag.
It turns out, some non-Treble devices use this (especially emulators).
Placing a runtime warning here so that it's visible.
Bug: 67974785
Test: Check log is not visible on device when this flag is set.
Change-Id: Id0cbd749166c2e4f63d7d0ca10805fbc992f1b72
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index e7bec41..374470e 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -769,6 +769,13 @@
const char* env = std::getenv("TREBLE_TESTING_OVERRIDE");
const bool trebleTestingOverride = env && !strcmp(env, "true");
const bool vintfLegacy = (transport == Transport::EMPTY);
+
+ ALOGE("getService: Potential race detected. The VINTF manifest is not being enforced. If a HAL "
+ "server has a delay in starting and it is not in the manifest, it will not be retrieved. "
+ "Please make sure all HALs on this device are in the VINTF manifest and enable "
+ "PRODUCT_ENFORCE_VINTF_MANIFEST on this device (this is also enabled by "
+ "PRODUCT_FULL_TREBLE). PRODUCT_ENFORCE_VINTF_MANIFEST will ensure that no race condition "
+ "is possible here.");
#endif // ENFORCE_VINTF_MANIFEST
for (int tries = 0; !getStub && (vintfHwbinder || vintfLegacy); tries++) {