framework: fix setDisplayContentSamplingEnabled rc
Return code was documented as true-as-success, but test
was implemented as false-for-success. Correct code so the
doc is correct.
Test: atest FrameworksServicesTests:DisplayManagerServiceTest
Change-Id: Ifc1ecda24735b64942090527866d19d6f75cda8b
Fixes: 122483211
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 6a4b633..f292d25 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -438,8 +438,9 @@
static jboolean nativeSetDisplayedContentSamplingEnabled(JNIEnv* env, jclass clazz,
jobject tokenObj, jboolean enable, jint componentMask, jint maxFrames) {
sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
- return SurfaceComposerClient::setDisplayContentSamplingEnabled(
+ status_t rc = SurfaceComposerClient::setDisplayContentSamplingEnabled(
token, enable, componentMask, maxFrames);
+ return rc == OK;
}
static jobject nativeGetDisplayedContentSample(JNIEnv* env, jclass clazz, jobject tokenObj,