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

Commit 5c9f0b4c authored by shane's avatar shane
Browse files

[ARR] Add debugging messages

Add debugging messages to help developers to understand the votes from
Views and ViewRootImpls.

Flag: android.view.flags.toolkit_frame_rate_debug
Bug: 394614443
Test: atest ViewFrameRateTest / atest ViewRootImplTest
Change-Id: If8800925354c7c2b461fe9618df21ab08ee4f0d2
parent 74f42854
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ import static android.view.flags.Flags.addSchandleToVriSurface;
import static android.view.flags.Flags.disableDrawWakeLock;
import static android.view.flags.Flags.sensitiveContentAppProtection;
import static android.view.flags.Flags.sensitiveContentPrematureProtectionRemovedFix;
import static android.view.flags.Flags.toolkitFrameRateDebug;
import static android.view.flags.Flags.toolkitFrameRateFunctionEnablingReadOnly;
import static android.view.flags.Flags.toolkitFrameRateTouchBoost25q1;
import static android.view.flags.Flags.toolkitFrameRateTypingReadOnly;
@@ -1219,6 +1220,7 @@ public final class ViewRootImpl implements ViewParent,
            com.android.graphics.surfaceflinger.flags.Flags.vrrBugfix24q4();
    private static final boolean sEnableVrr = ViewProperties.vrr_enabled().orElse(true);
    private static final boolean sToolkitInitialTouchBoostFlagValue = toolkitInitialTouchBoost();
    private static boolean sToolkitFrameRateDebugFlagValue =  toolkitFrameRateDebug();
    static {
        sToolkitSetFrameRateReadOnlyFlagValue = toolkitSetFrameRateReadOnly();
@@ -13114,6 +13116,11 @@ public final class ViewRootImpl implements ViewParent,
                if (sToolkitFrameRateFunctionEnablingReadOnlyFlagValue) {
                    mFrameRateTransaction.setFrameRateCategory(mSurfaceControl,
                        frameRateCategory, false).applyAsyncUnsafe();
                    if (sToolkitFrameRateDebugFlagValue) {
                        Log.v(mTag, "### ViewRootImpl setFrameRateCategory '"
                                + categoryToString(frameRateCategory) + "'");
                    }
                }
                mLastPreferredFrameRateCategory = frameRateCategory;
            }
@@ -13176,8 +13183,15 @@ public final class ViewRootImpl implements ViewParent,
                    if (preferredFrameRate > 0) {
                        mFrameRateTransaction.setFrameRate(mSurfaceControl, preferredFrameRate,
                                mFrameRateCompatibility);
                        if (sToolkitFrameRateDebugFlagValue) {
                            Log.v(mTag, "### ViewRootImpl setFrameRate '"
                                    + preferredFrameRate + "'");
                        }
                    } else {
                        mFrameRateTransaction.clearFrameRate(mSurfaceControl);
                        if (sToolkitFrameRateDebugFlagValue) {
                            Log.v(mTag, "### ViewRootImpl setFrameRate 0 Hz");
                        }
                    }
                    mFrameRateTransaction.applyAsyncUnsafe();
                }
@@ -13231,6 +13245,12 @@ public final class ViewRootImpl implements ViewParent,
            // mFrameRateCategoryView = view == null ? "-" : view.getClass().getSimpleName();
        }
        mDrawnThisFrame = true;
        if (sToolkitFrameRateDebugFlagValue) {
            String viewName = view == null ? "-" : view.getClass().getSimpleName();
            Log.v(mTag, "### View: " + viewName +  " votes '"
                    + categoryToString(frameRateCategory) + "'");
        }
    }
    /**
+7 −0
Original line number Diff line number Diff line
@@ -144,3 +144,10 @@ flag {
    description: "Feature flag to update initial touch boost logic"
    bug: "393004744"
}

flag {
    name: "toolkit_frame_rate_debug"
    namespace: "toolkit"
    description: "Feature flag to ennable ARR debug message"
    bug: "394614443"
}
 No newline at end of file