SF: Fix display on Pixel 4
* All other devices were fine with the below commit, except Pixel 4
* They're fine with this change too so let's just live with it for now,
till Fold is out or a proper fix is found.
Fixes: 76742845662 ("SF: Fix display mode transitions for multi-display")
Change-Id: Ief3e1730ea0ad23e1aff04a278d5565ad2f05834
diff --git a/services/surfaceflinger/Scheduler/Scheduler.cpp b/services/surfaceflinger/Scheduler/Scheduler.cpp
index 8b1a5d9..727cb08 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.cpp
+++ b/services/surfaceflinger/Scheduler/Scheduler.cpp
@@ -727,7 +727,9 @@
DisplayModePtr Scheduler::getPreferredDisplayMode() {
std::lock_guard<std::mutex> lock(mPolicyLock);
// Make sure the stored mode is up to date.
- mPolicy.mode = chooseDisplayMode().first;
+ if (mPolicy.mode) {
+ mPolicy.mode = chooseDisplayMode().first;
+ }
return mPolicy.mode;
}