Loading core/java/android/view/ViewRootImpl.java +5 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } } Loading Loading @@ -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); } } Loading Loading @@ -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; core/tests/coretests/src/android/view/ViewFrameRateTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -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( Loading @@ -146,6 +146,7 @@ public class ViewFrameRateTest { mActivityRule.runOnUiThread(() -> { assertFalse(mViewRoot.getIsTouchBoosting()); assertFalse(mViewRoot.getIsFrameRateBoosting()); }); } Loading Loading
core/java/android/view/ViewRootImpl.java +5 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } } Loading Loading @@ -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); } } Loading Loading @@ -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;
core/tests/coretests/src/android/view/ViewFrameRateTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -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( Loading @@ -146,6 +146,7 @@ public class ViewFrameRateTest { mActivityRule.runOnUiThread(() -> { assertFalse(mViewRoot.getIsTouchBoosting()); assertFalse(mViewRoot.getIsFrameRateBoosting()); }); } Loading