fix uninitialization issue in JankTracker
We should initialize mSwapDeadline in JankTracker, or it can be a very
large randomized value and then makes jank tracker not collect concrete
jank type of frames appropriately as expected.
Bug: 161656795
Test: run cts -m CtsIncidentHostTestCases -t
com.android.server.cts.GraphicsStatsValidationTest#testJankyDrawFrame
Change-Id: I057a50a74502918619204f9164f6a954f8e9c5de
diff --git a/libs/hwui/JankTracker.h b/libs/hwui/JankTracker.h
index 4460266..b3fbbfe 100644
--- a/libs/hwui/JankTracker.h
+++ b/libs/hwui/JankTracker.h
@@ -75,7 +75,7 @@
std::array<int64_t, NUM_BUCKETS> mThresholds;
int64_t mFrameInterval;
- nsecs_t mSwapDeadline;
+ nsecs_t mSwapDeadline = -1;
// The amount of time we will erase from the total duration to account
// for SF vsync offsets with HWC2 blocking dequeueBuffers.
// (Vsync + mDequeueBlockTolerance) is the point at which we expect