summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Huihong Luo <huisinro@google.com> 2022-09-26 11:45:43 -0700
committer Huihong Luo <huisinro@google.com> 2022-09-26 18:48:16 +0000
commit25aae731212fd2ae3dfaf82936d655ec3f3d17b4 (patch)
treef7e60d7b28f553ce4a09d0b5fd8a1572061ebc51
parent82839ebcfc80ff5938e58bdbf7d863af8af11fd0 (diff)
Remove internal display related methods
Sync with changes made in SurfaceFlinger and SurfaceComposerClient. Use the first display from the display list returned from SurfaceComposerClient. Bug: 241285477 Test: run libhwui test Change-Id: I0c76d66338bb3f6d69dc3d829d438ffd2a4462a6
-rw-r--r--libs/hwui/tests/common/TestContext.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/hwui/tests/common/TestContext.cpp b/libs/hwui/tests/common/TestContext.cpp
index 898c64bd4159..0faa8f4f6cc9 100644
--- a/libs/hwui/tests/common/TestContext.cpp
+++ b/libs/hwui/tests/common/TestContext.cpp
@@ -28,7 +28,10 @@ const ui::StaticDisplayInfo& getDisplayInfo() {
#if HWUI_NULL_GPU
info.density = 2.f;
#else
- const sp<IBinder> token = SurfaceComposerClient::getInternalDisplayToken();
+ const std::vector<PhysicalDisplayId> ids = SurfaceComposerClient::getPhysicalDisplayIds();
+ LOG_ALWAYS_FATAL_IF(ids.empty(), "%s: No displays", __FUNCTION__);
+
+ const sp<IBinder> token = SurfaceComposerClient::getPhysicalDisplayToken(ids.front());
LOG_ALWAYS_FATAL_IF(!token, "%s: No internal display", __FUNCTION__);
const status_t status = SurfaceComposerClient::getStaticDisplayInfo(token, &info);
@@ -48,7 +51,10 @@ const ui::DisplayMode& getActiveDisplayMode() {
config.xDpi = config.yDpi = 320.f;
config.refreshRate = 60.f;
#else
- const sp<IBinder> token = SurfaceComposerClient::getInternalDisplayToken();
+ const std::vector<PhysicalDisplayId> ids = SurfaceComposerClient::getPhysicalDisplayIds();
+ LOG_ALWAYS_FATAL_IF(ids.empty(), "%s: No displays", __FUNCTION__);
+
+ const sp<IBinder> token = SurfaceComposerClient::getPhysicalDisplayToken(ids.front());
LOG_ALWAYS_FATAL_IF(!token, "%s: No internal display", __FUNCTION__);
const status_t status = SurfaceComposerClient::getActiveDisplayMode(token, &config);