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

Commit 7ccc93a7 authored by Shane's avatar Shane
Browse files

Apply FRAME_RATE_SELECTION_STRATEGY_SELF frame selection strategy

Apply FRAME_RATE_SELECTION_STRATEGY_SELF frame selection strategy to ensure that the frame rate specifications do not cascade down to the descendant layers.

Bug: 313911227
Test: atest ViewRootImplTest
Change-Id: Iea4817c80fa8ee8fa79688392aec49eadbb8a037
parent 1566c668
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2436,6 +2436,19 @@ public final class ViewRootImpl implements ViewParent,
        if (updateBoundsLayer(t)) {
            applyTransactionOnDraw(t);
        }

        // Set the frame rate selection strategy to FRAME_RATE_SELECTION_STRATEGY_SELF
        // This strategy ensures that the frame rate specifications do not cascade down to
        // the descendant layers. This is particularly important for applications like Chrome,
        // where child surfaces should adhere to default behavior instead of no preference
        if (sToolkitSetFrameRateReadOnlyFlagValue) {
            try {
                mFrameRateTransaction.setFrameRateSelectionStrategy(sc,
                        sc.FRAME_RATE_SELECTION_STRATEGY_SELF).applyAsyncUnsafe();
            } catch (Exception e) {
                Log.e(mTag, "Unable to set frame rate selection strategy ", e);
            }
        }
    }

    private void destroySurface() {