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

Commit cbaffa72 authored by Jian-Syuan (Shane) Wong's avatar Jian-Syuan (Shane) Wong Committed by Android (Google) Code Review
Browse files

Merge "[VRR] Disable frame rate boosting with content velocity" into main

parents de73e3dd ea5a1ef4
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1110,6 +1110,8 @@ public final class ViewRootImpl implements ViewParent,
            FRAME_RATE_COMPATIBILITY_FIXED_SOURCE;
    // time for touch boost period.
    private static final int FRAME_RATE_TOUCH_BOOST_TIME = 3000;
    // Timeout for the other frame rate boosts other than touch boost.
    private static final int FRAME_RATE_BOOST_TIME = 3000;
    // time for evaluating the interval between current time and
    // the time when frame rate was set previously.
    private static final int FRAME_RATE_SETTING_REEVALUATE_TIME = 100;
@@ -3453,7 +3455,7 @@ public final class ViewRootImpl implements ViewParent,
            if (shouldEnableDvrr() && viewVisibility == View.VISIBLE) {
                // Boost frame rate when the viewVisibility becomes true.
                // This is mainly for lanuchers that lanuch new windows.
                boostFrameRate(FRAME_RATE_TOUCH_BOOST_TIME);
                boostFrameRate(FRAME_RATE_BOOST_TIME);
            }
        }
@@ -4185,7 +4187,7 @@ public final class ViewRootImpl implements ViewParent,
            if (shouldEnableDvrr()) {
                // Boost the frame rate when the ViewRootImpl first becomes available.
                boostFrameRate(FRAME_RATE_TOUCH_BOOST_TIME);
                boostFrameRate(FRAME_RATE_BOOST_TIME);
            }
        }
@@ -12975,6 +12977,7 @@ public final class ViewRootImpl implements ViewParent,
        }
        if (frameRateCompatibility == FRAME_RATE_COMPATIBILITY_GTE) {
            mIsTouchBoosting = false;
            mIsFrameRateBoosting = false;
            if (!sToolkitFrameRateVelocityMappingReadOnlyFlagValue) {
                mPreferredFrameRateCategory = FRAME_RATE_CATEGORY_HIGH;
                mFrameRateCategoryHighCount = FRAME_RATE_CATEGORY_COUNT;
+2 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public class ViewFrameRateTest {

    @Test
    @RequiresFlagsEnabled(FLAG_VIEW_VELOCITY_API)
    public void touchBoostDisable() throws Throwable {
    public void frameBoostDisable() throws Throwable {
        mActivityRule.runOnUiThread(() -> {
            long now = SystemClock.uptimeMillis();
            MotionEvent down = MotionEvent.obtain(
@@ -146,6 +146,7 @@ public class ViewFrameRateTest {

        mActivityRule.runOnUiThread(() -> {
            assertFalse(mViewRoot.getIsTouchBoosting());
            assertFalse(mViewRoot.getIsFrameRateBoosting());
        });
    }