Add 'nullable' parameter to Java readEmbeddedBuffer calls.
Embedded buffers in vectors may be null.
Bug: 34255213
Test: hidl_test_java
Change-Id: Iab5a2d8d3ed35c94d5cafad70623c0c0d695e9a9
diff --git a/StringType.cpp b/StringType.cpp
index f093b65..f3f95ae 100644
--- a/StringType.cpp
+++ b/StringType.cpp
@@ -166,10 +166,13 @@
out.indent();
out.indent();
+ // hidl_string's embedded buffer is never null(able), because it defaults to a
+ // buffer containing an empty string.
out << blobName
<< ".handle(),\n"
<< offset
- << " + 0 /* offsetof(hidl_string, mBuffer) */);\n\n";
+ << " + 0 /* offsetof(hidl_string, mBuffer) */,"
+ << "false /* nullable */);\n\n";
out.unindent();
out.unindent();
diff --git a/VectorType.cpp b/VectorType.cpp
index 1c1271a..a58ea2c 100644
--- a/VectorType.cpp
+++ b/VectorType.cpp
@@ -587,7 +587,8 @@
out << blobName
<< ".handle(),\n"
<< offset
- << " + 0 /* offsetof(hidl_vec<T>, mBuffer) */);\n\n";
+ << " + 0 /* offsetof(hidl_vec<T>, mBuffer) */,"
+ << "true /* nullable */);\n\n";
out.unindent();
out.unindent();