libhidl: check ro.debuggable less am: 4acdab7658 am: 3db12156b3 am: a196f6bc03 am: df9c623f39 am: 9f46e51683
Original change: https://android-review.googlesource.com/c/platform/system/libhidl/+/2180435
Change-Id: If5268e2def0005cdae0d1680abb0bd778a883067
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index 5d1979f..f3ee611 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -175,12 +175,15 @@
}
static inline bool isTrebleTestingOverride() {
+ // return false early so we don't need to check the debuggable property
+ if (!*getTrebleTestingOverridePtr()) return false;
+
if (kEnforceVintfManifest && !isDebuggable()) {
// don't allow testing override in production
return false;
}
- return *getTrebleTestingOverridePtr();
+ return true;
}
static void onRegistrationImpl(const std::string& descriptor, const std::string& instanceName) {