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

Commit 6d6cfa49 authored by Ady Abraham's avatar Ady Abraham Committed by android-build-merger
Browse files

SurfaceFlinger: lock mStateLock when modifying allowed configs

am: abf91060

Change-Id: Id6ec56a597601d185324a52b5369d054bc57a151
parents e83f01fe abf91060
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -6236,7 +6236,7 @@ status_t SurfaceFlinger::setAllowedDisplayConfigs(const sp<IBinder>& displayToke
        return NO_ERROR;
    }

    postMessageSync(new LambdaMessage([&]() NO_THREAD_SAFETY_ANALYSIS {
    postMessageSync(new LambdaMessage([&]() {
        const auto display = getDisplayDeviceLocked(displayToken);
        if (!display) {
            ALOGE("Attempt to set allowed display configs for invalid display token %p",
@@ -6244,6 +6244,7 @@ status_t SurfaceFlinger::setAllowedDisplayConfigs(const sp<IBinder>& displayToke
        } else if (display->isVirtual()) {
            ALOGW("Attempt to set allowed display configs for virtual display");
        } else {
            Mutex::Autolock lock(mStateLock);
            setAllowedDisplayConfigsInternal(display, allowedConfigs);
        }
    }));