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

Commit aa3f5ae9 authored by Marin Shalamanov's avatar Marin Shalamanov Committed by Automerger Merge Worker
Browse files

Merge "[SF] When content detection is off layer should have NoVote" into sc-dev am: 0d3d1feb

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

Change-Id: I01a79869260a00f4bace4f3c1b4d383e87ef748d
parents c811cc97 0d3d1feb
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -583,13 +583,9 @@ void Scheduler::registerLayer(Layer* layer) {

    scheduler::LayerHistory::LayerVoteType voteType;

    if (layer->getWindowType() == InputWindowInfo::Type::STATUS_BAR) {
    if (!mOptions.useContentDetection ||
        layer->getWindowType() == InputWindowInfo::Type::STATUS_BAR) {
        voteType = scheduler::LayerHistory::LayerVoteType::NoVote;
    } else if (!mOptions.useContentDetection) {
        // If the content detection feature is off, all layers are registered at Max. We still keep
        // the layer history, since we use it for other features (like Frame Rate API), so layers
        // still need to be registered.
        voteType = scheduler::LayerHistory::LayerVoteType::Max;
    } else if (layer->getWindowType() == InputWindowInfo::Type::WALLPAPER) {
        // Running Wallpaper at Min is considered as part of content detection.
        voteType = scheduler::LayerHistory::LayerVoteType::Min;
@@ -597,6 +593,9 @@ void Scheduler::registerLayer(Layer* layer) {
        voteType = scheduler::LayerHistory::LayerVoteType::Heuristic;
    }

    // If the content detection feature is off, we still keep the layer history,
    // since we use it for other features (like Frame Rate API), so layers
    // still need to be registered.
    mLayerHistory->registerLayer(layer, voteType);
}