From da7c9bed22fa8f18e50aa965319fb92131740fca Mon Sep 17 00:00:00 2001 From: Ravi Nagarajan Date: Thu, 27 Sep 2012 03:57:39 -0700 Subject: Send the enabled hfp/hsp service UUIDs based on config On platforms where HFP is disabled, we were incorrectly notifying upper layer of HFP support in local uuids. Use the build config to determine the right set of local UUIDs bug 7232184 Change-Id: Ica308dd879336300714e97d3441334e16471359a --- btif/src/btif_dm.c | 1 + btif/src/btif_hf.c | 8 +++++++- btif/src/btif_storage.c | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) mode change 100644 => 100755 btif/src/btif_dm.c mode change 100644 => 100755 btif/src/btif_hf.c mode change 100644 => 100755 btif/src/btif_storage.c diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c old mode 100644 new mode 100755 index ac46e87..5517f55 --- a/btif/src/btif_dm.c +++ b/btif/src/btif_dm.c @@ -119,6 +119,7 @@ bt_status_t btif_in_execute_service_request(tBTA_SERVICE_ID service_id, switch (service_id) { case BTA_HFP_SERVICE_ID: + case BTA_HSP_SERVICE_ID: { btif_hf_execute_service(b_enable); }break; diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c old mode 100644 new mode 100755 index 8e605d5..49b0257 --- a/btif/src/btif_hf.c +++ b/btif/src/btif_hf.c @@ -484,8 +484,14 @@ static bt_status_t init( bthf_callbacks_t* callbacks ) bt_hf_callbacks = callbacks; /* Invoke the enable service API to the core to set the appropriate service_id - * Internally, the HSP_SERVICE_ID shall also be enabled */ + * Internally, the HSP_SERVICE_ID shall also be enabled if HFP is enabled (phone) + * othwerwise only HSP is enabled (tablet) + */ +#if (defined(BTIF_HF_SERVICES) && (BTIF_HF_SERVICES & BTA_HFP_SERVICE_MASK)) btif_enable_service(BTA_HFP_SERVICE_ID); +#else + btif_enable_service(BTA_HSP_SERVICE_ID); +#endif memset(&btif_hf_cb, 0, sizeof(btif_hf_cb_t)); clear_phone_state(); diff --git a/btif/src/btif_storage.c b/btif/src/btif_storage.c old mode 100644 new mode 100755 index bd0ed28..6d702a7 --- a/btif/src/btif_storage.c +++ b/btif/src/btif_storage.c @@ -554,6 +554,10 @@ bt_status_t btif_storage_get_adapter_property(bt_property_t *property) uuid16_to_uuid128(UUID_SERVCLASS_AG_HANDSFREE, p_uuid+num_uuids); num_uuids++; + } + /* intentional fall through: Send both BFP & HSP UUIDs if HFP is enabled */ + case BTA_HSP_SERVICE_ID: + { uuid16_to_uuid128(UUID_SERVCLASS_HEADSET_AUDIO_GATEWAY, p_uuid+num_uuids); num_uuids++; -- cgit v1.1