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

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

Merge "[ARR] Remove trunk stable flags that are in production" into main

parents a8cbe9c2 7d05d964
Loading
Loading
Loading
Loading
+10 −38
Original line number Diff line number Diff line
@@ -49,12 +49,7 @@ import static android.view.flags.Flags.FLAG_VIEW_VELOCITY_API;
import static android.view.flags.Flags.calculateBoundsInParentFromBoundsInScreen;
import static android.view.flags.Flags.enableUseMeasureCacheDuringForceLayout;
import static android.view.flags.Flags.sensitiveContentAppProtection;
import static android.view.flags.Flags.toolkitFrameRateAnimationBugfix25q1;
import static android.view.flags.Flags.toolkitFrameRateBySizeReadOnly;
import static android.view.flags.Flags.toolkitFrameRateDefaultNormalReadOnly;
import static android.view.flags.Flags.toolkitFrameRateSmallUsesPercentReadOnly;
import static android.view.flags.Flags.toolkitFrameRateVelocityMappingReadOnly;
import static android.view.flags.Flags.toolkitFrameRateViewEnablingReadOnly;
import static android.view.flags.Flags.toolkitMetricsForFrameRateDecision;
import static android.view.flags.Flags.toolkitSetFrameRateReadOnly;
import static android.view.flags.Flags.toolkitViewgroupSetRequestedFrameRateApi;
@@ -2476,18 +2471,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    protected static boolean sToolkitSetFrameRateReadOnlyFlagValue;
    private static boolean sToolkitMetricsForFrameRateDecisionFlagValue;
    private static final boolean sToolkitFrameRateDefaultNormalReadOnlyFlagValue =
            toolkitFrameRateDefaultNormalReadOnly();
    private static final boolean sToolkitFrameRateBySizeReadOnlyFlagValue =
            toolkitFrameRateBySizeReadOnly();
    private static final boolean sToolkitFrameRateSmallUsesPercentReadOnlyFlagValue =
            toolkitFrameRateSmallUsesPercentReadOnly();
    private static final boolean sToolkitFrameRateViewEnablingReadOnlyFlagValue =
            toolkitFrameRateViewEnablingReadOnly();
    private static boolean sToolkitFrameRateVelocityMappingReadOnlyFlagValue =
            toolkitFrameRateVelocityMappingReadOnly();
    private static boolean sToolkitFrameRateAnimationBugfix25q1FlagValue =
            toolkitFrameRateAnimationBugfix25q1();
    private static boolean sToolkitViewGroupFrameRateApiFlagValue =
            toolkitViewgroupSetRequestedFrameRateApi();
@@ -24037,8 +24022,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                    }
                    // For VRR to vote the preferred frame rate
                    if (sToolkitSetFrameRateReadOnlyFlagValue
                            && sToolkitFrameRateViewEnablingReadOnlyFlagValue) {
                    if (sToolkitSetFrameRateReadOnlyFlagValue) {
                        votePreferredFrameRate();
                    }
                }
@@ -24050,8 +24034,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            if ((mPrivateFlags4 & PFLAG4_HAS_VIEW_PROPERTY_INVALIDATION)
                    == PFLAG4_HAS_VIEW_PROPERTY_INVALIDATION) {
                // For VRR to vote the preferred frame rate
                if (sToolkitSetFrameRateReadOnlyFlagValue
                        && sToolkitFrameRateViewEnablingReadOnlyFlagValue) {
                if (sToolkitSetFrameRateReadOnlyFlagValue) {
                    votePreferredFrameRate();
                }
                mPrivateFlags4 &= ~PFLAG4_HAS_VIEW_PROPERTY_INVALIDATION;
@@ -24739,8 +24722,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
        // Increase the frame rate if there is a transformation that applies a matrix.
        if (sToolkitFrameRateAnimationBugfix25q1FlagValue
                && ((t.getTransformationType() & Transformation.TYPE_MATRIX) != 0)) {
        if ((t.getTransformationType() & Transformation.TYPE_MATRIX) != 0) {
            mPrivateFlags4 |= PFLAG4_HAS_VIEW_PROPERTY_INVALIDATION;
            mPrivateFlags4 |= PFLAG4_HAS_MOVED;
        }
@@ -25913,26 +25895,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    private void sizeChange(int newWidth, int newHeight, int oldWidth, int oldHeight) {
        if (mAttachInfo != null && sToolkitFrameRateViewEnablingReadOnlyFlagValue) {
        if (mAttachInfo != null) {
            boolean isSmall;
            if (sToolkitFrameRateSmallUsesPercentReadOnlyFlagValue) {
            int size = newWidth * newHeight;
            float percent = size / mAttachInfo.mDisplayPixelCount;
            isSmall = percent <= FRAME_RATE_SIZE_PERCENTAGE_THRESHOLD;
            } else {
                float density = mAttachInfo.mDensity;
                int narrowSize = (int) (density * FRAME_RATE_NARROW_SIZE_DP);
                int smallSize = (int) (density * FRAME_RATE_SQUARE_SMALL_SIZE_DP);
                isSmall = newWidth <= narrowSize || newHeight <= narrowSize
                        || (newWidth <= smallSize && newHeight <= smallSize);
            }
            if (isSmall) {
                int category = sToolkitFrameRateBySizeReadOnlyFlagValue
                        ? FRAME_RATE_CATEGORY_LOW : FRAME_RATE_CATEGORY_NORMAL;
                mSizeBasedFrameRateCategoryAndReason = category | FRAME_RATE_CATEGORY_REASON_SMALL;
            } else {
                int category = sToolkitFrameRateDefaultNormalReadOnlyFlagValue
                        ? FRAME_RATE_CATEGORY_NORMAL : FRAME_RATE_CATEGORY_HIGH;
                int category = FRAME_RATE_CATEGORY_NORMAL;
                mSizeBasedFrameRateCategoryAndReason = category | FRAME_RATE_CATEGORY_REASON_LARGE;
            }
            mPrivateFlags4 |= PFLAG4_HAS_MOVED;
@@ -34422,9 +34396,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                                    | FRAME_RATE_CATEGORY_REASON_REQUESTED;
                    default -> {
                        // invalid frame rate, use default
                        int category = sToolkitFrameRateDefaultNormalReadOnlyFlagValue
                                ? FRAME_RATE_CATEGORY_NORMAL : FRAME_RATE_CATEGORY_HIGH;
                        frameRateCategory = category
                        frameRateCategory = FRAME_RATE_CATEGORY_NORMAL
                                | FRAME_RATE_CATEGORY_REASON_INVALID;
                    }
                }
+23 −53
Original line number Diff line number Diff line
@@ -120,11 +120,7 @@ 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;
import static android.view.flags.Flags.toolkitFrameRateVelocityMappingReadOnly;
import static android.view.flags.Flags.toolkitFrameRateViewEnablingReadOnly;
import static android.view.flags.Flags.toolkitInitialTouchBoost;
import static android.view.flags.Flags.toolkitMetricsForFrameRateDecision;
import static android.view.flags.Flags.toolkitSetFrameRateReadOnly;
@@ -1220,12 +1216,8 @@ public final class ViewRootImpl implements ViewParent,
    private final boolean mSendPerfHintOnTouch;
    private static boolean sToolkitSetFrameRateReadOnlyFlagValue;
    private static boolean sToolkitFrameRateFunctionEnablingReadOnlyFlagValue;
    private static boolean sToolkitMetricsForFrameRateDecisionFlagValue;
    private static boolean sToolkitFrameRateTypingReadOnlyFlagValue;
    private static final boolean sToolkitFrameRateViewEnablingReadOnlyFlagValue;
    private static boolean sToolkitFrameRateVelocityMappingReadOnlyFlagValue =
            toolkitFrameRateVelocityMappingReadOnly();
    private static boolean sToolkitEnableInvalidateCheckThreadFlagValue =
            Flags.enableInvalidateCheckThread();
    private static final boolean sEnableVrr = ViewProperties.vrr_enabled().orElse(true);
@@ -1235,11 +1227,6 @@ public final class ViewRootImpl implements ViewParent,
    static {
        sToolkitSetFrameRateReadOnlyFlagValue = toolkitSetFrameRateReadOnly();
        sToolkitMetricsForFrameRateDecisionFlagValue = toolkitMetricsForFrameRateDecision();
        sToolkitFrameRateTypingReadOnlyFlagValue = toolkitFrameRateTypingReadOnly();
        sToolkitFrameRateFunctionEnablingReadOnlyFlagValue =
                toolkitFrameRateFunctionEnablingReadOnly();
        sToolkitFrameRateViewEnablingReadOnlyFlagValue =
                toolkitFrameRateViewEnablingReadOnly();
    }
    // The latest input event from the gesture that was used to resolve the pointer icon.
@@ -2872,10 +2859,8 @@ public final class ViewRootImpl implements ViewParent,
        // no longer needed if the dVRR feature is disabled.
        if (shouldEnableDvrr()) {
            try {
                if (sToolkitFrameRateFunctionEnablingReadOnlyFlagValue) {
                mFrameRateTransaction.setFrameRateSelectionStrategy(sc,
                    sc.FRAME_RATE_SELECTION_STRATEGY_SELF).applyAsyncUnsafe();
                }
            } catch (Exception e) {
                Log.e(mTag, "Unable to set frame rate selection strategy ", e);
            }
@@ -13241,7 +13226,6 @@ public final class ViewRootImpl implements ViewParent,
                                    + category + ", reason " + reason + ", "
                                    + sourceView);
                }
                if (sToolkitFrameRateFunctionEnablingReadOnlyFlagValue) {
                mFrameRateTransaction.setFrameRateCategory(mSurfaceControl,
                    frameRateCategory, false).applyAsyncUnsafe();
@@ -13249,7 +13233,6 @@ public final class ViewRootImpl implements ViewParent,
                    Log.v(mTag, "### ViewRootImpl setFrameRateCategory '"
                            + categoryToString(frameRateCategory) + "'");
                }
                }
                mLastPreferredFrameRateCategory = frameRateCategory;
            }
        } catch (Exception e) {
@@ -13307,7 +13290,6 @@ public final class ViewRootImpl implements ViewParent,
                                + preferredFrameRate + " compatibility "
                                + mFrameRateCompatibility);
                }
                if (sToolkitFrameRateFunctionEnablingReadOnlyFlagValue) {
                if (preferredFrameRate > 0) {
                    mFrameRateTransaction.setFrameRate(mSurfaceControl, preferredFrameRate,
                            mFrameRateCompatibility);
@@ -13322,7 +13304,6 @@ public final class ViewRootImpl implements ViewParent,
                    }
                }
                mFrameRateTransaction.applyAsyncUnsafe();
                }
                mLastPreferredFrameRate = preferredFrameRate;
            }
        } catch (Exception e) {
@@ -13348,8 +13329,7 @@ public final class ViewRootImpl implements ViewParent,
    private boolean shouldTouchBoost(int motionEventAction, int windowType) {
        // boost for almost all input
        boolean desiredAction = motionEventAction != MotionEvent.ACTION_OUTSIDE;
        boolean undesiredType = windowType == TYPE_INPUT_METHOD
                && sToolkitFrameRateTypingReadOnlyFlagValue;
        boolean undesiredType = windowType == TYPE_INPUT_METHOD;
        // don't suppress touch boost for TYPE_INPUT_METHOD in ViewRootImpl
        if (toolkitFrameRateTouchBoost25q1()) {
@@ -13441,9 +13421,7 @@ public final class ViewRootImpl implements ViewParent,
     *                 the calculation is based only on velocity.
     */
    public boolean shouldCheckFrameRate(boolean isDirect) {
        return mPreferredFrameRate < MAX_FRAME_RATE
                || (!isDirect && !sToolkitFrameRateVelocityMappingReadOnlyFlagValue
                && mPreferredFrameRateCategory < FRAME_RATE_CATEGORY_HIGH);
        return mPreferredFrameRate < MAX_FRAME_RATE;
    }
    /**
@@ -13472,14 +13450,6 @@ public final class ViewRootImpl implements ViewParent,
        if (frameRateCompatibility == FRAME_RATE_COMPATIBILITY_AT_LEAST && !mIsPressedGesture) {
            mIsTouchBoosting = false;
            mIsFrameRateBoosting = false;
            if (!sToolkitFrameRateVelocityMappingReadOnlyFlagValue) {
                mPreferredFrameRateCategory = FRAME_RATE_CATEGORY_HIGH;
                mFrameRateCategoryHighCount = FRAME_RATE_CATEGORY_COUNT;
                mFrameRateCategoryChangeReason = FRAME_RATE_CATEGORY_REASON_VELOCITY;
                mFrameRateCategoryView = null;
                mDrawnThisFrame = true;
                return;
            }
        }
        float nextFrameRate;
        int nextFrameRateCompatibility;
@@ -13621,7 +13591,7 @@ public final class ViewRootImpl implements ViewParent,
    private boolean shouldEnableDvrr() {
        // uncomment this when we are ready for enabling dVRR
        if (sEnableVrr && sToolkitFrameRateViewEnablingReadOnlyFlagValue) {
        if (sEnableVrr) {
            return sToolkitSetFrameRateReadOnlyFlagValue && isFrameRatePowerSavingsBalanced();
        }
        return false;
+0 −56
Original line number Diff line number Diff line
@@ -57,14 +57,6 @@ flag {
    is_fixed_read_only: true
}

flag {
    name: "toolkit_frame_rate_default_normal_read_only"
    namespace: "toolkit"
    description: "Feature flag for setting frame rate category as NORMAL for default"
    bug: "335874198"
    is_fixed_read_only: true
}

flag {
    name: "toolkit_frame_rate_by_size_read_only"
    namespace: "toolkit"
@@ -73,54 +65,6 @@ flag {
    is_fixed_read_only: true
}

flag {
    name: "toolkit_frame_rate_velocity_mapping_read_only"
    namespace: "toolkit"
    description: "Feature flag for setting frame rate based on velocity"
    bug: "335874198"
    is_fixed_read_only: true
}

flag {
    name: "toolkit_frame_rate_small_uses_percent_read_only"
    namespace: "toolkit"
    description: "VRR uses percent of size to consider a view to be small"
    bug: "335874198"
    is_fixed_read_only: true
}

flag {
    name: "toolkit_frame_rate_typing_read_only"
    namespace: "toolkit"
    description: "Feature flag for suppressing boost on typing"
    bug: "335874198"
    is_fixed_read_only: true
}

flag {
    name: "toolkit_frame_rate_function_enabling_read_only"
    namespace: "toolkit"
    description: "Feature flag to enable the functionality of the dVRR feature"
    bug: "335874198"
    is_fixed_read_only: true
}

flag {
    name: "toolkit_frame_rate_view_enabling_read_only"
    namespace: "toolkit"
    description: "Feature flag to enable the functionality on views for the dVRR feature"
    bug: "335874198"
    is_fixed_read_only: true
}

flag {
    name: "toolkit_frame_rate_animation_bugfix_25q1"
    namespace: "toolkit"
    description: "Feature flag to enable the fix for applyLegacyAnimation for VRR V QPR2"
    bug: "335874198"
    is_fixed_read_only: true
}

flag {
    name: "toolkit_viewgroup_set_requested_frame_rate_api"
    namespace: "toolkit"
+46 −129

File changed.

Preview size limit exceeded, changes collapsed.

+39 −93

File changed.

Preview size limit exceeded, changes collapsed.