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

Commit 320d4450 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: 9b89dd7a

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

Change-Id: I39b34b853563baa99c81000106bfb010e10d621b
parents 44767914 9b89dd7a
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;