Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfea30e5 authored by Hemant Gupta's avatar Hemant Gupta Committed by Matthew Xie
Browse files

PM: Stop Power Manager Timer if in sniff mode - do not merge

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
parent 02afb9ee
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -806,6 +806,16 @@ void bta_dm_pm_btm_status(tBTA_DM_MSG *p_data)
            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;