• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

external/bluetooth/bluedroid


Commit MetaInfo

修訂f677f81068640857f791276c472e34b08d08f3e6 (tree)
時間2014-03-11 03:04:56
作者Matthew Xie <mattx@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "DO NOT MERGE Bluetooth: Cleanup bt_config.xml during BLE Scan" into klp-dev

Change Summary

差異

--- a/btif/include/btif_storage.h
+++ b/btif/include/btif_storage.h
@@ -30,6 +30,7 @@
3030 #define BTIF_STORAGE_FILL_PROPERTY(p_prop, t, l, p_v) \
3131 (p_prop)->type = t;(p_prop)->len = l; (p_prop)->val = (p_v);
3232
33+#define BTIF_STORAGE_MAX_ALLOWED_REMOTE_DEVICE 512
3334
3435 /*******************************************************************************
3536 ** Functions
--- a/btif/src/btif_gatt_client.c
+++ b/btif/src/btif_gatt_client.c
@@ -463,10 +463,31 @@ static void btif_gattc_upstreams_evt(uint16_t event, char* p_param)
463463 case BTIF_GATT_OBSERVE_EVT:
464464 {
465465 btif_gattc_cb_t *p_btif_cb = (btif_gattc_cb_t*)p_param;
466- if (!btif_gattc_find_bdaddr(p_btif_cb->bd_addr.address))
466+ uint8_t remote_name_len;
467+ uint8_t *p_eir_remote_name=NULL;
468+
469+ p_eir_remote_name = BTA_CheckEirData(p_btif_cb->value,
470+ BTM_EIR_COMPLETE_LOCAL_NAME_TYPE, &remote_name_len);
471+
472+ if(p_eir_remote_name == NULL)
467473 {
468- btif_gattc_add_remote_bdaddr(p_btif_cb->bd_addr.address, p_btif_cb->addr_type);
469- btif_gattc_update_properties(p_btif_cb);
474+ p_eir_remote_name = BTA_CheckEirData(p_btif_cb->value,
475+ BT_EIR_SHORTENED_LOCAL_NAME_TYPE, &remote_name_len);
476+ }
477+
478+ if ((p_btif_cb->addr_type != BLE_ADDR_RANDOM) || (p_eir_remote_name))
479+ {
480+ if (!btif_gattc_find_bdaddr(p_btif_cb->bd_addr.address))
481+ {
482+ static const char* exclude_filter[] =
483+ {"LinkKey", "LE_KEY_PENC", "LE_KEY_PID", "LE_KEY_PCSRK", "LE_KEY_LENC", "LE_KEY_LCSRK"};
484+
485+ btif_gattc_add_remote_bdaddr(p_btif_cb->bd_addr.address, p_btif_cb->addr_type);
486+ btif_gattc_update_properties(p_btif_cb);
487+ btif_config_filter_remove("Remote", exclude_filter, sizeof(exclude_filter)/sizeof(char*),
488+ BTIF_STORAGE_MAX_ALLOWED_REMOTE_DEVICE);
489+ }
490+
470491 }
471492 HAL_CBACK(bt_gatt_callbacks, client->scan_result_cb,
472493 &p_btif_cb->bd_addr, p_btif_cb->rssi, p_btif_cb->value);
--- a/btif/src/btif_storage.c
+++ b/btif/src/btif_storage.c
@@ -38,7 +38,7 @@
3838 #define LOG_TAG "BTIF_STORAGE"
3939
4040 #include "btif_api.h"
41-
41+#include "btif_storage.h"
4242 #include "btif_util.h"
4343 #include "bd.h"
4444 #include "gki.h"
@@ -150,7 +150,6 @@
150150 #define BTIF_STORAGE_HL_APP_DATA "hl_app_data_"
151151 #define BTIF_STORAGE_HL_APP_MDL_DATA "hl_app_mdl_data_"
152152
153-#define BTIF_STORAGE_MAX_ALLOWED_REMOTE_DEVICE 512
154153 /************************************************************************************
155154 ** Local type definitions
156155 ************************************************************************************/