Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7671d83 authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: return the active display from getInternalDisplayId

So clients that uses SurfaceComposerClient::getInternalDisplayId
such as screenrecord would get the current active display

Test: screenrecord
Bug: 193821864
Bug: 199336728
Change-Id: Ief856c736c78ab9ddca3c4ffccd8e374c050b0bd
Merged-In: Ief856c736c78ab9ddca3c4ffccd8e374c050b0bd
parent 85f88c49
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -619,17 +619,17 @@ void SurfaceFlinger::releaseVirtualDisplay(VirtualDisplayId displayId) {
}

std::vector<PhysicalDisplayId> SurfaceFlinger::getPhysicalDisplayIdsLocked() const {
    const auto internalDisplayId = getInternalDisplayIdLocked();
    if (!internalDisplayId) {
    const auto display = getDefaultDisplayDeviceLocked();
    if (!display) {
        return {};
    }

    std::vector<PhysicalDisplayId> displayIds;
    displayIds.reserve(mPhysicalDisplayTokens.size());
    displayIds.push_back(*internalDisplayId);
    displayIds.push_back(display->getPhysicalId());

    for (const auto& [id, token] : mPhysicalDisplayTokens) {
        if (id != *internalDisplayId) {
        if (id != display->getPhysicalId()) {
            displayIds.push_back(id);
        }
    }