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

Commit cb30bb5f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "[SF] Don't crash if HWC returns an unknown config" into rvc-dev am:...

Merge "[SF] Don't crash if HWC returns an unknown config" into rvc-dev am: 9b89dd7a am: 200ccf7d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/11789968

Change-Id: I87057cfb15e68720c232b56f87d7a7137e22032c
parents 8326740a 200ccf7d
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -208,13 +208,17 @@ Error Display::getDisplayVsyncPeriod(nsecs_t* outVsyncPeriod) const {
        *outVsyncPeriod = static_cast<nsecs_t>(vsyncPeriodNanos);
    } else {
        // Get the default vsync period
        HWConfigId configId = 0;
        auto intError_2_1 = mComposer.getActiveConfig(mId, &configId);
        error = static_cast<Error>(intError_2_1);
        if (error == Error::NONE) {
            auto config = mConfigs.at(configId);
            *outVsyncPeriod = config->getVsyncPeriod();
        std::shared_ptr<const Display::Config> config;
        error = getActiveConfig(&config);
        if (error != Error::NONE) {
            return error;
        }
        if (!config) {
            // HWC has updated the display modes and hasn't notified us yet.
            return Error::BAD_CONFIG;
        }

        *outVsyncPeriod = config->getVsyncPeriod();
    }

    return error;