From 19fa0feaef631f92ab812cd1640252ade5fae1a2 Mon Sep 17 00:00:00 2001 From: John Lin Date: Mon, 2 Feb 2015 18:10:42 +0800 Subject: camera2: fix various BpCameraDeviceUser methods to return correct result. - submitRequest*(): res is the request ID and not always equals to NO_ERROR. - cancelRequest() and flush(): the result of reading last frame number should be put in resFrameNumber, not in res. Change-Id: Ic81c58f4ac14c05b3db4bdc5c99f48d00665d3fc Signed-off-by: John Lin --- camera/camera2/ICameraDeviceUser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'camera') diff --git a/camera/camera2/ICameraDeviceUser.cpp b/camera/camera2/ICameraDeviceUser.cpp index 35345d2..277b5db 100644 --- a/camera/camera2/ICameraDeviceUser.cpp +++ b/camera/camera2/ICameraDeviceUser.cpp @@ -107,7 +107,7 @@ public: } } - if ((res != NO_ERROR) || (resFrameNumber != NO_ERROR)) { + if ((res < NO_ERROR) || (resFrameNumber != NO_ERROR)) { res = FAILED_TRANSACTION; } return res; @@ -147,7 +147,7 @@ public: resFrameNumber = reply.readInt64(lastFrameNumber); } } - if ((res != NO_ERROR) || (resFrameNumber != NO_ERROR)) { + if ((res < NO_ERROR) || (resFrameNumber != NO_ERROR)) { res = FAILED_TRANSACTION; } return res; @@ -167,7 +167,7 @@ public: status_t resFrameNumber = BAD_VALUE; if (reply.readInt32() != 0) { if (lastFrameNumber != NULL) { - res = reply.readInt64(lastFrameNumber); + resFrameNumber = reply.readInt64(lastFrameNumber); } } if ((res != NO_ERROR) || (resFrameNumber != NO_ERROR)) { @@ -296,7 +296,7 @@ public: status_t resFrameNumber = BAD_VALUE; if (reply.readInt32() != 0) { if (lastFrameNumber != NULL) { - res = reply.readInt64(lastFrameNumber); + resFrameNumber = reply.readInt64(lastFrameNumber); } } if ((res != NO_ERROR) || (resFrameNumber != NO_ERROR)) { -- cgit v1.1