summaryrefslogtreecommitdiff
path: root/libs/hwui/DeviceInfo.cpp
diff options
context:
space:
mode:
authorDominik Laskowski <domlaskowski@google.com>2019-01-25 02:56:41 -0800
committerDominik Laskowski <domlaskowski@google.com>2019-02-04 10:06:15 -0800
commit3316a0a08e79739b0508087232efcb3f2803dafe (patch)
tree90ae4e9f996c661ed2ec25b4ba2fa9075a877b8a /libs/hwui/DeviceInfo.cpp
parent1ba86936a955ef4e3206d8e862ce4f1b4550c2e5 (diff)
Generalize physical display management
This CL enables the framework to manage an arbitrary number of physical displays. It also surfaces physical display IDs, which are stable across reboots and encode (model, port) information that will be propagated further up in a follow-up CL. Bug: 116025192 Test: Boot with more than two displays Test: Hotplug works with any number of displays Test: Verify stable display IDs with "dumpsys display" Change-Id: Idb2eaff66b2e0873be6ad27d337ff18b730d1331
Diffstat (limited to 'libs/hwui/DeviceInfo.cpp')
-rw-r--r--libs/hwui/DeviceInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/hwui/DeviceInfo.cpp b/libs/hwui/DeviceInfo.cpp
index 4c675133a6c1..cf5d7ce3f738 100644
--- a/libs/hwui/DeviceInfo.cpp
+++ b/libs/hwui/DeviceInfo.cpp
@@ -55,9 +55,12 @@ DisplayInfo QueryDisplayInfo() {
return sDummyDisplay;
}
+ const sp<IBinder> token = SurfaceComposerClient::getInternalDisplayToken();
+ LOG_ALWAYS_FATAL_IF(token == nullptr,
+ "Failed to get display info because internal display is disconnected");
+
DisplayInfo displayInfo;
- sp<IBinder> dtoken(SurfaceComposerClient::getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain));
- status_t status = SurfaceComposerClient::getDisplayInfo(dtoken, &displayInfo);
+ status_t status = SurfaceComposerClient::getDisplayInfo(token, &displayInfo);
LOG_ALWAYS_FATAL_IF(status, "Failed to get display info, error %d", status);
return displayInfo;
}