summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin DuBois <kevindubois@google.com> 2019-01-08 16:57:03 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-01-08 16:57:03 +0000
commitdf8fdf4e3fcff1200e559be2b8a49030c54e76ee (patch)
tree94d051e9012df532e70b2c643fb6c8a0f24148ad
parentcb577bca431c00aaa30d547f893ead9c2fa15f18 (diff)
parent205a6809e107a9a2208bb6918cc19e1cab2c4675 (diff)
Merge "framework: fix setDisplayContentSamplingEnabled rc"
-rw-r--r--core/jni/android_view_SurfaceControl.cpp3
-rw-r--r--services/tests/servicestests/src/com/android/server/display/DisplayManagerServiceTest.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 6a4b633df6a2..f292d25c15fe 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -438,8 +438,9 @@ static jobject nativeGetDisplayedContentSamplingAttributes(JNIEnv* env, jclass c
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,
diff --git a/services/tests/servicestests/src/com/android/server/display/DisplayManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/display/DisplayManagerServiceTest.java
index abf90402250c..4742a73b17a8 100644
--- a/services/tests/servicestests/src/com/android/server/display/DisplayManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/DisplayManagerServiceTest.java
@@ -389,7 +389,7 @@ public class DisplayManagerServiceTest {
if (attr == null) return; //sampling not supported on device, skip remainder of test.
boolean enabled = displayManager.setDisplayedContentSamplingEnabledInternal(0, true, 0, 0);
- assertTrue(!enabled);
+ assertTrue(enabled);
displayManager.setDisplayedContentSamplingEnabledInternal(0, false, 0, 0);
DisplayedContentSample sample = displayManager.getDisplayedContentSampleInternal(0, 0, 0);