Loading core/java/android/view/ViewRootImpl.java +4 −1 Original line number Diff line number Diff line Loading @@ -12792,7 +12792,10 @@ public final class ViewRootImpl implements ViewParent, } private boolean shouldEnableDvrr() { return sToolkitSetFrameRateReadOnlyFlagValue && mIsFrameRatePowerSavingsBalanced; // uncomment this when we are ready for enabling dVRR // return sToolkitSetFrameRateReadOnlyFlagValue && mIsFrameRatePowerSavingsBalanced; return false; } private void checkIdleness() { core/tests/coretests/src/android/view/ViewRootImplTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -462,6 +463,7 @@ public class ViewRootImplTest { */ @UiThreadTest @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_getDefaultValues() { ViewRootImpl viewRootImpl = new ViewRootImpl(sContext, Loading @@ -478,6 +480,7 @@ public class ViewRootImplTest { * Also, mIsFrameRateBoosting should be true when the visibility becomes visible */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled({FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY, FLAG_TOOLKIT_FRAME_RATE_BY_SIZE_READ_ONLY}) public void votePreferredFrameRate_voteFrameRateCategory_visibility_bySize() { Loading Loading @@ -511,6 +514,7 @@ public class ViewRootImplTest { * <7%: FRAME_RATE_CATEGORY_LOW */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled({FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY, FLAG_TOOLKIT_FRAME_RATE_BY_SIZE_READ_ONLY}) public void votePreferredFrameRate_voteFrameRateCategory_smallSize_bySize() { Loading Loading @@ -539,6 +543,7 @@ public class ViewRootImplTest { * >=7% : FRAME_RATE_CATEGORY_NORMAL */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled({FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY, FLAG_TOOLKIT_FRAME_RATE_BY_SIZE_READ_ONLY}) public void votePreferredFrameRate_voteFrameRateCategory_normalSize_bySize() { Loading Loading @@ -571,6 +576,7 @@ public class ViewRootImplTest { * Also, mIsFrameRateBoosting should be true when the visibility becomes visible */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateCategory_visibility_defaultHigh() { View view = new View(sContext); Loading Loading @@ -603,6 +609,7 @@ public class ViewRootImplTest { * <7%: FRAME_RATE_CATEGORY_NORMAL */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateCategory_smallSize_defaultHigh() { View view = new View(sContext); Loading Loading @@ -630,6 +637,7 @@ public class ViewRootImplTest { * >=7% : FRAME_RATE_CATEGORY_HIGH */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateCategory_normalSize_defaultHigh() { View view = new View(sContext); Loading Loading @@ -659,6 +667,7 @@ public class ViewRootImplTest { * It should take the max value among all of the voted categories per frame. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateCategory_aggregate() { View view = new View(sContext); Loading Loading @@ -704,6 +713,7 @@ public class ViewRootImplTest { * prioritize 60Hz.. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRate_aggregate() { View view = new View(sContext); Loading Loading @@ -762,6 +772,7 @@ public class ViewRootImplTest { * submit your preferred choice to the ViewRootImpl. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRate_category() { View view = new View(sContext); Loading Loading @@ -801,6 +812,7 @@ public class ViewRootImplTest { * Also, we shouldn't call setFrameRate. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled({FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY, FLAG_VIEW_VELOCITY_API}) public void votePreferredFrameRate_voteFrameRateCategory_velocityToHigh() { View view = new View(sContext); Loading Loading @@ -832,6 +844,7 @@ public class ViewRootImplTest { * We should boost the frame rate if the value of mInsetsAnimationRunning is true. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_insetsAnimation() { View view = new View(sContext); Loading Loading @@ -868,6 +881,7 @@ public class ViewRootImplTest { * Test FrameRateBoostOnTouchEnabled API */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_frameRateBoostOnTouch() { View view = new View(sContext); Loading Loading @@ -900,6 +914,7 @@ public class ViewRootImplTest { * mPreferredFrameRate should be set to 0. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateTimeOut() throws InterruptedException { final long delay = 200L; Loading Loading @@ -937,6 +952,7 @@ public class ViewRootImplTest { * A View should either vote a frame rate or a frame rate category instead of both. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateOnly() { View view = new View(sContext); Loading Loading @@ -979,6 +995,7 @@ public class ViewRootImplTest { * - otherwise, use the previous category value. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_infrequentLayer_defaultHigh() throws InterruptedException { final long delay = 200L; Loading Loading @@ -1039,6 +1056,7 @@ public class ViewRootImplTest { */ @UiThreadTest @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_isFrameRatePowerSavingsBalanced() { ViewRootImpl viewRootImpl = new ViewRootImpl(sContext, Loading @@ -1056,6 +1074,7 @@ public class ViewRootImplTest { * 2. If FT2-FT1 > 15ms && FT3-FT2 > 15ms -> vote for NORMAL category */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_applyTextureViewHeuristic() throws InterruptedException { final long delay = 30L; Loading Loading
core/java/android/view/ViewRootImpl.java +4 −1 Original line number Diff line number Diff line Loading @@ -12792,7 +12792,10 @@ public final class ViewRootImpl implements ViewParent, } private boolean shouldEnableDvrr() { return sToolkitSetFrameRateReadOnlyFlagValue && mIsFrameRatePowerSavingsBalanced; // uncomment this when we are ready for enabling dVRR // return sToolkitSetFrameRateReadOnlyFlagValue && mIsFrameRatePowerSavingsBalanced; return false; } private void checkIdleness() {
core/tests/coretests/src/android/view/ViewRootImplTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; Loading Loading @@ -462,6 +463,7 @@ public class ViewRootImplTest { */ @UiThreadTest @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_getDefaultValues() { ViewRootImpl viewRootImpl = new ViewRootImpl(sContext, Loading @@ -478,6 +480,7 @@ public class ViewRootImplTest { * Also, mIsFrameRateBoosting should be true when the visibility becomes visible */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled({FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY, FLAG_TOOLKIT_FRAME_RATE_BY_SIZE_READ_ONLY}) public void votePreferredFrameRate_voteFrameRateCategory_visibility_bySize() { Loading Loading @@ -511,6 +514,7 @@ public class ViewRootImplTest { * <7%: FRAME_RATE_CATEGORY_LOW */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled({FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY, FLAG_TOOLKIT_FRAME_RATE_BY_SIZE_READ_ONLY}) public void votePreferredFrameRate_voteFrameRateCategory_smallSize_bySize() { Loading Loading @@ -539,6 +543,7 @@ public class ViewRootImplTest { * >=7% : FRAME_RATE_CATEGORY_NORMAL */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled({FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY, FLAG_TOOLKIT_FRAME_RATE_BY_SIZE_READ_ONLY}) public void votePreferredFrameRate_voteFrameRateCategory_normalSize_bySize() { Loading Loading @@ -571,6 +576,7 @@ public class ViewRootImplTest { * Also, mIsFrameRateBoosting should be true when the visibility becomes visible */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateCategory_visibility_defaultHigh() { View view = new View(sContext); Loading Loading @@ -603,6 +609,7 @@ public class ViewRootImplTest { * <7%: FRAME_RATE_CATEGORY_NORMAL */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateCategory_smallSize_defaultHigh() { View view = new View(sContext); Loading Loading @@ -630,6 +637,7 @@ public class ViewRootImplTest { * >=7% : FRAME_RATE_CATEGORY_HIGH */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateCategory_normalSize_defaultHigh() { View view = new View(sContext); Loading Loading @@ -659,6 +667,7 @@ public class ViewRootImplTest { * It should take the max value among all of the voted categories per frame. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateCategory_aggregate() { View view = new View(sContext); Loading Loading @@ -704,6 +713,7 @@ public class ViewRootImplTest { * prioritize 60Hz.. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRate_aggregate() { View view = new View(sContext); Loading Loading @@ -762,6 +772,7 @@ public class ViewRootImplTest { * submit your preferred choice to the ViewRootImpl. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRate_category() { View view = new View(sContext); Loading Loading @@ -801,6 +812,7 @@ public class ViewRootImplTest { * Also, we shouldn't call setFrameRate. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled({FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY, FLAG_VIEW_VELOCITY_API}) public void votePreferredFrameRate_voteFrameRateCategory_velocityToHigh() { View view = new View(sContext); Loading Loading @@ -832,6 +844,7 @@ public class ViewRootImplTest { * We should boost the frame rate if the value of mInsetsAnimationRunning is true. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_insetsAnimation() { View view = new View(sContext); Loading Loading @@ -868,6 +881,7 @@ public class ViewRootImplTest { * Test FrameRateBoostOnTouchEnabled API */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_frameRateBoostOnTouch() { View view = new View(sContext); Loading Loading @@ -900,6 +914,7 @@ public class ViewRootImplTest { * mPreferredFrameRate should be set to 0. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateTimeOut() throws InterruptedException { final long delay = 200L; Loading Loading @@ -937,6 +952,7 @@ public class ViewRootImplTest { * A View should either vote a frame rate or a frame rate category instead of both. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_voteFrameRateOnly() { View view = new View(sContext); Loading Loading @@ -979,6 +995,7 @@ public class ViewRootImplTest { * - otherwise, use the previous category value. */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_infrequentLayer_defaultHigh() throws InterruptedException { final long delay = 200L; Loading Loading @@ -1039,6 +1056,7 @@ public class ViewRootImplTest { */ @UiThreadTest @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_isFrameRatePowerSavingsBalanced() { ViewRootImpl viewRootImpl = new ViewRootImpl(sContext, Loading @@ -1056,6 +1074,7 @@ public class ViewRootImplTest { * 2. If FT2-FT1 > 15ms && FT3-FT2 > 15ms -> vote for NORMAL category */ @Test @Ignore("Can be enabled only after b/330596920 is ready") @RequiresFlagsEnabled(FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY) public void votePreferredFrameRate_applyTextureViewHeuristic() throws InterruptedException { final long delay = 30L; Loading