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 Original line Diff line number Diff line
@@ -5872,12 +5872,15 @@ status_t SurfaceFlinger::getAllowedDisplayConfigs(const sp<IBinder>& displayToke


    Mutex::Autolock lock(mStateLock);
    Mutex::Autolock lock(mStateLock);


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


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

    return NO_ERROR;
    return NO_ERROR;
}
}