summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbdeng3X <bingx.deng@intel.com>2014-03-20 09:15:34 +0800
committerGuobin Zhang <guobin.zhang@intel.com>2014-03-27 09:09:19 +0800
commitc2633ce19bdbca4cbf8d6a225ede68a0afd693b9 (patch)
tree086c187dbfa47f5789d5d3a09d39e6bd6157b2af
parentb1a8c016371282a3cd3b113e6b2c0310372babf2 (diff)
downloadnative-c2633ce19bdbca4cbf8d6a225ede68a0afd693b9.tar.gz
GraphicProducerWrapper may return false transact status
GraphicProducerWrapper(GPW) changed how the methods of BpGraphicBufferProducer(BpGBP) are executed. First, "fake" BpGBP is created. Its remote is GPW. The GPW has wrapped the real BpGBP. All the method calls to the fake BpGPB will be intercepted by the GPW inside it when the methods run into remote()->transact(). Then the GPW will invoke the transact() of the real BpGBP. And Everything runs well except that the GPW forgets to store the transact status and always return NO_ERROR to the fake BpGBP. It would be disastrous if the binder call of the IGBP failed and the out parameter "reply" of transact() was in unkown state. E.g. the queueBuffer() in the fake BpGBP will try to operate on the "reply". This will crash the SurfaceFlinger. Change-Id: I01b31f64e1fc92804da3f16c1fb1420dcfb3b855 Signed-off-by: bdeng3X <bingx.deng@intel.com> Signed-off-by: Guobin Zhang <guobin.zhang@intel.com>
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index bc559ccf73..943ed02216 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2639,7 +2639,7 @@ class GraphicProducerWrapper : public BBinder, public MessageHandler {
looper->sendMessage(this, Message(MSG_API_CALL));
barrier.wait();
}
- return NO_ERROR;
+ return result;
}
/*
@@ -2649,7 +2649,7 @@ class GraphicProducerWrapper : public BBinder, public MessageHandler {
virtual void handleMessage(const Message& message) {
android_atomic_release_load(&memoryBarrier);
if (message.what == MSG_API_CALL) {
- impl->asBinder()->transact(code, data[0], reply);
+ result = impl->asBinder()->transact(code, data[0], reply);
barrier.open();
} else if (message.what == MSG_EXIT) {
exitRequested = true;