power: Don't hint if previous duration covers current duration
Don't hint if previous duration covers current duration, since new short boost may interrupt previous long boost Partially revert commit I977e844935539a4598a749c77f4c0934ca93a2b7 (power: Ignore interaction boost sequence in a short period) Change-Id: Ia2c824683ab148b2bf4d2859cb58e5c2721abe8d
This commit is contained in:
committed by
Michael Bestas
parent
34ce3d3e3b
commit
a91d2dbcb5
@@ -66,6 +66,7 @@ void power_init() {
|
||||
|
||||
void process_interaction_hint(void* data) {
|
||||
static struct timespec s_previous_boost_timespec;
|
||||
static int s_previous_duration = 0;
|
||||
static int prev_interaction_handle = -1;
|
||||
|
||||
struct timespec cur_boost_timespec;
|
||||
@@ -89,7 +90,12 @@ void process_interaction_hint(void* data) {
|
||||
if (elapsed_time < 250000 && duration <= kMinInteractiveDuration) {
|
||||
return;
|
||||
}
|
||||
// also don't hint if previous hint's duration covers this hint's duration
|
||||
if ((s_previous_duration * 1000) > (elapsed_time + duration * 1000)) {
|
||||
return;
|
||||
}
|
||||
s_previous_boost_timespec = cur_boost_timespec;
|
||||
s_previous_duration = duration;
|
||||
|
||||
int interaction_handle =
|
||||
perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);
|
||||
|
||||
Reference in New Issue
Block a user