summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ying Wei <whisperwing@google.com> 2023-03-16 20:00:00 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-03-16 20:00:00 +0000
commit79b8e4c381aeec405e4881eee891a256bbdd9cc8 (patch)
treec354c643e1fb69f408eeba2b1ac01a8474db8b64
parentba8a8ceb8f4ce3acff8367a5f322d57b8ff6fd88 (diff)
parentea7b8656a226b5ee8f3b1feab4c66823d00ac811 (diff)
Merge "Update documentation for WindowManager.LayoutParams#preferredRefreshRate" into udc-dev
-rw-r--r--core/java/android/view/WindowManager.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index cc846e3537e1..cda1f3adb9a4 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -3616,9 +3616,20 @@ public interface WindowManager extends ViewManager {
/**
* The preferred refresh rate for the window.
* <p>
- * This must be one of the supported refresh rates obtained for the display(s) the window
- * is on. The selected refresh rate will be applied to the display's default mode.
+ * Before API 34, this must be one of the supported refresh rates obtained
+ * for the display(s) the window is on. The selected refresh rate will be
+ * applied to the display's default mode.
* <p>
+ * Starting API 34, this value is not limited to the supported refresh rates
+ * obtained from the display(s) for the window: it can be any refresh rate
+ * the window intends to run at. Any refresh rate can be provided as the
+ * preferred window refresh rate. The OS will select the refresh rate that
+ * best matches the {@link #preferredRefreshRate}.
+ * <p>
+ * Setting this value is the equivalent of calling {@link Surface#setFrameRate} with (
+ * preferred_frame_rate,
+ * {@link Surface#FRAME_RATE_COMPATIBILITY_DEFAULT},
+ * {@link Surface#CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS}).
* This should be used in favor of {@link LayoutParams#preferredDisplayModeId} for
* applications that want to specify the refresh rate, but do not want to specify a
* preference for any other displayMode properties (e.g., resolution).