summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 04b49325d2..abb8bafcdf 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -8305,8 +8305,16 @@ status_t SurfaceFlinger::setDesiredDisplayModeSpecsInternal(
// TODO(b/140204874): Leave the event in until we do proper testing with all apps that might
// be depending in this callback.
const auto activeMode = display->getActiveMode();
+ auto activeModeWidth = activeMode->getWidth();
+ auto activeModeHeight = activeMode->getHeight();
+ auto defaultModeWidth = (display->getMode(currentPolicy.defaultMode))->getWidth();
+ auto defaultModeHeight = (display->getMode(currentPolicy.defaultMode))->getHeight();
if (isDisplayActiveLocked(display)) {
- mScheduler->onPrimaryDisplayModeChanged(mAppConnectionHandle, display->getMode(currentPolicy.defaultMode));
+ if ((activeModeWidth == defaultModeWidth) && (activeModeHeight == defaultModeHeight)) {
+ mScheduler->onPrimaryDisplayModeChanged(mAppConnectionHandle, activeMode);
+ } else {
+ mScheduler->onPrimaryDisplayModeChanged(mAppConnectionHandle, display->getMode(currentPolicy.defaultMode));
+ }
toggleKernelIdleTimer();
} else {
mScheduler->onNonPrimaryDisplayModeChanged(mAppConnectionHandle, activeMode);