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

Commit cfaaceb8 authored by Dominik Laskowski's avatar Dominik Laskowski
Browse files

SF: Fall back to pacesetter in getDisplayStats

This does not change behavior, because the active display is the same as
the pacesetter for now.

Bug: 255635821
Bug: 277364366
Flag: EXEMPT refactor
Test: presubmit
Change-Id: I2a9be0092f9cc10667d06bdb8bf2f35b8c2b327f
parent e37c04ee
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -1280,21 +1280,15 @@ status_t SurfaceFlinger::getDisplayStats(const sp<IBinder>& displayToken,
        return BAD_VALUE;
    }

    // TODO: b/277364366 - Require a display token from clients and remove fallback to pacesetter.
    std::optional<PhysicalDisplayId> displayIdOpt;
    {
        Mutex::Autolock lock(mStateLock);
    if (displayToken) {
        Mutex::Autolock lock(mStateLock);
        displayIdOpt = getPhysicalDisplayIdLocked(displayToken);
        if (!displayIdOpt) {
            ALOGW("%s: Invalid physical display token %p", __func__, displayToken.get());
            return NAME_NOT_FOUND;
        }
        } else {
            // TODO (b/277364366): Clients should be updated to pass in the display they
            // want, rather than us picking an arbitrary one (the active display, in this
            // case).
            displayIdOpt = mActiveDisplayId;
        }
    }

    const auto schedule = mScheduler->getVsyncSchedule(displayIdOpt);