Diff between 61d74898ae537a7ba94fe383e1582b27ef7e4d67 and 1a0c910cb8e6d2fe1c5ba970cfeb49e2cd38e747

Changed Files

File Additions Deletions Status
android/cutils/properties.h +18 -0 modified

Full Patch

diff --git a/android/cutils/properties.h b/android/cutils/properties.h
index 66a4a84..8096b19 100644
--- a/android/cutils/properties.h
+++ b/android/cutils/properties.h
@@ -29,9 +29,27 @@
 
 #define PROPERTY_VALUE_MAX 32
 
+#define BLUETOOTH_MODE_PROPERTY_NAME "persist.sys.bluetooth.mode"
+
 static inline int property_get(const char *key, char *value,
 						const char *default_value)
 {
+	const char *prop = NULL;
+
+	if (!strcmp(key, BLUETOOTH_MODE_PROPERTY_NAME))
+		prop = getenv("BLUETOOTH_MODE");
+
+	if (!prop)
+		prop = default_value;
+
+	if (prop) {
+		strncpy(value, prop, PROPERTY_VALUE_MAX);
+
+		value[PROPERTY_VALUE_MAX - 1] = '\0';
+
+		return strlen(value);
+	}
+
 	return 0;
 }