summaryrefslogtreecommitdiffstats
path: root/camera/camera2
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-08-23 17:47:06 -0700
committerIgor Murashkin <iam@google.com>2013-08-23 17:47:06 -0700
commit88aef23d00a509693a955b6a207c0fb023fbc92d (patch)
tree9f184b520c7e87a64771c7c1a3e572435f0c2132 /camera/camera2
parent33142e1e318c0c766a385d88d2434f62f9e2dfe7 (diff)
downloadframeworks_av-88aef23d00a509693a955b6a207c0fb023fbc92d.zip
frameworks_av-88aef23d00a509693a955b6a207c0fb023fbc92d.tar.gz
frameworks_av-88aef23d00a509693a955b6a207c0fb023fbc92d.tar.bz2
camera2: Get rid of annoying "Reading a NULL string...." error message
Bug: 10461464 Change-Id: Ie99f025db0e0e12c703f2d391e218b49330ee4dd
Diffstat (limited to 'camera/camera2')
-rw-r--r--camera/camera2/ICameraDeviceUser.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/camera/camera2/ICameraDeviceUser.cpp b/camera/camera2/ICameraDeviceUser.cpp
index 923f487..73fec72 100644
--- a/camera/camera2/ICameraDeviceUser.cpp
+++ b/camera/camera2/ICameraDeviceUser.cpp
@@ -43,6 +43,19 @@ enum {
WAIT_UNTIL_IDLE,
};
+namespace {
+ // Read empty strings without printing a false error message.
+ String16 readMaybeEmptyString16(const Parcel& parcel) {
+ size_t len;
+ const char16_t* str = parcel.readString16Inplace(&len);
+ if (str != NULL) {
+ return String16(str, len);
+ } else {
+ return String16();
+ }
+ }
+};
+
class BpCameraDeviceUser : public BpInterface<ICameraDeviceUser>
{
public:
@@ -250,7 +263,7 @@ status_t BnCameraDeviceUser::onTransact(
sp<IGraphicBufferProducer> bp;
if (data.readInt32() != 0) {
- String16 name = data.readString16();
+ String16 name = readMaybeEmptyString16(data);
bp = interface_cast<IGraphicBufferProducer>(
data.readStrongBinder());