Loading system/osi/include/properties.h +2 −4 Original line number Diff line number Diff line Loading @@ -19,11 +19,9 @@ #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 Loading system/osi/src/properties.cc +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,14 @@ #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 */ Loading system/service/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ cc_binary { "libbluetooth-binder-common", "libbtcore", "libbluetooth-types", "libosi", ], shared_libs: [ Loading system/service/main.cc +1 −3 Original line number Diff line number Diff line Loading @@ -55,16 +55,14 @@ int main(int argc, char* argv[]) { 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"; Loading Loading
system/osi/include/properties.h +2 −4 Original line number Diff line number Diff line Loading @@ -19,11 +19,9 @@ #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 Loading
system/osi/src/properties.cc +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,14 @@ #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 */ Loading
system/service/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ cc_binary { "libbluetooth-binder-common", "libbtcore", "libbluetooth-types", "libosi", ], shared_libs: [ Loading
system/service/main.cc +1 −3 Original line number Diff line number Diff line Loading @@ -55,16 +55,14 @@ int main(int argc, char* argv[]) { 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"; Loading