summaryrefslogtreecommitdiff
path: root/cmds/bootanimation/BootAnimation.h
diff options
context:
space:
mode:
authorDamien Bargiacchi <drb@google.com>2016-03-29 14:55:55 -0700
committerDamien Bargiacchi <drb@google.com>2016-05-12 17:01:59 -0700
commit9748086fe267e21d243a49df1775905094a28dd9 (patch)
treee8e42b4b282f9ad5297ee44c925fa6e18763f06f /cmds/bootanimation/BootAnimation.h
parent085933cc8fa0b06d28161ddc001c20282012f263 (diff)
Check clock accuracy before attempting to display clock
The RTC may not be set yet, may have been reset, or may have drifted significantly if the device time hasn't been updated in a long time. Using the the last_time_change file to determine if the time is known to be accurate and only display the clock when that is the case. Bug: 27802041 Change-Id: I845cf9c74fcb4009504f1bab853e04146fa19e1d
Diffstat (limited to 'cmds/bootanimation/BootAnimation.h')
-rw-r--r--cmds/bootanimation/BootAnimation.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/cmds/bootanimation/BootAnimation.h b/cmds/bootanimation/BootAnimation.h
index d49e1ec837b9..1c3d53a59bb8 100644
--- a/cmds/bootanimation/BootAnimation.h
+++ b/cmds/bootanimation/BootAnimation.h
@@ -51,6 +51,24 @@ private:
virtual void onFirstRef();
virtual void binderDied(const wp<IBinder>& who);
+ bool updateIsTimeAccurate();
+
+ class TimeCheckThread : public Thread {
+ public:
+ TimeCheckThread(BootAnimation* bootAnimation);
+ virtual ~TimeCheckThread();
+ private:
+ virtual status_t readyToRun();
+ virtual bool threadLoop();
+ bool doThreadLoop();
+ void addTimeDirWatch();
+
+ int mInotifyFd;
+ int mSystemWd;
+ int mTimeWd;
+ BootAnimation* mBootAnimation;
+ };
+
struct Texture {
GLint w;
GLint h;
@@ -113,8 +131,10 @@ private:
sp<SurfaceControl> mFlingerSurfaceControl;
sp<Surface> mFlingerSurface;
bool mClockEnabled;
+ bool mTimeIsAccurate;
String8 mZipFileName;
SortedVector<String8> mLoadedFiles;
+ sp<TimeCheckThread> mTimeCheckThread;
};
// ---------------------------------------------------------------------------