diff options
author | Ganesh Ganapathi Batta <ganeshg@broadcom.com> | 2012-08-30 13:08:17 -0700 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-09-04 16:45:26 -0700 |
commit | 786d5ab53626b17c8cb4239ad5c6fe19ffdc6abc (patch) | |
tree | b4bcbea33ea2f73f4728b4a762cf23f3abd2d40c | |
parent | 9d8a5acb9bcecdb571aedcc3645940c0e9c2e314 (diff) | |
download | external_bluetooth_bluedroid-786d5ab53626b17c8cb4239ad5c6fe19ffdc6abc.zip external_bluetooth_bluedroid-786d5ab53626b17c8cb4239ad5c6fe19ffdc6abc.tar.gz external_bluetooth_bluedroid-786d5ab53626b17c8cb4239ad5c6fe19ffdc6abc.tar.bz2 |
Fix for Fixed pin keyboard blacklist search issue.
Bug:7074362
Change-Id: I76afb73e51e8f6ab1da8257ea004c8d7131e6884
-rwxr-xr-x | btif/src/btif_storage.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/btif/src/btif_storage.c b/btif/src/btif_storage.c index 0596ccd..46055f5 100755 --- a/btif/src/btif_storage.c +++ b/btif/src/btif_storage.c @@ -1340,7 +1340,6 @@ BOOLEAN btif_storage_is_device_autopair_blacklisted(bt_bdaddr_t *remote_dev_add char *token; int ret; bdstr_t bdstr; - char bd_addr_lap[9]; char *dev_name_str; uint8_t i = 0; char value[BTIF_STORAGE_MAX_LINE_SZ]; @@ -1348,17 +1347,13 @@ BOOLEAN btif_storage_is_device_autopair_blacklisted(bt_bdaddr_t *remote_dev_add bd2str(remote_dev_addr, &bdstr); - /* create a string with Lower Address Part from BD Address */ - snprintf(bd_addr_lap, 9, "%s", (char*)bdstr); + /* Consider only Lower Address Part from BD Address */ + bdstr[8] = '\0'; - for ( i =0; i <strlen(bd_addr_lap) ;i++) - { - bd_addr_lap[i] = toupper(bd_addr_lap[i]); - } if(btif_config_get_str("Local", BTIF_STORAGE_PATH_AUTOPAIR_BLACKLIST, BTIF_STORAGE_KEY_AUTOPAIR_BLACKLIST_ADDR, value, &value_size)) { - if (strstr(value,bd_addr_lap) != NULL) + if (strcasestr(value,bdstr) != NULL) return TRUE; } @@ -1449,24 +1444,22 @@ BOOLEAN btif_storage_is_fixed_pin_zeros_keyboard(bt_bdaddr_t *remote_dev_addr) { int ret; bdstr_t bdstr; - char bd_addr_lap[9]; char *dev_name_str; uint8_t i = 0; char linebuf[BTIF_STORAGE_MAX_LINE_SZ]; bd2str(remote_dev_addr, &bdstr); - snprintf(bd_addr_lap, 9, "%s", (char*)bdstr); - for ( i =0; i <strlen(bd_addr_lap) ;i++) - { - bd_addr_lap[i] = toupper(bd_addr_lap[i]); - } + /*consider on LAP part of BDA string*/ + bdstr[8] = '\0'; + int line_size = sizeof(linebuf); if(btif_config_get_str("Local", BTIF_STORAGE_PATH_AUTOPAIR_BLACKLIST, BTIF_STORAGE_KEY_AUTOPAIR_FIXPIN_KBLIST, linebuf, &line_size)) { - if (strstr(bd_addr_lap, linebuf) != NULL) + if (strcasestr(linebuf,bdstr) != NULL) return TRUE; } return FALSE; + } |