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

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

Merge "Add Trace for setFrameRate and setFrameRateCategory function calls." into main

parents 6e77c12b 7cdc45bd
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -12258,12 +12258,19 @@ public final class ViewRootImpl implements ViewParent,
        try {
            if (mLastPreferredFrameRateCategory != frameRateCategory) {
                if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) {
                    Trace.traceBegin(
                            Trace.TRACE_TAG_VIEW, "ViewRootImpl#setFrameRateCategory "
                                + frameRateCategory);
                }
                mFrameRateTransaction.setFrameRateCategory(mSurfaceControl,
                        frameRateCategory, false).applyAsyncUnsafe();
                mLastPreferredFrameRateCategory = frameRateCategory;
            }
        } catch (Exception e) {
            Log.e(mTag, "Unable to set frame rate category", e);
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_VIEW);
        }
        if (mPreferredFrameRateCategory != FRAME_RATE_CATEGORY_NO_PREFERENCE && !mHasIdledMessage) {
@@ -12282,12 +12289,19 @@ public final class ViewRootImpl implements ViewParent,
        try {
            if (mLastPreferredFrameRate != preferredFrameRate) {
                if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) {
                    Trace.traceBegin(
                            Trace.TRACE_TAG_VIEW, "ViewRootImpl#setFrameRate "
                                + preferredFrameRate);
                }
                mFrameRateTransaction.setFrameRate(mSurfaceControl, preferredFrameRate,
                    Surface.FRAME_RATE_COMPATIBILITY_DEFAULT).applyAsyncUnsafe();
                mLastPreferredFrameRate = preferredFrameRate;
            }
        } catch (Exception e) {
            Log.e(mTag, "Unable to set frame rate", e);
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_VIEW);
        }
    }