Whenever a device has more than 1 ACL link active and transferring
data on one of its links via PAN, HH or JV (RFCOMM) the sys busy/idle
state toggles frequently. To avoid triggering role switches for each
of these events we filter this out and let the other SYS events handle
it in combination with other role policy management code. Ideally we
should revert the toggling to properly reflect the busy/idle state of
each profile but to limit risk of side effects at this stage we will
make this intermittent change.
This also affects audio streaming in certain cases.
Bug:
24570959,
25129209
Change-Id: I141e17ee069c82624e153fd8de5db90ae93724b9
*******************************************************************************/
static void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
{
-
UINT8 j;
tBTA_PREF_ROLES role;
tBTA_DM_PEER_DEVICE *p_dev;
APPL_TRACE_WARNING("bta_dm_rm_cback:%d, status:%d", bta_dm_cb.cur_av_count, status);
}
- bta_dm_adjust_roles(FALSE);
+ /* Don't adjust roles for each busy/idle state transition to avoid
+ excessive switch requests when individual profile busy/idle status
+ changes */
+ if ((status != BTA_SYS_CONN_BUSY) && (status != BTA_SYS_CONN_IDLE))
+ bta_dm_adjust_roles(FALSE);
}
/*******************************************************************************