summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-04-10 03:09:29 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-04-10 03:09:29 +0000
commitcc3d24f9d37c42e52d3d1831d5a368ba820f5b41 (patch)
tree769a69fcd8a609c266da80b48d2de307c838b5cc
parent6e0d6b100bd494cdac55e6ade184f3eb325583ce (diff)
parentc7cce3d4e5045726d187a7eb17740af5fc04a196 (diff)
downloadlibhidl-cc3d24f9d37c42e52d3d1831d5a368ba820f5b41.tar.gz
Snap for 7272808 from c7cce3d4e5045726d187a7eb17740af5fc04a196 to sc-release
Change-Id: I88360f77ff9ae3843d6800335e2724a90e4306db
-rw-r--r--transport/ServiceManagement.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index c4e03c3..c638279 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -159,12 +159,6 @@ static constexpr bool kEnforceVintfManifest = true;
static constexpr bool kEnforceVintfManifest = false;
#endif
-#ifdef LIBHIDL_TARGET_DEBUGGABLE
-static constexpr bool kDebuggable = true;
-#else
-static constexpr bool kDebuggable = false;
-#endif
-
static bool* getTrebleTestingOverridePtr() {
static bool gTrebleTestingOverride = false;
return &gTrebleTestingOverride;
@@ -174,8 +168,13 @@ void setTrebleTestingOverride(bool testingOverride) {
*getTrebleTestingOverridePtr() = testingOverride;
}
+static bool isDebuggable() {
+ static bool debuggable = base::GetBoolProperty("ro.debuggable", false);
+ return debuggable;
+}
+
static inline bool isTrebleTestingOverride() {
- if (kEnforceVintfManifest && !kDebuggable) {
+ if (kEnforceVintfManifest && !isDebuggable()) {
// don't allow testing override in production
return false;
}
@@ -766,7 +765,7 @@ sp<::android::hidl::base::V1_0::IBase> getRawServiceInternal(const std::string&
const bool vintfHwbinder = (transport == Transport::HWBINDER);
const bool vintfPassthru = (transport == Transport::PASSTHROUGH);
const bool trebleTestingOverride = isTrebleTestingOverride();
- const bool allowLegacy = !kEnforceVintfManifest || (trebleTestingOverride && kDebuggable);
+ const bool allowLegacy = !kEnforceVintfManifest || (trebleTestingOverride && isDebuggable());
const bool vintfLegacy = (transport == Transport::EMPTY) && allowLegacy;
if (!kEnforceVintfManifest) {