Power manager timer is started when ACL link is in active mode
depending on profile connected. This timer was never stopped
when link was put in sniff mode by remote device preventing
system from going to sleep since timer is still active resulting
in extra power consumption.
Change-Id: I7569eed3ad7e0487e411377977b4f0671f24df12
break;
#endif
case BTM_PM_STS_SNIFF:
+ if (p_data->pm_status.hci_status == 0)
+ {
+ /* Stop PM timer now if already active for
+ * particular device since link is already
+ * put in sniff mode by remote device, and
+ * PM timer sole purpose is to put the link
+ * in sniff mode from host side.
+ */
+ bta_dm_pm_stop_timer(p_data->pm_status.bd_addr);
+ }
p_dev->info &= ~(BTA_DM_DI_SET_SNIFF|BTA_DM_DI_INT_SNIFF|BTA_DM_DI_ACP_SNIFF);
if (info & BTA_DM_DI_SET_SNIFF)
p_dev->info |= BTA_DM_DI_INT_SNIFF;