summaryrefslogtreecommitdiff
path: root/libs/gui/IGraphicBufferProducer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/IGraphicBufferProducer.cpp')
-rw-r--r--libs/gui/IGraphicBufferProducer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/gui/IGraphicBufferProducer.cpp b/libs/gui/IGraphicBufferProducer.cpp
index cfe726bc0b..d7a78850dd 100644
--- a/libs/gui/IGraphicBufferProducer.cpp
+++ b/libs/gui/IGraphicBufferProducer.cpp
@@ -48,6 +48,7 @@ enum {
ALLOCATE_BUFFERS,
ALLOW_ALLOCATION,
SET_GENERATION_NUMBER,
+ GET_CONSUMER_NAME,
};
class BpGraphicBufferProducer : public BpInterface<IGraphicBufferProducer>
@@ -296,6 +297,17 @@ public:
}
return result;
}
+
+ virtual String8 getConsumerName() const {
+ Parcel data, reply;
+ data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
+ status_t result = remote()->transact(GET_CONSUMER_NAME, data, &reply);
+ if (result != NO_ERROR) {
+ ALOGE("getConsumerName failed to transact: %d", result);
+ return String8("TransactFailed");
+ }
+ return reply.readString8();
+ }
};
// Out-of-line virtual method definition to trigger vtable emission in this
@@ -467,6 +479,11 @@ status_t BnGraphicBufferProducer::onTransact(
reply->writeInt32(result);
return NO_ERROR;
}
+ case GET_CONSUMER_NAME: {
+ CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
+ reply->writeString8(getConsumerName());
+ return NO_ERROR;
+ }
}
return BBinder::onTransact(code, data, reply, flags);
}