summaryrefslogtreecommitdiff
path: root/libs/gui/Surface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/Surface.cpp')
-rw-r--r--libs/gui/Surface.cpp42
1 files changed, 20 insertions, 22 deletions
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index a40837ce2a..7a2615f439 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -39,6 +39,7 @@
#include <ui/GraphicBuffer.h>
#include <ui/Region.h>
+#include <gui/AidlStatusUtil.h>
#include <gui/BufferItem.h>
#include <gui/IProducerListener.h>
@@ -49,6 +50,7 @@
namespace android {
+using gui::aidl_utils::statusTFromBinderStatus;
using ui::Dataspace;
namespace {
@@ -182,7 +184,7 @@ status_t Surface::getDisplayRefreshCycleDuration(nsecs_t* outRefreshDuration) {
gui::DisplayStatInfo stats;
binder::Status status = composerServiceAIDL()->getDisplayStats(nullptr, &stats);
if (!status.isOk()) {
- return status.transactionError();
+ return statusTFromBinderStatus(status);
}
*outRefreshDuration = stats.vsyncPeriod;
@@ -355,7 +357,7 @@ status_t Surface::getWideColorSupport(bool* supported) {
*supported = false;
binder::Status status = composerServiceAIDL()->isWideColorDisplay(display, supported);
- return status.transactionError();
+ return statusTFromBinderStatus(status);
}
status_t Surface::getHdrSupport(bool* supported) {
@@ -369,7 +371,7 @@ status_t Surface::getHdrSupport(bool* supported) {
gui::DynamicDisplayInfo info;
if (binder::Status status = composerServiceAIDL()->getDynamicDisplayInfo(display, &info);
!status.isOk()) {
- return status.transactionError();
+ return statusTFromBinderStatus(status);
}
*supported = !info.hdrCapabilities.supportedHdrTypes.empty();
@@ -1288,15 +1290,12 @@ int Surface::query(int what, int* value) const {
if (err == NO_ERROR) {
return NO_ERROR;
}
- sp<ISurfaceComposer> surfaceComposer = composerService();
+ sp<gui::ISurfaceComposer> surfaceComposer = composerServiceAIDL();
if (surfaceComposer == nullptr) {
return -EPERM; // likely permissions error
}
- if (surfaceComposer->authenticateSurfaceTexture(mGraphicBufferProducer)) {
- *value = 1;
- } else {
- *value = 0;
- }
+ // ISurfaceComposer no longer supports authenticateSurfaceTexture
+ *value = 0;
return NO_ERROR;
}
case NATIVE_WINDOW_CONCRETE_TYPE:
@@ -1868,7 +1867,11 @@ int Surface::dispatchSetFrameTimelineInfo(va_list args) {
auto startTimeNanos = static_cast<int64_t>(va_arg(args, int64_t));
ALOGV("Surface::%s", __func__);
- return setFrameTimelineInfo({frameTimelineVsyncId, inputEventId, startTimeNanos});
+ FrameTimelineInfo ftlInfo;
+ ftlInfo.vsyncId = frameTimelineVsyncId;
+ ftlInfo.inputEventId = inputEventId;
+ ftlInfo.startTimeNanos = startTimeNanos;
+ return setFrameTimelineInfo(ftlInfo);
}
bool Surface::transformToDisplayInverse() const {
@@ -2624,22 +2627,17 @@ void Surface::ProducerListenerProxy::onBuffersDiscarded(const std::vector<int32_
mSurfaceListener->onBuffersDiscarded(discardedBufs);
}
-status_t Surface::setFrameRate(float frameRate, int8_t compatibility,
- int8_t changeFrameRateStrategy) {
+status_t Surface::setFrameRate(float /*frameRate*/, int8_t /*compatibility*/,
+ int8_t /*changeFrameRateStrategy*/) {
ATRACE_CALL();
ALOGV("Surface::setFrameRate");
-
- if (!ValidateFrameRate(frameRate, compatibility, changeFrameRateStrategy,
- "Surface::setFrameRate")) {
- return BAD_VALUE;
- }
-
- return composerService()->setFrameRate(mGraphicBufferProducer, frameRate, compatibility,
- changeFrameRateStrategy);
+ // ISurfaceComposer no longer supports setFrameRate
+ return BAD_VALUE;
}
-status_t Surface::setFrameTimelineInfo(const FrameTimelineInfo& frameTimelineInfo) {
- return composerService()->setFrameTimelineInfo(mGraphicBufferProducer, frameTimelineInfo);
+status_t Surface::setFrameTimelineInfo(const FrameTimelineInfo& /*frameTimelineInfo*/) {
+ // ISurfaceComposer no longer supports setFrameTimelineInfo
+ return BAD_VALUE;
}
sp<IBinder> Surface::getSurfaceControlHandle() const {