system/bt
Revision | e05ea5ed112343badf5bd3d5632214b74527eb4d (tree) |
---|---|
Zeit | 2019-06-12 07:01:23 |
Autor | Jakub Pawlowski <jpawlowski@goog...> |
Commiter | android-build-merger |
Revert "Open connection if it doesn't exsist in bta_gattc_process_indicate"
am: 1ae89b7db2
Change-Id: I7dd5e73de79498e378d24140a3ff4790a4138dac
@@ -1240,20 +1240,6 @@ void bta_gattc_process_indicate(uint16_t conn_id, tGATTC_OPTYPE op, | ||
1240 | 1240 | } |
1241 | 1241 | |
1242 | 1242 | tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id); |
1243 | - /* connection not open yet */ | |
1244 | - if (p_clcb == NULL) { | |
1245 | - p_clcb = bta_gattc_clcb_alloc(gatt_if, remote_bda, transport); | |
1246 | - | |
1247 | - if (p_clcb == NULL) { | |
1248 | - LOG(ERROR) << __func__ << ": No resources"; | |
1249 | - return; | |
1250 | - } | |
1251 | - | |
1252 | - p_clcb->bta_conn_id = conn_id; | |
1253 | - p_clcb->transport = transport; | |
1254 | - | |
1255 | - bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_CONN_EVT, NULL); | |
1256 | - } | |
1257 | 1243 | |
1258 | 1244 | notify.handle = handle; |
1259 | 1245 |
@@ -1264,6 +1250,21 @@ void bta_gattc_process_indicate(uint16_t conn_id, tGATTC_OPTYPE op, | ||
1264 | 1250 | |
1265 | 1251 | /* if app registered for the notification */ |
1266 | 1252 | if (bta_gattc_check_notif_registry(p_clrcb, p_srcb, ¬ify)) { |
1253 | + /* connection not open yet */ | |
1254 | + if (p_clcb == NULL) { | |
1255 | + p_clcb = bta_gattc_clcb_alloc(gatt_if, remote_bda, transport); | |
1256 | + | |
1257 | + if (p_clcb == NULL) { | |
1258 | + LOG(ERROR) << "No resources"; | |
1259 | + return; | |
1260 | + } | |
1261 | + | |
1262 | + p_clcb->bta_conn_id = conn_id; | |
1263 | + p_clcb->transport = transport; | |
1264 | + | |
1265 | + bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_CONN_EVT, NULL); | |
1266 | + } | |
1267 | + | |
1267 | 1268 | if (p_clcb != NULL) |
1268 | 1269 | bta_gattc_proc_other_indication(p_clcb, op, p_data, ¬ify); |
1269 | 1270 | } |