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

Commit 16dfec1f authored by Ady Abraham's avatar Ady Abraham Committed by Automerger Merge Worker
Browse files

Merge "SF: fix a crash in SurfaceFlinger::setActiveModeInternal" into sc-v2-dev am: 329ed55a

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

Change-Id: I49d0b29899c0c83ad3cf451d1bbe9f37720c0ad1
parents f74a9086 329ed55a
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -1157,6 +1157,12 @@ void SurfaceFlinger::setActiveModeInternal() {
    }
    }


    const auto upcomingModeInfo = MAIN_THREAD_GUARD(display->getUpcomingActiveMode());
    const auto upcomingModeInfo = MAIN_THREAD_GUARD(display->getUpcomingActiveMode());
    if (!upcomingModeInfo.mode) {
        // There is no pending mode change. This can happen if the active
        // display changed and the mode change happened on a different display.
        return;
    }

    if (display->getActiveMode()->getSize() != upcomingModeInfo.mode->getSize()) {
    if (display->getActiveMode()->getSize() != upcomingModeInfo.mode->getSize()) {
        auto& state = mCurrentState.displays.editValueFor(display->getDisplayToken());
        auto& state = mCurrentState.displays.editValueFor(display->getDisplayToken());
        // We need to generate new sequenceId in order to recreate the display (and this
        // We need to generate new sequenceId in order to recreate the display (and this