qdutils: idle_invalidator: Use fixed timeout rather than range
Currently the idle timeout is in a range from idle_timeout / 2
to idle_timeout, since we didn't need precise values.
Change this to a fixed value using timestamps, because the timeout
is too low and warrants precision.
Change-Id: I9cec1db7f1d7fda2996ab80449c61269915f6be4
diff --git a/libqdutils/idle_invalidator.h b/libqdutils/idle_invalidator.h
index abd9b29..f41c15e 100644
--- a/libqdutils/idle_invalidator.h
+++ b/libqdutils/idle_invalidator.h
@@ -38,6 +38,7 @@
class IdleInvalidator : public android::Thread {
void *mHwcContext;
+ struct timeval mLastUpdateTime;
bool mSleepAgain;
unsigned int mSleepTime;
static InvalidatorHandler mHandler;
@@ -49,7 +50,7 @@
/* init timer obj */
int init(InvalidatorHandler reg_handler, void* user_data, unsigned int
idleSleepTime);
- void markForSleep();
+ void handleUpdateEvent();
/*Overrides*/
virtual bool threadLoop();
virtual int readyToRun();