summaryrefslogtreecommitdiffstats
path: root/btif
diff options
context:
space:
mode:
authorSrikanth Uppala <suppala@broadcom.com>2012-04-04 03:32:59 -0700
committerMatthew Xie <mattx@google.com>2012-07-14 11:19:15 -0700
commita379d445a64ce499ff8f32ffa3db49e570da2945 (patch)
tree146de2d9c5902a29e6d1fc3ad94ed9d89e61f423 /btif
parente8070c41e25c6f0d368d7a53c0641524ea4630d2 (diff)
downloadexternal_bluetooth_bluedroid-a379d445a64ce499ff8f32ffa3db49e570da2945.zip
external_bluetooth_bluedroid-a379d445a64ce499ff8f32ffa3db49e570da2945.tar.gz
external_bluetooth_bluedroid-a379d445a64ce499ff8f32ffa3db49e570da2945.tar.bz2
Fix discoverability timeout issues. (a) implement timeout logic (b) persist 'never timeout' after reboot (c) code cleanup
Change-Id: Ifca7250c9b1295437d29e798d685abb4bd843865
Diffstat (limited to 'btif')
-rwxr-xr-x[-rw-r--r--]btif/src/btif_core.c9
-rwxr-xr-xbtif/src/btif_dm.c2
-rwxr-xr-x[-rw-r--r--]btif/src/btif_storage.c0
3 files changed, 9 insertions, 2 deletions
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c
index 560394f..19f26aa 100644..100755
--- a/btif/src/btif_core.c
+++ b/btif/src/btif_core.c
@@ -927,11 +927,18 @@ bt_status_t btif_set_adapter_property(const bt_property_t *property)
storage_req_id = BTIF_CORE_STORAGE_ADAPTER_WRITE;
}
break;
+ case BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT:
+ {
+ //Nothing to do beside store the value in NV. Java
+ //will change the SCAN_MODE property after setting timeout,
+ //if required.
+ storage_req_id = BTIF_CORE_STORAGE_ADAPTER_WRITE;
+ }
+ break;
case BT_PROPERTY_BDADDR:
case BT_PROPERTY_UUIDS:
case BT_PROPERTY_ADAPTER_BONDED_DEVICES:
case BT_PROPERTY_REMOTE_FRIENDLY_NAME:
- case BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT:
/* no write support through HAL, these properties are only populated from BTA events */
status = BT_STATUS_FAIL;
break;
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index 610cd3f..17d2488 100755
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -1306,7 +1306,7 @@ bt_status_t btif_dm_get_adapter_property(bt_property_t *prop)
case BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT:
{
uint32_t *tmt = (uint32_t*)prop->val;
- *tmt = 0;
+ *tmt = 120; /* default to 120s, if not found in NV */
prop->len = sizeof(uint32_t);
}
break;
diff --git a/btif/src/btif_storage.c b/btif/src/btif_storage.c
index f051de1..f051de1 100644..100755
--- a/btif/src/btif_storage.c
+++ b/btif/src/btif_storage.c