[NDK] Expose NDK API to set buffers data space for P.
Previously, ANativeWindow_setBuffersDataSpace is only available in VNDK. This
patch exposes it in NDK so that display mode for NativeWindow buffer can be set
through NDK. The API will remain available in VNDK of NativeWindow since VNDK
is the super set of NDK.
BUG: 62482961
Test: bit CtsGraphicsTestCases:.ANativeWindowTest
Change-Id: I576c4b87296e168d4b7360c437a32bbbbff690a5
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index a4aec6e..e08d6b0 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -881,6 +881,10 @@
*value = mGraphicBufferProducer != nullptr ? 1 : 0;
return NO_ERROR;
}
+ case NATIVE_WINDOW_DATASPACE: {
+ *value = static_cast<int>(mDataSpace);
+ return NO_ERROR;
+ }
}
}
return mGraphicBufferProducer->query(what, value);