Merge "Skip record layer when setting category on MRR" into main
diff --git a/services/surfaceflinger/Scheduler/Scheduler.cpp b/services/surfaceflinger/Scheduler/Scheduler.cpp
index 7968096..32279ae 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.cpp
+++ b/services/surfaceflinger/Scheduler/Scheduler.cpp
@@ -675,7 +675,13 @@
 
 void Scheduler::recordLayerHistory(int32_t id, const LayerProps& layerProps, nsecs_t presentTime,
                                    nsecs_t now, LayerHistory::LayerUpdateType updateType) {
-    if (pacesetterSelectorPtr()->canSwitch()) {
+    const auto& selectorPtr = pacesetterSelectorPtr();
+    // Skip recording layer history on LayerUpdateType::SetFrameRate for MRR devices when the
+    // dVRR vote types are guarded (disabled) for MRR. This is to avoid activity when setting dVRR
+    // vote types.
+    if (selectorPtr->canSwitch() &&
+        (updateType != LayerHistory::LayerUpdateType::SetFrameRate ||
+         layerProps.setFrameRateVote.isVoteValidForMrr(selectorPtr->isVrrDevice()))) {
         mLayerHistory.record(id, layerProps, presentTime, now, updateType);
     }
 }