summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Marin Shalamanov <shalamanov@google.com> 2021-03-31 14:30:26 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-03-31 14:30:26 +0000
commit75ba8bcd4209377ddd32b3e23e89b7ad9c382a9e (patch)
treed2a5274d70ce0053e76c6b43086bff02f0d31099 /libs
parent7f56cf876a74bd778f38c6d1dab6632f010cf6f8 (diff)
parentc5986778d0d6c7ab3f96fafb1b84887e901ed92b (diff)
Merge "setFrameRate: Make shouldBeSeamless an enum" into sc-dev
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/BLASTBufferQueue.cpp8
-rw-r--r--libs/gui/ISurfaceComposer.cpp76
-rw-r--r--libs/gui/LayerState.cpp19
-rw-r--r--libs/gui/Surface.cpp12
-rw-r--r--libs/gui/SurfaceComposerClient.cpp7
-rw-r--r--libs/gui/include/gui/ISurfaceComposer.h2
-rw-r--r--libs/gui/include/gui/LayerState.h7
-rw-r--r--libs/gui/include/gui/Surface.h3
-rw-r--r--libs/gui/include/gui/SurfaceComposerClient.h2
-rw-r--r--libs/gui/tests/Surface_test.cpp2
-rw-r--r--libs/nativewindow/ANativeWindow.cpp10
-rw-r--r--libs/nativewindow/include/android/native_window.h31
-rw-r--r--libs/nativewindow/include/system/window.h4
-rw-r--r--libs/nativewindow/libnativewindow.map.txt2
14 files changed, 88 insertions, 97 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index 1976b493b2..bcdd06b6c8 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -555,11 +555,13 @@ public:
}).detach();
}
- status_t setFrameRate(float frameRate, int8_t compatibility, bool shouldBeSeamless) override {
- if (!ValidateFrameRate(frameRate, compatibility, "BBQSurface::setFrameRate")) {
+ status_t setFrameRate(float frameRate, int8_t compatibility,
+ int8_t changeFrameRateStrategy) override {
+ if (!ValidateFrameRate(frameRate, compatibility, changeFrameRateStrategy,
+ "BBQSurface::setFrameRate")) {
return BAD_VALUE;
}
- return mBbq->setFrameRate(frameRate, compatibility, shouldBeSeamless);
+ return mBbq->setFrameRate(frameRate, compatibility, changeFrameRateStrategy);
}
status_t setFrameTimelineInfo(const FrameTimelineInfo& frameTimelineInfo) override {
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index 97f8f4702c..c1e3385a7f 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -1033,39 +1033,15 @@ public:
}
status_t setFrameRate(const sp<IGraphicBufferProducer>& surface, float frameRate,
- int8_t compatibility, bool shouldBeSeamless) override {
+ int8_t compatibility, int8_t changeFrameRateStrategy) override {
Parcel data, reply;
- status_t err = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
- if (err != NO_ERROR) {
- ALOGE("setFrameRate: failed writing interface token: %s (%d)", strerror(-err), -err);
- return err;
- }
-
- err = data.writeStrongBinder(IInterface::asBinder(surface));
- if (err != NO_ERROR) {
- ALOGE("setFrameRate: failed writing strong binder: %s (%d)", strerror(-err), -err);
- return err;
- }
-
- err = data.writeFloat(frameRate);
- if (err != NO_ERROR) {
- ALOGE("setFrameRate: failed writing float: %s (%d)", strerror(-err), -err);
- return err;
- }
-
- err = data.writeByte(compatibility);
- if (err != NO_ERROR) {
- ALOGE("setFrameRate: failed writing byte: %s (%d)", strerror(-err), -err);
- return err;
- }
-
- err = data.writeBool(shouldBeSeamless);
- if (err != NO_ERROR) {
- ALOGE("setFrameRate: failed writing bool: %s (%d)", strerror(-err), -err);
- return err;
- }
+ SAFE_PARCEL(data.writeInterfaceToken, ISurfaceComposer::getInterfaceDescriptor());
+ SAFE_PARCEL(data.writeStrongBinder, IInterface::asBinder(surface));
+ SAFE_PARCEL(data.writeFloat, frameRate);
+ SAFE_PARCEL(data.writeByte, compatibility);
+ SAFE_PARCEL(data.writeByte, changeFrameRateStrategy);
- err = remote()->transact(BnSurfaceComposer::SET_FRAME_RATE, data, &reply);
+ status_t err = remote()->transact(BnSurfaceComposer::SET_FRAME_RATE, data, &reply);
if (err != NO_ERROR) {
ALOGE("setFrameRate: failed to transact: %s (%d)", strerror(-err), err);
return err;
@@ -1894,36 +1870,24 @@ status_t BnSurfaceComposer::onTransact(
case SET_FRAME_RATE: {
CHECK_INTERFACE(ISurfaceComposer, data, reply);
sp<IBinder> binder;
- status_t err = data.readStrongBinder(&binder);
- if (err != NO_ERROR) {
- ALOGE("setFrameRate: failed to read strong binder: %s (%d)", strerror(-err), -err);
- return err;
- }
+ SAFE_PARCEL(data.readStrongBinder, &binder);
+
sp<IGraphicBufferProducer> surface = interface_cast<IGraphicBufferProducer>(binder);
if (!surface) {
- ALOGE("setFrameRate: failed to cast to IGraphicBufferProducer: %s (%d)",
- strerror(-err), -err);
- return err;
+ ALOGE("setFrameRate: failed to cast to IGraphicBufferProducer");
+ return BAD_VALUE;
}
float frameRate;
- err = data.readFloat(&frameRate);
- if (err != NO_ERROR) {
- ALOGE("setFrameRate: failed to read float: %s (%d)", strerror(-err), -err);
- return err;
- }
+ SAFE_PARCEL(data.readFloat, &frameRate);
+
int8_t compatibility;
- err = data.readByte(&compatibility);
- if (err != NO_ERROR) {
- ALOGE("setFrameRate: failed to read byte: %s (%d)", strerror(-err), -err);
- return err;
- }
- bool shouldBeSeamless;
- err = data.readBool(&shouldBeSeamless);
- if (err != NO_ERROR) {
- ALOGE("setFrameRate: failed to read bool: %s (%d)", strerror(-err), -err);
- return err;
- }
- status_t result = setFrameRate(surface, frameRate, compatibility, shouldBeSeamless);
+ SAFE_PARCEL(data.readByte, &compatibility);
+
+ int8_t changeFrameRateStrategy;
+ SAFE_PARCEL(data.readByte, &changeFrameRateStrategy);
+
+ status_t result =
+ setFrameRate(surface, frameRate, compatibility, changeFrameRateStrategy);
reply->writeInt32(result);
return NO_ERROR;
}
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index d653ae71be..ae4f8fe4f8 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -19,6 +19,7 @@
#include <apex/window.h>
#include <inttypes.h>
+#include <android/native_window.h>
#include <binder/Parcel.h>
#include <gui/IGraphicBufferProducer.h>
#include <gui/ISurfaceComposerClient.h>
@@ -60,7 +61,7 @@ layer_state_t::layer_state_t()
frameRateSelectionPriority(-1),
frameRate(0.0f),
frameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT),
- shouldBeSeamless(true),
+ changeFrameRateStrategy(ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS),
fixedTransformHint(ui::Transform::ROT_INVALID),
frameNumber(0),
autoRefresh(false),
@@ -148,7 +149,7 @@ status_t layer_state_t::write(Parcel& output) const
SAFE_PARCEL(output.writeInt32, frameRateSelectionPriority);
SAFE_PARCEL(output.writeFloat, frameRate);
SAFE_PARCEL(output.writeByte, frameRateCompatibility);
- SAFE_PARCEL(output.writeBool, shouldBeSeamless);
+ SAFE_PARCEL(output.writeByte, changeFrameRateStrategy);
SAFE_PARCEL(output.writeUint32, fixedTransformHint);
SAFE_PARCEL(output.writeUint64, frameNumber);
SAFE_PARCEL(output.writeBool, autoRefresh);
@@ -269,7 +270,7 @@ status_t layer_state_t::read(const Parcel& input)
SAFE_PARCEL(input.readInt32, &frameRateSelectionPriority);
SAFE_PARCEL(input.readFloat, &frameRate);
SAFE_PARCEL(input.readByte, &frameRateCompatibility);
- SAFE_PARCEL(input.readBool, &shouldBeSeamless);
+ SAFE_PARCEL(input.readByte, &changeFrameRateStrategy);
SAFE_PARCEL(input.readUint32, &tmpUint32);
fixedTransformHint = static_cast<ui::Transform::RotationFlags>(tmpUint32);
SAFE_PARCEL(input.readUint64, &frameNumber);
@@ -531,7 +532,7 @@ void layer_state_t::merge(const layer_state_t& other) {
what |= eFrameRateChanged;
frameRate = other.frameRate;
frameRateCompatibility = other.frameRateCompatibility;
- shouldBeSeamless = other.shouldBeSeamless;
+ changeFrameRateStrategy = other.changeFrameRateStrategy;
}
if (other.what & eFixedTransformHintChanged) {
what |= eFixedTransformHintChanged;
@@ -624,8 +625,8 @@ status_t InputWindowCommands::read(const Parcel& input) {
return NO_ERROR;
}
-bool ValidateFrameRate(float frameRate, int8_t compatibility, const char* inFunctionName,
- bool privileged) {
+bool ValidateFrameRate(float frameRate, int8_t compatibility, int8_t changeFrameRateStrategy,
+ const char* inFunctionName, bool privileged) {
const char* functionName = inFunctionName != nullptr ? inFunctionName : "call";
int floatClassification = std::fpclassify(frameRate);
if (frameRate < 0 || floatClassification == FP_INFINITE || floatClassification == FP_NAN) {
@@ -641,6 +642,12 @@ bool ValidateFrameRate(float frameRate, int8_t compatibility, const char* inFunc
return false;
}
+ if (changeFrameRateStrategy != ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS &&
+ changeFrameRateStrategy != ANATIVEWINDOW_CHANGE_FRAME_RATE_ALWAYS) {
+ ALOGE("%s failed - invalid change frame rate strategy value %d", functionName,
+ changeFrameRateStrategy);
+ }
+
return true;
}
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index 6de3e971b2..2fc9d47b89 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -1729,8 +1729,8 @@ int Surface::dispatchGetLastQueueDuration(va_list args) {
int Surface::dispatchSetFrameRate(va_list args) {
float frameRate = static_cast<float>(va_arg(args, double));
int8_t compatibility = static_cast<int8_t>(va_arg(args, int));
- bool shouldBeSeamless = static_cast<bool>(va_arg(args, int));
- return setFrameRate(frameRate, compatibility, shouldBeSeamless);
+ int8_t changeFrameRateStrategy = static_cast<int8_t>(va_arg(args, int));
+ return setFrameRate(frameRate, compatibility, changeFrameRateStrategy);
}
int Surface::dispatchAddCancelInterceptor(va_list args) {
@@ -2575,16 +2575,18 @@ void Surface::ProducerListenerProxy::onBuffersDiscarded(const std::vector<int32_
mSurfaceListener->onBuffersDiscarded(discardedBufs);
}
-status_t Surface::setFrameRate(float frameRate, int8_t compatibility, bool shouldBeSeamless) {
+status_t Surface::setFrameRate(float frameRate, int8_t compatibility,
+ int8_t changeFrameRateStrategy) {
ATRACE_CALL();
ALOGV("Surface::setFrameRate");
- if (!ValidateFrameRate(frameRate, compatibility, "Surface::setFrameRate")) {
+ if (!ValidateFrameRate(frameRate, compatibility, changeFrameRateStrategy,
+ "Surface::setFrameRate")) {
return BAD_VALUE;
}
return composerService()->setFrameRate(mGraphicBufferProducer, frameRate, compatibility,
- shouldBeSeamless);
+ changeFrameRateStrategy);
}
status_t Surface::setFrameTimelineInfo(const FrameTimelineInfo& frameTimelineInfo) {
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 0b01084633..cb8028b6f5 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -1583,7 +1583,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setShado
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrameRate(
const sp<SurfaceControl>& sc, float frameRate, int8_t compatibility,
- bool shouldBeSeamless) {
+ int8_t changeFrameRateStrategy) {
layer_state_t* s = getLayerState(sc);
if (!s) {
mStatus = BAD_INDEX;
@@ -1591,7 +1591,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrame
}
// Allow privileged values as well here, those will be ignored by SF if
// the caller is not privileged
- if (!ValidateFrameRate(frameRate, compatibility, "Transaction::setFrameRate",
+ if (!ValidateFrameRate(frameRate, compatibility, changeFrameRateStrategy,
+ "Transaction::setFrameRate",
/*privileged=*/true)) {
mStatus = BAD_VALUE;
return *this;
@@ -1599,7 +1600,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrame
s->what |= layer_state_t::eFrameRateChanged;
s->frameRate = frameRate;
s->frameRateCompatibility = compatibility;
- s->shouldBeSeamless = shouldBeSeamless;
+ s->changeFrameRateStrategy = changeFrameRateStrategy;
return *this;
}
diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h
index 9f9ca74d65..d933514a38 100644
--- a/libs/gui/include/gui/ISurfaceComposer.h
+++ b/libs/gui/include/gui/ISurfaceComposer.h
@@ -466,7 +466,7 @@ public:
* Sets the intended frame rate for a surface. See ANativeWindow_setFrameRate() for more info.
*/
virtual status_t setFrameRate(const sp<IGraphicBufferProducer>& surface, float frameRate,
- int8_t compatibility, bool shouldBeSeamless) = 0;
+ int8_t compatibility, int8_t changeFrameRateStrategy) = 0;
/*
* Acquire a frame rate flexibility token from SurfaceFlinger. While this token is acquired,
diff --git a/libs/gui/include/gui/LayerState.h b/libs/gui/include/gui/LayerState.h
index 92747779fd..4bd12ceae4 100644
--- a/libs/gui/include/gui/LayerState.h
+++ b/libs/gui/include/gui/LayerState.h
@@ -207,7 +207,7 @@ struct layer_state_t {
// Layer frame rate and compatibility. See ANativeWindow_setFrameRate().
float frameRate;
int8_t frameRateCompatibility;
- bool shouldBeSeamless;
+ int8_t changeFrameRateStrategy;
// Set by window manager indicating the layer and all its children are
// in a different orientation than the display. The hint suggests that
@@ -307,10 +307,11 @@ static inline int compare_type(const DisplayState& lhs, const DisplayState& rhs)
//
// @param frameRate the frame rate in Hz
// @param compatibility a ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_*
+// @param changeFrameRateStrategy a ANATIVEWINDOW_CHANGE_FRAME_RATE_*
// @param functionName calling function or nullptr. Used for logging
// @param privileged whether caller has unscoped surfaceflinger access
-bool ValidateFrameRate(float frameRate, int8_t compatibility, const char* functionName,
- bool privileged = false);
+bool ValidateFrameRate(float frameRate, int8_t compatibility, int8_t changeFrameRateStrategy,
+ const char* functionName, bool privileged = false);
struct CaptureArgs {
const static int32_t UNSET_UID = -1;
diff --git a/libs/gui/include/gui/Surface.h b/libs/gui/include/gui/Surface.h
index 58812214d2..d22bdaaa98 100644
--- a/libs/gui/include/gui/Surface.h
+++ b/libs/gui/include/gui/Surface.h
@@ -187,7 +187,8 @@ public:
status_t getUniqueId(uint64_t* outId) const;
status_t getConsumerUsage(uint64_t* outUsage) const;
- virtual status_t setFrameRate(float frameRate, int8_t compatibility, bool shouldBeSeamless);
+ virtual status_t setFrameRate(float frameRate, int8_t compatibility,
+ int8_t changeFrameRateStrategy);
virtual status_t setFrameTimelineInfo(const FrameTimelineInfo& info);
virtual status_t getExtraBufferCount(int* extraBuffers) const;
diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h
index c38375cf77..35f57a2985 100644
--- a/libs/gui/include/gui/SurfaceComposerClient.h
+++ b/libs/gui/include/gui/SurfaceComposerClient.h
@@ -515,7 +515,7 @@ public:
Transaction& setShadowRadius(const sp<SurfaceControl>& sc, float cornerRadius);
Transaction& setFrameRate(const sp<SurfaceControl>& sc, float frameRate,
- int8_t compatibility, bool shouldBeSeamless);
+ int8_t compatibility, int8_t changeFrameRateStrategy);
// Set by window manager indicating the layer and all its children are
// in a different orientation than the display. The hint suggests that
diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp
index 5ac3f19486..887603392f 100644
--- a/libs/gui/tests/Surface_test.cpp
+++ b/libs/gui/tests/Surface_test.cpp
@@ -859,7 +859,7 @@ public:
}
status_t setFrameRate(const sp<IGraphicBufferProducer>& /*surface*/, float /*frameRate*/,
- int8_t /*compatibility*/, bool /*shouldBeSeamless*/) override {
+ int8_t /*compatibility*/, int8_t /*changeFrameRateStrategy*/) override {
return NO_ERROR;
}
diff --git a/libs/nativewindow/ANativeWindow.cpp b/libs/nativewindow/ANativeWindow.cpp
index b406a9c2fe..ada689ac42 100644
--- a/libs/nativewindow/ANativeWindow.cpp
+++ b/libs/nativewindow/ANativeWindow.cpp
@@ -159,8 +159,8 @@ int32_t ANativeWindow_getBuffersDataSpace(ANativeWindow* window) {
}
int32_t ANativeWindow_setFrameRate(ANativeWindow* window, float frameRate, int8_t compatibility) {
- return ANativeWindow_setFrameRateWithSeamlessness(window, frameRate, compatibility,
- /*shouldBeSeamless*/ true);
+ return ANativeWindow_setFrameRateWithChangeStrategy(window, frameRate, compatibility,
+ ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS);
}
void ANativeWindow_tryAllocateBuffers(ANativeWindow* window) {
@@ -170,12 +170,12 @@ void ANativeWindow_tryAllocateBuffers(ANativeWindow* window) {
window->perform(window, NATIVE_WINDOW_ALLOCATE_BUFFERS);
}
-int32_t ANativeWindow_setFrameRateWithSeamlessness(ANativeWindow* window, float frameRate,
- int8_t compatibility, bool shouldBeSeamless) {
+int32_t ANativeWindow_setFrameRateWithChangeStrategy(ANativeWindow* window, float frameRate,
+ int8_t compatibility, int8_t changeFrameRateStrategy) {
if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) {
return -EINVAL;
}
- return native_window_set_frame_rate(window, frameRate, compatibility, shouldBeSeamless);
+ return native_window_set_frame_rate(window, frameRate, compatibility, changeFrameRateStrategy);
}
/**************************************************************************************************
diff --git a/libs/nativewindow/include/android/native_window.h b/libs/nativewindow/include/android/native_window.h
index 285f2fb7fe..50e9d53604 100644
--- a/libs/nativewindow/include/android/native_window.h
+++ b/libs/nativewindow/include/android/native_window.h
@@ -247,9 +247,10 @@ enum ANativeWindow_FrameRateCompatibility {
};
/**
- * Same as ANativeWindow_setFrameRateWithSeamlessness(window, frameRate, compatibility, true).
+ * Same as ANativeWindow_setFrameRateWithChangeStrategy(window, frameRate, compatibility,
+ * ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS).
*
- * See ANativeWindow_setFrameRateWithSeamlessness().
+ * See ANativeWindow_setFrameRateWithChangeStrategy().
*
* Available since API level 30.
*/
@@ -267,6 +268,19 @@ int32_t ANativeWindow_setFrameRate(ANativeWindow* window, float frameRate, int8_
*/
void ANativeWindow_tryAllocateBuffers(ANativeWindow* window) __INTRODUCED_IN(30);
+/** Change frame rate strategy value for ANativeWindow_setFrameRate. */
+enum ANativeWindow_ChangeFrameRateStrategy {
+ /**
+ * Change the frame rate only if the transition is going to be seamless.
+ */
+ ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS = 0,
+ /**
+ * Change the frame rate even if the transition is going to be non-seamless,
+ * i.e. with visual interruptions for the user.
+ */
+ ANATIVEWINDOW_CHANGE_FRAME_RATE_ALWAYS = 1
+} __INTRODUCED_IN(31);
+
/**
* Sets the intended frame rate for this window.
*
@@ -296,17 +310,16 @@ void ANativeWindow_tryAllocateBuffers(ANativeWindow* window) __INTRODUCED_IN(30)
* compatibility value may influence the system's choice of display refresh
* rate. See the ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_* values for more info.
*
- * \param shouldBeSeamless 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. True indicates that any frame rate changes caused by this
- * request should be seamless. False indicates that non-seamless refresh rates are also
- * acceptable.
+ * \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. See the ANATIVEWINDOW_CHANGE_FRAME_RATE_* values.
*
* \return 0 for success, -EINVAL if the window, frame rate, or compatibility
* value are invalid.
*/
-int32_t ANativeWindow_setFrameRateWithSeamlessness(ANativeWindow* window, float frameRate,
- int8_t compatibility, bool shouldBeSeamless) __INTRODUCED_IN(31);
+int32_t ANativeWindow_setFrameRateWithChangeStrategy(ANativeWindow* window, float frameRate,
+ int8_t compatibility, int8_t changeFrameRateStrategy)
+ __INTRODUCED_IN(31);
#ifdef __cplusplus
};
diff --git a/libs/nativewindow/include/system/window.h b/libs/nativewindow/include/system/window.h
index 7aa2cf4404..cc82bb4699 100644
--- a/libs/nativewindow/include/system/window.h
+++ b/libs/nativewindow/include/system/window.h
@@ -1019,9 +1019,9 @@ static inline int native_window_set_auto_prerotation(struct ANativeWindow* windo
}
static inline int native_window_set_frame_rate(struct ANativeWindow* window, float frameRate,
- int8_t compatibility, bool shouldBeSeamless) {
+ int8_t compatibility, int8_t changeFrameRateStrategy) {
return window->perform(window, NATIVE_WINDOW_SET_FRAME_RATE, (double)frameRate,
- (int)compatibility, (int)shouldBeSeamless);
+ (int)compatibility, (int)changeFrameRateStrategy);
}
static inline int native_window_set_frame_timeline_info(struct ANativeWindow* window,
diff --git a/libs/nativewindow/libnativewindow.map.txt b/libs/nativewindow/libnativewindow.map.txt
index 24d0e3badc..988132cd1c 100644
--- a/libs/nativewindow/libnativewindow.map.txt
+++ b/libs/nativewindow/libnativewindow.map.txt
@@ -47,7 +47,7 @@ LIBNATIVEWINDOW {
ANativeWindow_setBuffersTransform;
ANativeWindow_setDequeueTimeout; # apex # introduced=30
ANativeWindow_setFrameRate; # introduced=30
- ANativeWindow_setFrameRateWithSeamlessness; # introduced=31
+ ANativeWindow_setFrameRateWithChangeStrategy; # introduced=31
ANativeWindow_setSharedBufferMode; # llndk
ANativeWindow_setSwapInterval; # llndk
ANativeWindow_setUsage; # llndk