Do not register instrumentation callbacks if property is false.
Bug: 33645959
Test: hidl_test --gtest_filter="HidlTest.WrapTest"
Change-Id: Iebbfc67bfc6badf0f16f2378b6b58755194d60db
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index 1e383a7..3cc4b14 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -156,7 +156,9 @@
HidlInstrumentor::HidlInstrumentor(const std::string &prefix) {
mEnableInstrumentation = property_get_bool("hal.instrumentation.enable",
false);
- registerInstrumentationCallbacks(prefix, &mInstrumentationCallbacks);
+ if (mEnableInstrumentation) {
+ registerInstrumentationCallbacks(prefix, &mInstrumentationCallbacks);
+ }
}
HidlInstrumentor:: ~HidlInstrumentor() {}