summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Huihong Luo <huisinro@google.com> 2022-10-07 03:57:34 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-10-07 03:57:34 +0000
commitf05cd7b98b240feed05bbd6138ef36ddfda2969f (patch)
tree94670e9f7793e87d007f444cd610b907146ca84f /libs
parent771334d1aebc857003cf76311da44999fdbe3c87 (diff)
parent25aae731212fd2ae3dfaf82936d655ec3f3d17b4 (diff)
Merge "Remove internal display related methods"
Diffstat (limited to 'libs')
-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);