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

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

Merge "Use applyAsyncUnsafe() instead of apply() to apply a transaction" into main

parents 3df2d131 f64a8975
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -3991,9 +3991,7 @@ public final class ViewRootImpl implements ViewParent,
        // when the values are applicable.
        setPreferredFrameRate(mPreferredFrameRate);
        setPreferredFrameRateCategory(mPreferredFrameRateCategory);
        mLastPreferredFrameRateCategory = mPreferredFrameRateCategory;
        mPreferredFrameRateCategory = FRAME_RATE_CATEGORY_NO_PREFERENCE;
        mLastPreferredFrameRate = mPreferredFrameRate;
        mPreferredFrameRate = 0;
    }

@@ -11982,8 +11980,11 @@ public final class ViewRootImpl implements ViewParent,
                ? FRAME_RATE_CATEGORY_HIGH : preferredFrameRateCategory;

        try {
            if (mLastPreferredFrameRateCategory != frameRateCategory) {
                mFrameRateTransaction.setFrameRateCategory(mSurfaceControl,
                    frameRateCategory, false).apply();
                    frameRateCategory, false).applyAsyncUnsafe();
                mLastPreferredFrameRateCategory = frameRateCategory;
            }
        } catch (Exception e) {
            Log.e(mTag, "Unable to set frame rate category", e);
        }
@@ -12003,8 +12004,11 @@ public final class ViewRootImpl implements ViewParent,
        }

        try {
            mFrameRateTransaction.setFrameRate(mSurfaceControl,
                    preferredFrameRate, Surface.FRAME_RATE_COMPATIBILITY_DEFAULT).apply();
            if (mLastPreferredFrameRate != 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);
        }