Use static linkage to reduce user/userdebug differences
This commit changes the linkage of `kGcovPrefixEnvVar`,
`kGcovPrefixOverrideEnvVar`, `kGcovPrefixPath`, `kSysPropHalCoverage`,
and `kSysPropInstrumentationPath` to static linkage so that they won't
be exported in userdebug build. This ensures both user and userdebug
build export the same symbol set.
Bug: 117859056
Test: libhidlbase.so builds w/o problems under userdebug build
Change-Id: Id61b827f3da1964e060db6f862132da70b29cea0
diff --git a/base/HidlInternal.cpp b/base/HidlInternal.cpp
index 81b353d..440b30f 100644
--- a/base/HidlInternal.cpp
+++ b/base/HidlInternal.cpp
@@ -31,16 +31,17 @@
#include <regex>
extern "C" __attribute__((weak)) void __sanitizer_cov_dump();
-const char* kGcovPrefixEnvVar = "GCOV_PREFIX";
-const char* kGcovPrefixOverrideEnvVar = "GCOV_PREFIX_OVERRIDE";
-const char* kGcovPrefixPath = "/data/misc/trace/";
-const char* kSysPropHalCoverage = "hal.coverage.enable";
+
+const char kGcovPrefixEnvVar[] = "GCOV_PREFIX";
+const char kGcovPrefixOverrideEnvVar[] = "GCOV_PREFIX_OVERRIDE";
+const char kGcovPrefixPath[] = "/data/misc/trace/";
+const char kSysPropHalCoverage[] = "hal.coverage.enable";
#if defined(__LP64__)
-const char* kSysPropInstrumentationPath = "hal.instrumentation.lib.path.64";
+const char kSysPropInstrumentationPath[] = "hal.instrumentation.lib.path.64";
#else
-const char* kSysPropInstrumentationPath = "hal.instrumentation.lib.path.32";
+const char kSysPropInstrumentationPath[] = "hal.instrumentation.lib.path.32";
#endif
-#endif
+#endif // LIBHIDL_TARGET_DEBUGGABLE
namespace android {
namespace hardware {