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

Commit 4f1dd8ca authored by Dominik Laskowski's avatar Dominik Laskowski
Browse files

SF: Fix getAllowedDisplayConfigs in multi-display mode

DMS does not expect failure for a valid display token, so return an
empty array and avoid log spam.

Bug: 130740549
Test: Boot with multiple displays
Change-Id: I2d385233a53fc726f6d3563edfcebcd76038d934
parent ab54fb71
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -5872,12 +5872,15 @@ status_t SurfaceFlinger::getAllowedDisplayConfigs(const sp<IBinder>& displayToke

    Mutex::Autolock lock(mStateLock);

    if (displayToken != getInternalDisplayTokenLocked()) {
        ALOGE("%s is only supported for the internal display", __FUNCTION__);
    const auto display = getDisplayDeviceLocked(displayToken);
    if (!display) {
        return NAME_NOT_FOUND;
    }

    if (display->isPrimary()) {
        outAllowedConfigs->assign(mAllowedDisplayConfigs.begin(), mAllowedDisplayConfigs.end());
    }

    return NO_ERROR;
}