From a09dac5dad4f855c4c3e176b51f8e5cb0f76725e Mon Sep 17 00:00:00 2001 From: Adrian Salido Date: Tue, 11 Jul 2017 14:02:30 -0700 Subject: [PATCH] Power: Fix interaction boost calculation Interaction handler has a check to ignore duplicate interaction requests if previous covers current one. However the previous request could finish early if idle is detected, need to account for this condition. Bug: 63116225 Change-Id: I1a128eb8fe3c2a3daa7f48bc73cd5f07d5b1ae5b --- power/InteractionHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/power/InteractionHandler.cpp b/power/InteractionHandler.cpp index 8fec7817..ac00514f 100644 --- a/power/InteractionHandler.cpp +++ b/power/InteractionHandler.cpp @@ -148,7 +148,7 @@ void InteractionHandler::Acquire(int32_t duration) { struct timespec cur_timespec; clock_gettime(CLOCK_MONOTONIC, &cur_timespec); - if (finalDuration <= mDurationMs) { + if (mState != INTERACTION_STATE_IDLE && finalDuration <= mDurationMs) { long long elapsed_time = CalcTimespecDiffMs(mLastTimespec, cur_timespec); // don't hint if previous hint's duration covers this hint's duration if (elapsed_time <= (mDurationMs - finalDuration)) {