summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdy Abraham <adyabr@google.com>2021-08-31 16:27:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-08-31 16:27:29 +0000
commit66a59c3ebfa3572f11758731cda7296541767b5e (patch)
tree8c8f1aabfb46b8c85d75d4f4e07e072cdbdce3c7
parent1f251f134e9d3ca2f2a706d4ee13919de412373d (diff)
parent71c8a95838a45fa12fa2aa519a0700186202a315 (diff)
downloadnative-66a59c3ebfa3572f11758731cda7296541767b5e.tar.gz
Merge "SF: fix a bug with DISPLAY_EVENT_MODE_CHANGE" into sc-qpr1-dev
-rw-r--r--services/surfaceflinger/Scheduler/Scheduler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/services/surfaceflinger/Scheduler/Scheduler.cpp b/services/surfaceflinger/Scheduler/Scheduler.cpp
index e0b364020b..64ad178b26 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.cpp
+++ b/services/surfaceflinger/Scheduler/Scheduler.cpp
@@ -386,6 +386,13 @@ void Scheduler::dispatchCachedReportedMode() {
}
const auto modeId = *mFeatures.modeId;
+ // If the modeId is not the current mode, this means that a
+ // mode change is in progress. In that case we shouldn't dispatch an event
+ // as it will be dispatched when the current mode changes.
+ if (mRefreshRateConfigs.getCurrentRefreshRate().getModeId() != modeId) {
+ return;
+ }
+
const auto vsyncPeriod = mRefreshRateConfigs.getRefreshRateFromModeId(modeId).getVsyncPeriod();
// If there is no change from cached mode, there is no need to dispatch an event