liblog: Always report as debuggable when building userdebug/eng

This doesn't affect the normal behavior of our builds, because
ro.debuggable is set to 1 on userdebug/eng anyway.

However, it's helpful because making __android_log_is_debuggable
return a compile time value rather than the value of runtime prop
lets us pass checks that'd otherwise prevent us from using adb root
when Magisk is installed.

Change-Id: I36f53976162e652a38008ced459ca02fd6c0af51
Reviewed-on: https://review.blissroms.org/c/platform_system_logging/+/19508
Reviewed-by: Jack <jackeagle102@gmail.com>
Tested-by: Jack <jackeagle102@gmail.com>
Signed-off-by: Jis G Jacob <studiokeys@blissroms.org>
diff --git a/liblog/properties.cpp b/liblog/properties.cpp
index 657901a..12cbd9e 100644
--- a/liblog/properties.cpp
+++ b/liblog/properties.cpp
@@ -262,12 +262,16 @@
 }
 
 int __android_log_is_debuggable() {
-  static int is_debuggable = [] {
-    char value[PROP_VALUE_MAX] = {};
-    return __system_property_get("ro.debuggable", value) > 0 && !strcmp(value, "1");
-  }();
+  if (ANDROID_DEBUGGABLE) {
+    return 1;
+  } else {
+    static int is_debuggable = [] {
+      char value[PROP_VALUE_MAX] = {};
+      return __system_property_get("ro.debuggable", value) > 0 && !strcmp(value, "1");
+    }();
 
-  return is_debuggable;
+    return is_debuggable;
+  }
 }
 
 int __android_log_security() {