diff options
| author | 2024-04-04 00:32:09 +0000 | |
|---|---|---|
| committer | 2024-04-04 00:32:09 +0000 | |
| commit | 31bfe866dff39ec40a40fb80375a6c8a6c31dabd (patch) | |
| tree | 96ed36e999cb8a29e47f2eea2ae54d8981cf6a26 | |
| parent | 0c14f67eecd0a81c49d7d1b818e066247159f2c7 (diff) | |
| parent | a5c81755b3ff1b0212a40bae952d4462f8e8c0e8 (diff) | |
Merge "Make toolkit_frame_rate_function_enabling_read_only only avoid calls to SurfaceFling" into main
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index c8cb1a7c8773..db1b73f5352d 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -110,6 +110,7 @@ import static android.view.flags.Flags.toolkitFrameRateVelocityMappingReadOnly; import static android.view.flags.Flags.toolkitMetricsForFrameRateDecision; import static android.view.flags.Flags.toolkitSetFrameRateReadOnly; import static android.view.flags.Flags.toolkitFrameRateFunctionEnablingReadOnly; +import static android.view.flags.Flags.toolkitFrameRateViewEnablingReadOnly; import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.IME_FOCUS_CONTROLLER; import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.INSETS_CONTROLLER; @@ -1153,6 +1154,7 @@ public final class ViewRootImpl implements ViewParent, private static boolean sToolkitFrameRateFunctionEnablingReadOnlyFlagValue; private static boolean sToolkitMetricsForFrameRateDecisionFlagValue; private static boolean sToolkitFrameRateTypingReadOnlyFlagValue; + private static final boolean sToolkitFrameRateViewEnablingReadOnlyFlagValue; private static boolean sToolkitFrameRateVelocityMappingReadOnlyFlagValue = toolkitFrameRateVelocityMappingReadOnly();; @@ -1162,6 +1164,8 @@ public final class ViewRootImpl implements ViewParent, sToolkitFrameRateTypingReadOnlyFlagValue = toolkitFrameRateTypingReadOnly(); sToolkitFrameRateFunctionEnablingReadOnlyFlagValue = toolkitFrameRateFunctionEnablingReadOnly(); + sToolkitFrameRateViewEnablingReadOnlyFlagValue = + toolkitFrameRateViewEnablingReadOnly(); } // The latest input event from the gesture that was used to resolve the pointer icon. @@ -2624,8 +2628,10 @@ public final class ViewRootImpl implements ViewParent, // no longer needed if the dVRR feature is disabled. if (shouldEnableDvrr()) { try { - mFrameRateTransaction.setFrameRateSelectionStrategy(sc, + 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); } @@ -12536,9 +12542,11 @@ public final class ViewRootImpl implements ViewParent, + category + ", reason " + reason + ", " + sourceView); } - mFrameRateTransaction.setFrameRateCategory(mSurfaceControl, + if (sToolkitFrameRateFunctionEnablingReadOnlyFlagValue) { + mFrameRateTransaction.setFrameRateCategory(mSurfaceControl, frameRateCategory, false).applyAsyncUnsafe(); - mLastPreferredFrameRateCategory = frameRateCategory; + mLastPreferredFrameRateCategory = frameRateCategory; + } } } catch (Exception e) { Log.e(mTag, "Unable to set frame rate category", e); @@ -12595,9 +12603,11 @@ public final class ViewRootImpl implements ViewParent, + preferredFrameRate + " compatibility " + mFrameRateCompatibility); } - mFrameRateTransaction.setFrameRate(mSurfaceControl, preferredFrameRate, + if (sToolkitFrameRateFunctionEnablingReadOnlyFlagValue) { + mFrameRateTransaction.setFrameRate(mSurfaceControl, preferredFrameRate, mFrameRateCompatibility).applyAsyncUnsafe(); - mLastPreferredFrameRate = preferredFrameRate; + mLastPreferredFrameRate = preferredFrameRate; + } } } catch (Exception e) { Log.e(mTag, "Unable to set frame rate", e); @@ -12824,7 +12834,7 @@ public final class ViewRootImpl implements ViewParent, private boolean shouldEnableDvrr() { // uncomment this when we are ready for enabling dVRR - if (sToolkitFrameRateFunctionEnablingReadOnlyFlagValue) { + if (sToolkitFrameRateViewEnablingReadOnlyFlagValue) { return sToolkitSetFrameRateReadOnlyFlagValue && isFrameRatePowerSavingsBalanced(); } return false; |