summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSteven Moreland2018-10-10 15:59:36 -0500
committerSteven Moreland2018-10-11 13:02:25 -0500
commitdec5272582ace2253090f29a5b3c8734d5b19234 (patch)
tree1a184535c897b48fdea563448926f1d5d035eae8 /tests
parentf59720c6b85f93d2ddc94244eb66e805ea820636 (diff)
downloadplatform-hardware-interfaces-dec5272582ace2253090f29a5b3c8734d5b19234.tar.gz
platform-hardware-interfaces-dec5272582ace2253090f29a5b3c8734d5b19234.tar.xz
platform-hardware-interfaces-dec5272582ace2253090f29a5b3c8734d5b19234.zip
Add monostate to optional safe unions.
Bug: 116156870 Test: hidl_test, hidl_test_java Change-Id: Ie17a80dee982775e267a39086016071ac2361fb5
Diffstat (limited to 'tests')
-rw-r--r--tests/safeunion/1.0/Android.bp1
-rw-r--r--tests/safeunion/1.0/ISafeUnion.hal13
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/safeunion/1.0/Android.bp b/tests/safeunion/1.0/Android.bp
index ede84018..87edd537 100644
--- a/tests/safeunion/1.0/Android.bp
+++ b/tests/safeunion/1.0/Android.bp
@@ -9,6 +9,7 @@ hidl_interface {
9 ], 9 ],
10 interfaces: [ 10 interfaces: [
11 "android.hidl.base@1.0", 11 "android.hidl.base@1.0",
12 "android.hidl.safe_union@1.0",
12 ], 13 ],
13 gen_java: true, 14 gen_java: true,
14} 15}
diff --git a/tests/safeunion/1.0/ISafeUnion.hal b/tests/safeunion/1.0/ISafeUnion.hal
index f48248b5..58c08c61 100644
--- a/tests/safeunion/1.0/ISafeUnion.hal
+++ b/tests/safeunion/1.0/ISafeUnion.hal
@@ -18,6 +18,8 @@ package android.hardware.tests.safeunion@1.0;
18 18
19import IOtherInterface; 19import IOtherInterface;
20 20
21import android.hidl.safe_union@1.0::Monostate;
22
21interface ISafeUnion { 23interface ISafeUnion {
22 24
23 enum BitField : uint8_t { 25 enum BitField : uint8_t {
@@ -33,14 +35,15 @@ interface ISafeUnion {
33 string j3; 35 string j3;
34 }; 36 };
35 37
36 safe_union EmptySafeUnion {
37 };
38
39 safe_union SmallSafeUnion { 38 safe_union SmallSafeUnion {
39 Monostate noinit;
40
40 uint8_t a; 41 uint8_t a;
41 }; 42 };
42 43
43 safe_union LargeSafeUnion { 44 safe_union LargeSafeUnion {
45 Monostate noinit;
46
44 int8_t a; 47 int8_t a;
45 uint16_t b; 48 uint16_t b;
46 int32_t c; 49 int32_t c;
@@ -66,6 +69,8 @@ interface ISafeUnion {
66 }; 69 };
67 70
68 safe_union InterfaceTypeSafeUnion { 71 safe_union InterfaceTypeSafeUnion {
72 Monostate noinit;
73
69 uint32_t a; 74 uint32_t a;
70 int8_t[7] b; 75 int8_t[7] b;
71 IOtherInterface c; 76 IOtherInterface c;
@@ -76,6 +81,8 @@ interface ISafeUnion {
76 }; 81 };
77 82
78 safe_union HandleTypeSafeUnion { 83 safe_union HandleTypeSafeUnion {
84 Monostate noinit;
85
79 handle a; 86 handle a;
80 handle[5] b; 87 handle[5] b;
81 vec<handle> c; 88 vec<handle> c;