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

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

Merge "SF: fix a crash in SurfaceFlinger::setActiveModeInternal" into...

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

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

Change-Id: I7427a06da93f647f5bbeab13c1beb4fd2d3ed542
parents f479c3ef 16dfec1f
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