Update LayerHistory layer properties when they change
Previously we would only update LayerHistory when framerate
changed or there was a buffer update. This occasionally lead to
an incorrect frame rate being calculated with stale data. Fix this
by updating layer properties when ever they change.
Fixes: 306710286, 306716374
Test: presubmit
Test: atest CtsSurfaceControlTests CtsSurfaceControlTestsStaging
Test: displays runs at 60fps when maps is running after screenrotation
Change-Id: I14388ca69eb6f940c436f88d55cff689e51bc238
diff --git a/services/surfaceflinger/Scheduler/LayerInfo.h b/services/surfaceflinger/Scheduler/LayerInfo.h
index 03ab0df..d24fc33 100644
--- a/services/surfaceflinger/Scheduler/LayerInfo.h
+++ b/services/surfaceflinger/Scheduler/LayerInfo.h
@@ -182,6 +182,8 @@
// layer can go back to whatever vote it had before the app voted for it.
void setDefaultLayerVote(LayerHistory::LayerVoteType type) { mDefaultVote = type; }
+ void setProperties(const LayerProps&);
+
// Resets the layer vote to its default.
void resetLayerVote() {
mLayerVote = {mDefaultVote, Fps(), Seamlessness::Default, FrameRateCategory::Default};