Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8271f1a2 authored by Igor Murashkin's avatar Igor Murashkin Committed by Android (Google) Code Review
Browse files

Merge "camera2: Get rid of annoying "Reading a NULL string...." error message" into klp-dev

parents 3bd3690f 88aef23d
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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());