From c48e5da476d996617713556c618d47f56d7d49cd Mon Sep 17 00:00:00 2001 From: Marin Shalamanov Date: Mon, 26 Apr 2021 13:53:25 +0200 Subject: Update javadoc for setFrameRate Explicitly state that when fps=0 the other two parameters of setFrameRate are ignored. Bug: 161776961 Test: n/a Change-Id: If5ecbbf053aa59071f19f6c7ba9ae0af9f15451b --- core/java/android/view/SurfaceControl.java | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'core/java/android/view/SurfaceControl.java') diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index 4977a6e59ede..c887035259e2 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -3296,20 +3296,26 @@ public final class SurfaceControl implements Parcelable { * because the system may change the display refresh rate, calls to this function may result * in changes to Choreographer callback timings, and changes to the time interval at which * the system releases buffers back to the application. + *

+ * Note that this only has an effect for surfaces presented on the display. If this + * surface is consumed by something other than the system compositor, e.g. a media + * codec, this call has no effect. * * @param sc The SurfaceControl to specify the frame rate of. * @param frameRate The intended frame rate for this surface, in frames per second. 0 is a * special value that indicates the app will accept the system's choice for * the display frame rate, which is the default behavior if this function - * isn't called. The frameRate param does not need to be a valid - * refresh rate for this device's display - e.g., it's fine to pass 30fps - * to a device that can only run the display at 60fps. + * isn't called. The frameRate param does not need + * to be a valid refresh rate for this device's display - e.g., it's fine + * to pass 30fps to a device that can only run the display at 60fps. * @param compatibility The frame rate compatibility of this surface. The compatibility * value may influence the system's choice of display frame rate. - * @param changeFrameRateStrategy Whether display refresh rate transitions should be - * seamless. A seamless transition is one that doesn't have - * any visual interruptions, such as a black screen for a - * second or two. + * This parameter is ignored when frameRate is 0. + * @param changeFrameRateStrategy Whether display refresh rate transitions caused by this + * surface should be seamless. A seamless transition is one + * that doesn't have any visual interruptions, such as a + * black screen for a second or two. This parameter is + * ignored when frameRate is 0. * @return This transaction object. */ @NonNull -- cgit v1.2.3