Disable getDebugInfo address leak for production builds.
On production builds debugfs won't be available, so lshal cannot
infer binder relationships anyway. The address leak on production
builds also expose a security hole for address space attacks.
Added a build-time flag to disable the address leak on user builds.
The address will still be exposed for eng and userdebug builds so
that lshal can work properly.
Bug: 34899586
Test: lshal still works
Change-Id: Id1c381fbccad7584c2932deb9212d6996eeefd75
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index a16701b..7737011 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -63,6 +63,11 @@
vintf::Transport getTransport(const std::string &interfaceName,
const std::string &instanceName);
+namespace details {
+// Return true on userdebug / eng builds and false on user builds.
+bool debuggable();
+} // namespace details
+
// hidl_death_recipient is a callback interfaced that can be used with
// linkToDeath() / unlinkToDeath()
struct hidl_death_recipient : public virtual RefBase {