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

Commit 4f276e36 authored by Adrian Salido's avatar Adrian Salido Committed by android-build-merger
Browse files

SurfaceFlinger: send config event changed on allowed modes change am: ab6ef6c8 am: c69fa8bb

am: 687fca9f

Change-Id: I2d22027914d5c297ab9789d0163af34e88fddccf
parents 9ddfce21 687fca9f
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -5640,8 +5640,20 @@ void SurfaceFlinger::setAllowedDisplayConfigsInternal(const sp<DisplayDevice>& d
        return;
    }

    const auto allowedDisplayConfigs = DisplayConfigs(allowedConfigs.begin(),
                                                      allowedConfigs.end());
    if (allowedDisplayConfigs == mAllowedDisplayConfigs) {
        return;
    }

    ALOGV("Updating allowed configs");
    mAllowedDisplayConfigs = DisplayConfigs(allowedConfigs.begin(), allowedConfigs.end());
    mAllowedDisplayConfigs = std::move(allowedDisplayConfigs);

    // TODO(b/140204874): This hack triggers a notification that something has changed, so
    // that listeners that care about a change in allowed configs can get the notification.
    // Giving current ActiveConfig so that most other listeners would just drop the event
    mScheduler->onConfigChanged(mAppConnectionHandle, display->getId()->value,
                                display->getActiveConfig());

    // Set the highest allowed config by iterating backwards on available refresh rates
    const auto& refreshRates = mRefreshRateConfigs.getRefreshRates();