summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-10-17 11:35:53 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-17 11:35:53 -0700
commiteb587070b99742ede04f1e864953106b1d157c84 (patch)
tree347ab8c57f156b2461a9baf3b9d61c24ada3a447 /libs
parent88217fea8a070c319b216de06df7dcd2cd172acd (diff)
parent3a73507801b56da83140fad14a1a3d4eced213d9 (diff)
downloadframeworks_base-eb587070b99742ede04f1e864953106b1d157c84.zip
frameworks_base-eb587070b99742ede04f1e864953106b1d157c84.tar.gz
frameworks_base-eb587070b99742ede04f1e864953106b1d157c84.tar.bz2
am 3a735078: Merge "SurfaceTexture: report binder transaction failures" into ics-mr0
* commit '3a73507801b56da83140fad14a1a3d4eced213d9': SurfaceTexture: report binder transaction failures
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/ISurfaceTexture.cpp79
1 files changed, 56 insertions, 23 deletions
diff --git a/libs/gui/ISurfaceTexture.cpp b/libs/gui/ISurfaceTexture.cpp
index babd2c0..d2e5627 100644
--- a/libs/gui/ISurfaceTexture.cpp
+++ b/libs/gui/ISurfaceTexture.cpp
@@ -58,13 +58,16 @@ public:
Parcel data, reply;
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
data.writeInt32(bufferIdx);
- remote()->transact(REQUEST_BUFFER, data, &reply);
+ status_t result =remote()->transact(REQUEST_BUFFER, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
bool nonNull = reply.readInt32();
if (nonNull) {
*buf = new GraphicBuffer();
reply.read(**buf);
}
- status_t result = reply.readInt32();
+ result = reply.readInt32();
return result;
}
@@ -73,9 +76,12 @@ public:
Parcel data, reply;
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
data.writeInt32(bufferCount);
- remote()->transact(SET_BUFFER_COUNT, data, &reply);
- status_t err = reply.readInt32();
- return err;
+ status_t result =remote()->transact(SET_BUFFER_COUNT, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
+ result = reply.readInt32();
+ return result;
}
virtual status_t dequeueBuffer(int *buf, uint32_t w, uint32_t h,
@@ -86,9 +92,12 @@ public:
data.writeInt32(h);
data.writeInt32(format);
data.writeInt32(usage);
- remote()->transact(DEQUEUE_BUFFER, data, &reply);
+ status_t result = remote()->transact(DEQUEUE_BUFFER, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
*buf = reply.readInt32();
- int result = reply.readInt32();
+ result = reply.readInt32();
return result;
}
@@ -98,11 +107,14 @@ public:
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
data.writeInt32(buf);
data.writeInt64(timestamp);
- remote()->transact(QUEUE_BUFFER, data, &reply);
+ status_t result = remote()->transact(QUEUE_BUFFER, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
*outWidth = reply.readInt32();
*outHeight = reply.readInt32();
*outTransform = reply.readInt32();
- status_t result = reply.readInt32();
+ result = reply.readInt32();
return result;
}
@@ -120,8 +132,11 @@ public:
data.writeFloat(reg.top);
data.writeFloat(reg.right);
data.writeFloat(reg.bottom);
- remote()->transact(SET_CROP, data, &reply);
- status_t result = reply.readInt32();
+ status_t result = remote()->transact(SET_CROP, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
+ result = reply.readInt32();
return result;
}
@@ -129,8 +144,11 @@ public:
Parcel data, reply;
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
data.writeInt32(transform);
- remote()->transact(SET_TRANSFORM, data, &reply);
- status_t result = reply.readInt32();
+ status_t result = remote()->transact(SET_TRANSFORM, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
+ result = reply.readInt32();
return result;
}
@@ -138,8 +156,11 @@ public:
Parcel data, reply;
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
data.writeInt32(mode);
- remote()->transact(SET_SCALING_MODE, data, &reply);
- status_t result = reply.readInt32();
+ status_t result = remote()->transact(SET_SCALING_MODE, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
+ result = reply.readInt32();
return result;
}
@@ -147,9 +168,12 @@ public:
Parcel data, reply;
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
data.writeInt32(what);
- remote()->transact(QUERY, data, &reply);
+ status_t result = remote()->transact(QUERY, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
value[0] = reply.readInt32();
- status_t result = reply.readInt32();
+ result = reply.readInt32();
return result;
}
@@ -157,8 +181,11 @@ public:
Parcel data, reply;
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
data.writeInt32(enabled);
- remote()->transact(SET_SYNCHRONOUS_MODE, data, &reply);
- status_t result = reply.readInt32();
+ status_t result = remote()->transact(SET_SYNCHRONOUS_MODE, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
+ result = reply.readInt32();
return result;
}
@@ -167,11 +194,14 @@ public:
Parcel data, reply;
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
data.writeInt32(api);
- remote()->transact(CONNECT, data, &reply);
+ status_t result = remote()->transact(CONNECT, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
*outWidth = reply.readInt32();
*outHeight = reply.readInt32();
*outTransform = reply.readInt32();
- status_t result = reply.readInt32();
+ result = reply.readInt32();
return result;
}
@@ -179,8 +209,11 @@ public:
Parcel data, reply;
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
data.writeInt32(api);
- remote()->transact(DISCONNECT, data, &reply);
- status_t result = reply.readInt32();
+ status_t result =remote()->transact(DISCONNECT, data, &reply);
+ if (result != NO_ERROR) {
+ return result;
+ }
+ result = reply.readInt32();
return result;
}
};