getService: re-request HALs after timeout
Lazy HALs are started by hwservicemanager, but there is a possible
race condition:
- HAL is requested to be started and starts
- client queries HAL
- HAL executes query and exits (but init doesn't know this yet)
- client queries HAL
- HAL is requested to be started, but init thinks it is already
running, so it isn't started again
- init reaps HAL process
- client is waiting for HAL indefinitely
This will only happen in a case where a lazy HAL exits right when it is
requesting.
Fixes: 79427800
Test: $ANDROID_BUILD_TOP/system/tools/hidl/test/run_all_device_tests.sh
Change-Id: I723a182a709f2291debad69fc4141ba9a064645e
diff --git a/transport/include/hidl/ServiceManagement.h b/transport/include/hidl/ServiceManagement.h
index 4df156b..968c385 100644
--- a/transport/include/hidl/ServiceManagement.h
+++ b/transport/include/hidl/ServiceManagement.h
@@ -43,6 +43,7 @@
const std::string &interfaceName,
const std::string &instanceName);
+// Will not attempt to start a lazy HAL
// e.x.: android.hardware.foo@1.0::IFoo, default
void waitForHwService(const std::string &interface, const std::string &instanceName);