diff options
author | 2021-09-09 09:37:48 -0700 | |
---|---|---|
committer | 2021-09-10 13:56:32 +0000 | |
commit | 346312c1f588fe582561049999fa60d69e86ae64 (patch) | |
tree | c142b22f09d5bc40193af49155e0c79fd95a1694 /libs/hwui/FrameMetricsObserver.h | |
parent | c813fed67b8480bf157c0b495dcba0462304602f (diff) |
Make sure fields are initialized before access
We initialize mSurfaceControlId and mAttachedFrameNumber in the
constructor to assure they'll always give consistent values
when read.
Test: TreeHugger
Bug: 195699687
Change-Id: I471b402e4654a0c02082109d8828ad6b59085f13
Diffstat (limited to 'libs/hwui/FrameMetricsObserver.h')
-rw-r--r-- | libs/hwui/FrameMetricsObserver.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/hwui/FrameMetricsObserver.h b/libs/hwui/FrameMetricsObserver.h index 498ec5793cab..3ea49518eecd 100644 --- a/libs/hwui/FrameMetricsObserver.h +++ b/libs/hwui/FrameMetricsObserver.h @@ -45,7 +45,10 @@ public: * WARNING! This observer may not receive metrics for the last several frames that the app * produces. */ - FrameMetricsObserver(bool waitForPresentTime) : mWaitForPresentTime(waitForPresentTime) {} + FrameMetricsObserver(bool waitForPresentTime) + : mWaitForPresentTime(waitForPresentTime) + , mSurfaceControlId(INT32_MAX) + , mAttachedFrameNumber(UINT64_MAX) {} private: const bool mWaitForPresentTime; |