[sf-newfe] update default frame rate compatibility
Bug: 300701739
Test: presubmit
Change-Id: I3dbfd8d7ef6fe801d4d750c1828d09da511ce283
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3f52444..4d8dc94 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2205,8 +2205,12 @@
void SurfaceFlinger::updateLayerHistory(const frontend::LayerSnapshot& snapshot) {
using Changes = frontend::RequestedLayerState::Changes;
- if (snapshot.path.isClone() ||
- !snapshot.changes.any(Changes::FrameRate | Changes::Buffer | Changes::Animation)) {
+ if (snapshot.path.isClone()) {
+ return;
+ }
+
+ if (!snapshot.changes.any(Changes::FrameRate | Changes::Buffer | Changes::Animation) &&
+ (snapshot.clientChanges & layer_state_t::eDefaultFrameRateCompatibilityChanged) == 0) {
return;
}
@@ -2226,6 +2230,11 @@
it->second->recordLayerHistoryAnimationTx(layerProps);
}
+ if (snapshot.clientChanges & layer_state_t::eDefaultFrameRateCompatibilityChanged) {
+ mScheduler->setDefaultFrameRateCompatibility(snapshot.sequence,
+ snapshot.defaultFrameRateCompatibility);
+ }
+
if (snapshot.changes.test(Changes::FrameRate)) {
it->second->setFrameRateForLayerTree(snapshot.frameRate, layerProps);
}