diff options
author | Adrian Salido <salidoa@google.com> | 2019-08-28 10:02:49 -0700 |
---|---|---|
committer | Adrian Salido <salidoa@google.com> | 2019-08-28 18:02:32 -0700 |
commit | ab6ef6c8871506317dc7ada75707c19963daabe4 (patch) | |
tree | bc0d72669b1aaf315701aa8a19bbed4da0983635 | |
parent | 575149f8f04136759e34d298966dd5e9a84b1cde (diff) | |
download | native-ab6ef6c8871506317dc7ada75707c19963daabe4.tar.gz |
SurfaceFlinger: send config event changed on allowed modes change
Provide a notification whenever allowed display configurations have
changed, this allows Display Event Receivers to be aware of a change in
allowed configs.
Bug: 139487676
Change-Id: Ida73391c350989be595f55ff8e1d9d2cc70c0276
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index b31bc3813a..ab22cd9016 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -6175,8 +6175,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(); |