Add monostate to optional safe unions.
Bug: 116156870
Test: hidl_test, hidl_test_java
Change-Id: Ie17a80dee982775e267a39086016071ac2361fb5
diff --git a/tests/safeunion/1.0/Android.bp b/tests/safeunion/1.0/Android.bp
index ede8401..87edd53 100644
--- a/tests/safeunion/1.0/Android.bp
+++ b/tests/safeunion/1.0/Android.bp
@@ -9,6 +9,7 @@
],
interfaces: [
"android.hidl.base@1.0",
+ "android.hidl.safe_union@1.0",
],
gen_java: true,
}
diff --git a/tests/safeunion/1.0/ISafeUnion.hal b/tests/safeunion/1.0/ISafeUnion.hal
index f48248b..58c08c6 100644
--- a/tests/safeunion/1.0/ISafeUnion.hal
+++ b/tests/safeunion/1.0/ISafeUnion.hal
@@ -18,6 +18,8 @@
import IOtherInterface;
+import android.hidl.safe_union@1.0::Monostate;
+
interface ISafeUnion {
enum BitField : uint8_t {
@@ -33,14 +35,15 @@
string j3;
};
- safe_union EmptySafeUnion {
- };
-
safe_union SmallSafeUnion {
+ Monostate noinit;
+
uint8_t a;
};
safe_union LargeSafeUnion {
+ Monostate noinit;
+
int8_t a;
uint16_t b;
int32_t c;
@@ -66,6 +69,8 @@
};
safe_union InterfaceTypeSafeUnion {
+ Monostate noinit;
+
uint32_t a;
int8_t[7] b;
IOtherInterface c;
@@ -76,6 +81,8 @@
};
safe_union HandleTypeSafeUnion {
+ Monostate noinit;
+
handle a;
handle[5] b;
vec<handle> c;