drm_hwcomposer: Fix build failure on Linux-native targets

Commit e11f723f ("drm_hwcomposer: Query property when checking virtual
displays availability") introduced a call to
android::base::GetBoolProperty, which is only available in Android.
This caused the test "hwcomposer.filegroups_build_test" to fail because
the code was no longer compiling for Linux-native targets.

Fix that by replacing "android::base::GetBoolProperty" with a new
function "property_get_bool," and define the function for both Android
and non-Android targets:
For Android, utilize the existing function from <cutils/properties.h>
For other targets, a new implementation is provided in
utils/properties.h.

Fixes: e11f723f ("drm_hwcomposer: Query property when checking virtual
displays availability")

Signed-off-by: Paz Zcharya <pazz@google.com>
diff --git a/utils/properties.h b/utils/properties.h
index e400236..641df91 100644
--- a/utils/properties.h
+++ b/utils/properties.h
@@ -39,4 +39,37 @@
   return static_cast<int>(strlen(value));
 }
 
+/**
+ * Bluntly copied from system/core/libcutils/properties.cpp,
+ * which is part of the Android Project and licensed under Apache 2.
+ * Source:
+ * https://cs.android.com/android/platform/superproject/main/+/main:system/core/libcutils/properties.cpp;l=27
+ */
+auto inline property_get_bool(const char *key, int8_t default_value) -> int8_t {
+  if (!key)
+    return default_value;
+
+  int8_t result = default_value;
+  char buf[PROPERTY_VALUE_MAX] = {};
+
+  int len = property_get(key, buf, "");
+  if (len == 1) {
+    char ch = buf[0];
+    if (ch == '0' || ch == 'n') {
+      result = false;
+    } else if (ch == '1' || ch == 'y') {
+      result = true;
+    }
+  } else if (len > 1) {
+    if (!strcmp(buf, "no") || !strcmp(buf, "false") || !strcmp(buf, "off")) {
+      result = false;
+    } else if (!strcmp(buf, "yes") || !strcmp(buf, "true") ||
+               !strcmp(buf, "on")) {
+      result = true;
+    }
+  }
+
+  return result;
+}
+
 #endif