This patch contains bug fixes for solving race conditions for multiple
advertisers and incorrect VS command length which makes uuid filters not
working.

b/15094154, b/15174583

Change-Id: I78746b923301fa47afb21f8bedb0d79b42f492b9
diff --git a/stack/btm/btm_ble_gap.c b/stack/btm/btm_ble_gap.c
index eb2ca06..4eb4538 100644
--- a/stack/btm/btm_ble_gap.c
+++ b/stack/btm/btm_ble_gap.c
@@ -430,10 +430,12 @@
 *******************************************************************************/
 static void btm_ble_vendor_capability_vsc_cmpl_cback (tBTM_VSC_CMPL *p_vcs_cplt_params)
 {
+    BTM_TRACE_EVENT0 ("btm_ble_vendor_capability_vsc_cmpl_cback");
     UINT8  status = 0xFF, *p;
     UINT8  rpa_offloading, max_irk_list_sz, filtering_support, max_filter;
     UINT16 scan_result_storage;
-
+    tBTM_BLE_VENDOR_CB  *p_vcb = &btm_ble_vendor_cb;
+    max_irk_list_sz = 0;
     /* Check status of command complete event */
     if((p_vcs_cplt_params->opcode == HCI_BLE_VENDOR_CAP_OCF)
         &&(p_vcs_cplt_params->param_len > 0 ))
@@ -451,6 +453,8 @@
         STREAM_TO_UINT8  (filtering_support, p);
         STREAM_TO_UINT8  (max_filter, p);
     }
+    p_vcb->irk_avail_size = max_irk_list_sz;
+    BTM_TRACE_EVENT3 ("btm_ble_vendor_capability_vsc_cmpl_cback:%d, status=%d, max_irk_size=%d", btm_multi_adv_cb.adv_inst_max, status,btm_ble_vendor_cb.irk_avail_size);
 }
 
 /*******************************************************************************
@@ -464,6 +468,8 @@
 *******************************************************************************/
 void btm_ble_vendor_capability_init(void)
 {
+    BTM_TRACE_ERROR0("btm_ble_vendor_capability_init");
+    memset(&btm_ble_vendor_cb, 0, sizeof(tBTM_BLE_VENDOR_CB));
     if ( BTM_VendorSpecificCommand (HCI_BLE_VENDOR_CAP_OCF,
                                     0,
                                     NULL,