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

Commit 6e74d301 authored by George Mount's avatar George Mount
Browse files

[VRR] Windowless Snapshot shouldn't vote for frame rate

Fixes: 343755505

The Windowless Snapshot surface doesn't need to use the View
system's voting mechanism. Instead, it should fall back on
SurfaceFlinger's frame rate calculator so that visible Activities
aren't pushed to 120Hz unnecessarily.

Test: manual
Change-Id: I4195549d93818ffb9187401b6f96cff04261ade1
parent 2e67cf72
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -76,6 +76,14 @@ import com.android.window.flags.Flags;
public class SnapshotDrawerUtils {
    private static final String TAG = "SnapshotDrawerUtils";

    /**
     * Used to check if toolkitSetFrameRateReadOnly flag is enabled
     *
     * @hide
     */
    private static boolean sToolkitSetFrameRateReadOnlyFlagValue =
            android.view.flags.Flags.toolkitSetFrameRateReadOnly();

    /**
     * When creating the starting window, we use the exact same layout flags such that we end up
     * with a window with the exact same dimensions etc. However, these flags are not used in layout
@@ -439,6 +447,9 @@ public class SnapshotDrawerUtils {
        layoutParams.setFitInsetsTypes(attrs.getFitInsetsTypes());
        layoutParams.setFitInsetsSides(attrs.getFitInsetsSides());
        layoutParams.setFitInsetsIgnoringVisibility(attrs.isFitInsetsIgnoringVisibility());
        if (sToolkitSetFrameRateReadOnlyFlagValue) {
            layoutParams.setFrameRatePowerSavingsBalanced(false);
        }

        layoutParams.setTitle(title);
        layoutParams.inputFeatures |= INPUT_FEATURE_NO_INPUT_CHANNEL;