#include <hardware/bluetooth.h>
-/**
- * TODO(armansito): cutils/properties.h is only being used to pull-in runtime
- * settings on Android. Remove this conditional include once we have a generic
- * way to obtain system properties.
- */
-#if !defined(OS_GENERIC)
-#include <cutils/properties.h>
-#endif /* !defined(OS_GENERIC) */
-
#include "bdaddr.h"
#include "bta_gatt_api.h"
#include "btif_api.h"
#include "osi/include/allocator.h"
#include "osi/include/log.h"
#include "osi/include/metrics.h"
+#include "osi/include/properties.h"
#include "stack_config.h"
#include "stack/btm/btm_int.h"
#ifdef BTIF_DM_OOB_TEST
void btif_dm_load_local_oob(void)
{
- /**
- * TODO(armansito): On OSs other than Android, the sys/properties.h system
- * does not exist. Remove this conditional include once we have a generic way
- * to obtain system properties.
- */
-#if !defined(OS_GENERIC)
char prop_oob[PROPERTY_VALUE_MAX];
- property_get("service.brcm.bt.oob", prop_oob, "3");
+ osi_property_get("service.brcm.bt.oob", prop_oob, "3");
BTIF_TRACE_DEBUG("%s: prop_oob = %s", __func__, prop_oob);
if (prop_oob[0] != '3')
{
BTA_DmLocalOob();
}
}
-#endif /* !defined(OS_GENERIC) */
}
void btif_dm_proc_loc_oob(BOOLEAN valid, BT_OCTET16 c, BT_OCTET16 r)
{
- /**
- * TODO(armansito): On OSs other than Android, the sys/properties.h system
- * does not exist. Remove this conditional include once we have a generic way
- * to obtain system properties.
- */
-#if !defined(OS_GENERIC)
FILE *fp;
char *path_a = "/data/misc/bluedroid/LOCAL/a.key";
char *path_b = "/data/misc/bluedroid/LOCAL/b.key";
BTIF_TRACE_DEBUG("save local OOB data in memory");
memcpy(oob_cb.oob_data.c192, c, BT_OCTET16_LEN);
memcpy(oob_cb.oob_data.r192, r, BT_OCTET16_LEN);
- property_get("service.brcm.bt.oob", prop_oob, "3");
+ osi_property_get("service.brcm.bt.oob", prop_oob, "3");
BTIF_TRACE_DEBUG("%s: prop_oob = %s", __func__, prop_oob);
if (prop_oob[0] == '1')
path = path_a;
}
}
}
-#endif /* !defined(OS_GENERIC) */
}
BOOLEAN btif_dm_proc_rmt_oob(BD_ADDR bd_addr, BT_OCTET16 p_c, BT_OCTET16 p_r)
{
- /**
- * TODO(armansito): On OSs other than Android, the sys/properties.h system
- * does not exist. Remove this conditional include once we have a generic way
- * to obtain system properties.
- */
-#if !defined(OS_GENERIC)
char t[128];
FILE *fp;
char *path_a = "/data/misc/bluedroid/LOCAL/a.key";
BOOLEAN result = FALSE;
bt_bdaddr_t bt_bd_addr;
bdcpy(oob_cb.bdaddr, bd_addr);
- property_get("service.brcm.bt.oob", prop_oob, "3");
+ osi_property_get("service.brcm.bt.oob", prop_oob, "3");
BTIF_TRACE_DEBUG("%s: prop_oob = %s", __func__, prop_oob);
if (prop_oob[0] == '1')
path = path_b;
}
BTIF_TRACE_DEBUG("%s: result=%d", __func__, result);
return result;
-#else /* defined(OS_GENERIC) */
- return FALSE;
-#endif /* !defined(OS_GENERIC) */
}
#endif /* BTIF_DM_OOB_TEST */
#if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
}
static char* btif_get_default_local_name() {
- /**
- * TODO(armansito): On OSs other than Android, the sys/properties.h system
- * does not exist. Remove this conditional include once we have a generic way
- * to obtain system properties.
- */
-#if !defined(OS_GENERIC)
if (btif_default_local_name[0] == '\0')
{
int max_len = sizeof(btif_default_local_name) - 1;
else
{
char prop_model[PROPERTY_VALUE_MAX];
- property_get(PROPERTY_PRODUCT_MODEL, prop_model, "");
+ osi_property_get(PROPERTY_PRODUCT_MODEL, prop_model, "");
strncpy(btif_default_local_name, prop_model, max_len);
}
btif_default_local_name[max_len] = '\0';
}
-#endif /* !defined(OS_GENERIC) */
return btif_default_local_name;
}