libhidl: check ro.debuggable less am: 59af9c82dc

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/libhidl/+/21105968

Change-Id: I880bfff4f33a32bfeef376706d3f11b06765e7a3
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 c638279..0640eef 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -174,12 +174,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) {