SF: Reject hotplug if display modes failed to load
Do not abort if the repeated attempts to query the display modes and
active mode fail, which could happen if HWC disconnected the display
but the disconnect event has not yet been processed.
Bug: 241286153
Bug: 235488695
Test: HotplugTest.rejectsHotplugIfFailedToLoadDisplayModes
Change-Id: I0997a502dc88a28f993f51a8ef23aeac17694b90
diff --git a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
index 407706d..d7e6462 100644
--- a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
+++ b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h
@@ -371,6 +371,10 @@
mFlinger->onComposerHalHotplug(hwcDisplayId, connection);
}
+ void processDisplayHotplugEvents() {
+ FTL_FAKE_GUARD(mFlinger->mStateLock, mFlinger->processDisplayHotplugEventsLocked());
+ }
+
auto setDisplayStateLocked(const DisplayState& s) {
Mutex::Autolock lock(mFlinger->mStateLock);
return mFlinger->setDisplayStateLocked(s);
@@ -500,7 +504,9 @@
const auto& currentState() const { return mFlinger->mCurrentState; }
const auto& drawingState() const { return mFlinger->mDrawingState; }
const auto& transactionFlags() const { return mFlinger->mTransactionFlags; }
+
const auto& hwcPhysicalDisplayIdMap() const { return getHwComposer().mPhysicalDisplayIdMap; }
+ const auto& hwcDisplayData() const { return getHwComposer().mDisplayData; }
auto& mutableHasWideColorDisplay() { return SurfaceFlinger::hasWideColorDisplay; }