Remove internal display related methods
SurfaceFlinger and SurfaceComposerClient simply return the first
connected display as internal display, which is not really correct.
In particular,in the case of dual display for foldable devices, both
displays are marked as Internal determined by calling into HWC2
IComposerClient::getDisplayConnectionType().
Therefore, the concept of internal/external/primary displays is removed
from SurfaceFlinger, and the display manager is the better place to
handle the logics.
flatland is modified to take an extra argument to specify display id,
and error occurs if no display is specified in case of multi-display.
Bug: 241285477
Bug: 242763577
Bug: 74619554
Test: atest libgui_test libsurfaceflinger_unittest SurfaceFlinger_test
Change-Id: Ib6c7e502ef3269c2c60a4e5388e5ac75275f87ed
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp
index 2637f59..3344e0b 100644
--- a/libs/gui/tests/EndToEndNativeInputTest.cpp
+++ b/libs/gui/tests/EndToEndNativeInputTest.cpp
@@ -360,8 +360,10 @@
void SetUp() {
mComposerClient = new SurfaceComposerClient;
ASSERT_EQ(NO_ERROR, mComposerClient->initCheck());
-
- const auto display = mComposerClient->getInternalDisplayToken();
+ const auto ids = SurfaceComposerClient::getPhysicalDisplayIds();
+ ASSERT_FALSE(ids.empty());
+ // display 0 is picked for now, can extend to support all displays if needed
+ const auto display = SurfaceComposerClient::getPhysicalDisplayToken(ids.front());
ASSERT_NE(display, nullptr);
ui::DisplayMode mode;