#pragma once
#include <cstdint>
-#if defined(OS_GENERIC)
+
#define PROPERTY_VALUE_MAX 92
-#else
-#include <cutils/properties.h>
-#endif // defined(OS_GENERIC)
+#define BUILD_SANITY_PROPERTY_VALUE_MAX 92
// Get value associated with key |key| into |value|.
// Returns the length of the value which will never be greater than
#include "osi/include/properties.h"
+#if !defined(OS_GENERIC)
+#undef PROPERTY_VALUE_MAX
+#include <cutils/properties.h>
+#if BUILD_SANITY_PROPERTY_VALUE_MAX != PROPERTY_VALUE_MAX
+#error "PROPERTY_VALUE_MAX from osi/include/properties.h != the Android value"
+#endif // GENERIC_PROPERTY_VALUE_MAX != PROPERTY_VALUE_MAX
+#endif // !defined(OS_GENERIC)
+
int osi_property_get(const char* key, char* value, const char* default_value) {
#if defined(OS_GENERIC)
/* For linux right now just return default value, if present */
"libbluetooth-binder-common",
"libbtcore",
"libbluetooth-types",
+ "libosi",
],
shared_libs: [
return EXIT_SUCCESS;
}
-#if !defined(OS_GENERIC)
// TODO(armansito): Remove Chromecast specific property out of here. This
// should just be obtained from global config.
char disable_value[PROPERTY_VALUE_MAX];
- int status = property_get(kDisableProperty, disable_value, nullptr);
+ int status = osi_property_get(kDisableProperty, disable_value, nullptr);
if (status && !strcmp(disable_value, "1")) {
LOG(INFO) << "service disabled";
return EXIT_SUCCESS;
}
-#endif // !defined(OS_GENERIC)
if (!bluetooth::Daemon::Initialize()) {
LOG(ERROR) << "Failed to initialize Daemon";