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

Commit 64a9d12d authored by Haoyu Zhang's avatar Haoyu Zhang
Browse files

[VRR] Set intermittent frame rate category to normal

Bug: 342809376
Test: ViewRootImplTest, PcmarkBenchmark
Flag: android.view.flags.toolkit_frame_rate_by_size_read_only
Change-Id: I9de7f5a2c306eecf52eda1e67077cf91f85698bd
parent 9b00fa04
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -33935,8 +33935,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        int category;
        switch (getViewRootImpl().intermittentUpdateState()) {
            case ViewRootImpl.INTERMITTENT_STATE_INTERMITTENT -> category =
                    (sToolkitFrameRateBySizeReadOnlyFlagValue ? FRAME_RATE_CATEGORY_LOW
                            : FRAME_RATE_CATEGORY_NORMAL) | FRAME_RATE_CATEGORY_REASON_INTERMITTENT;
                    FRAME_RATE_CATEGORY_NORMAL | FRAME_RATE_CATEGORY_REASON_INTERMITTENT;
            case ViewRootImpl.INTERMITTENT_STATE_NOT_INTERMITTENT ->
                    category = mSizeBasedFrameRateCategoryAndReason;
            default -> category = mLastFrameRateCategory;
+3 −6
Original line number Diff line number Diff line
@@ -498,12 +498,9 @@ public class ViewFrameRateTest {
                        toolkitFrameRateDefaultNormalReadOnly() ? FRAME_RATE_CATEGORY_NORMAL
                                : FRAME_RATE_CATEGORY_HIGH;
            } else {
                // intermittent
                // Even though this is not a small View, step 3 is triggered by this flag, which
                // brings intermittent to LOW
                expectedCategory = toolkitFrameRateBySizeReadOnly()
                        ? FRAME_RATE_CATEGORY_LOW
                        : FRAME_RATE_CATEGORY_NORMAL;
                // intermittent.
                // The expected category is normal.
                expectedCategory = FRAME_RATE_CATEGORY_NORMAL;
            }
            mActivityRule.runOnUiThread(() -> {
                mMovingView.invalidate();