Bluetooth: fix the HOGP device(iBUFFALO BSMBB09DS) pair and reconnect problem.

in bta_hh_le.c (fix reconnect issue)
Since new LE security flags are import, (BTM_SEC_LE_AUTHENTICATED, BTM_SEC_LE_ENCRYPTED,
BTM_SEC_LE_NAME_KNOWN, BTM_SEC_LE_LINK_KEY_KNOWN, BTM_SEC_LE_LINK_KEY_AUTHED),
we have to use new BTM_GetSecurityFlagsByTransport() function with LE transport to get right sec_flag,
or will cause cannot correctly add to white list and cause reconnect fail.

in btif_dm.c (fix HOGP mouse pair issue)
the HOGP mouse will become abnormal if we update connection parameter too many times.
Therefore the is_hid case is not suitable for HOGP mouse,
it will trigger call to L2CA_EnableUpdateBleConnParams() several times due to service discovery and bonded state.
L2CA_EnableUpdateBleConnParams() update connection cause mouse abnormal.
The change will make the flow: complete bonding procedure first, then do service discovery, connect to mouse.

in gap_ble.c (fix HOGP device pair issue)
After pairing status is bonded, host start to create ATT layer to get some information from HOGP device.
If host send "disconnect" command during period. Device will stop to feedback anything.
Suggest to delete it.

in smp_act.c (fix HOGP device pair issue)
update connection parameter too many times may cause mouse abnormal,
so remove this code since this will be called again after service discovery.
Suggest to delete it.

Change-Id: I4b722343c2b08d33530bc6b928bc9ffe89fd09e9
Signed-off-by: Thomas.TT_Lin <Thomas.TT_Lin@htc.com>
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index cf43cc6..7ec5948 100644
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -501,31 +501,34 @@
 static void btif_dm_cb_create_bond(bt_bdaddr_t *bd_addr)
 {
     BOOLEAN is_hid = check_cod(bd_addr, COD_HID_POINTING);
-
-
     bond_state_changed(BT_STATUS_SUCCESS, bd_addr, BT_BOND_STATE_BONDING);
 
-    if (is_hid){
+#if BLE_INCLUDED == TRUE
+    int device_type;
+    int addr_type;
+    bdstr_t bdstr;
+    bd2str(bd_addr, &bdstr);
+    if(btif_config_get_int("Remote", (char const *)&bdstr,"DevType", &device_type) &&
+       (btif_storage_get_remote_addr_type(bd_addr, &addr_type) == BT_STATUS_SUCCESS) &&
+       (device_type == BT_DEVICE_TYPE_BLE))
+    {
+        BTA_DmAddBleDevice(bd_addr->address, addr_type, BT_DEVICE_TYPE_BLE);
+    }
+#endif
 
-            int status;
-            status = btif_hh_connect(bd_addr);
-            if(status != BT_STATUS_SUCCESS)
-                bond_state_changed(status, bd_addr, BT_BOND_STATE_NONE);
+#if BLE_INCLUDED == TRUE
+    if(is_hid && device_type != BT_DEVICE_TYPE_BLE)
+#else
+    if(is_hid)
+#endif
+    {
+        int status;
+        status = btif_hh_connect(bd_addr);
+        if(status != BT_STATUS_SUCCESS)
+            bond_state_changed(status, bd_addr, BT_BOND_STATE_NONE);
     }
     else
     {
-#if BLE_INCLUDED == TRUE
-        int device_type;
-        int addr_type;
-        bdstr_t bdstr;
-        bd2str(bd_addr, &bdstr);
-        if(btif_config_get_int("Remote", (char const *)&bdstr,"DevType", &device_type) &&
-           (btif_storage_get_remote_addr_type(bd_addr, &addr_type) == BT_STATUS_SUCCESS) &&
-           (device_type == BT_DEVICE_TYPE_BLE))
-        {
-            BTA_DmAddBleDevice(bd_addr->address, addr_type, BT_DEVICE_TYPE_BLE);
-        }
-#endif
         BTA_DmBond ((UINT8 *)bd_addr->address);
     }
     /*  Track  originator of bond creation  */