fix(bt/bluedroid): flushed all the DM PM at the end of SPP deinit

This commit is contained in:
Jin Cheng
2026-03-27 10:51:30 +08:00
parent 8a289d2c78
commit a8304b772f
2 changed files with 14 additions and 6 deletions
@@ -747,7 +747,20 @@ void bta_jv_disable (tBTA_JV_MSG *p_data)
{
tBTA_JV_STATUS evt_data;
evt_data = BTA_JV_SUCCESS;
// UNUSED(p_data);
// clear all the pm_cb slots
for (int i = 0; i < BTA_JV_PM_MAX_NUM; i++) {
if (bta_jv_cb.pm_cb[i].state != BTA_JV_PM_FREE_ST) {
bta_jv_clear_pm_cb(&bta_jv_cb.pm_cb[i], TRUE);
}
}
// reset the control block
memset(&bta_jv_cb, 0, sizeof(tBTA_JV_CB));
for (int i = 0; i < BTA_JV_PM_MAX_NUM; i++) {
bta_jv_cb.pm_cb[i].handle = BTA_JV_PM_HANDLE_CLEAR;
}
if (p_data->disable.p_cback) {
p_data->disable.p_cback(BTA_JV_DISABLE_EVT, (tBTA_JV *)&evt_data, NULL);
}
@@ -126,11 +126,6 @@ void BTA_JvDisable(tBTA_JV_RFCOMM_CBACK *p_cback)
APPL_TRACE_API( "BTA_JvDisable");
bta_sys_deregister(BTA_ID_JV);
memset(&bta_jv_cb, 0, sizeof(tBTA_JV_CB));
/* set handle to invalid value by default */
for (int i = 0; i < BTA_JV_PM_MAX_NUM; i++) {
bta_jv_cb.pm_cb[i].handle = BTA_JV_PM_HANDLE_CLEAR;
}
if ((p_buf = (tBTA_JV_API_DISABLE *) osi_malloc(sizeof(tBTA_JV_API_DISABLE))) != NULL) {
p_buf->hdr.event = BTA_JV_API_DISABLE_EVT;
p_buf->p_cback = p_cback;