summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2018-10-11 21:23:27 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-10-11 21:23:27 +0000
commit17c437eac177fc47e5315d0e5e1e162a4dc9ecf8 (patch)
tree6e1ee95b4ff5a3254790d9412a935956b05aac75
parent76c45692bf79861eac818c1406d56648b7912f0f (diff)
parentdec5272582ace2253090f29a5b3c8734d5b19234 (diff)
downloadplatform_hardware_interfaces-17c437eac177fc47e5315d0e5e1e162a4dc9ecf8.tar.gz
platform_hardware_interfaces-17c437eac177fc47e5315d0e5e1e162a4dc9ecf8.tar.bz2
platform_hardware_interfaces-17c437eac177fc47e5315d0e5e1e162a4dc9ecf8.zip
Merge "Add monostate to optional safe unions."
-rw-r--r--radio/1.3/Android.bp1
-rw-r--r--radio/1.3/types.hal4
-rw-r--r--tests/safeunion/1.0/Android.bp1
-rw-r--r--tests/safeunion/1.0/ISafeUnion.hal13
4 files changed, 16 insertions, 3 deletions
diff --git a/radio/1.3/Android.bp b/radio/1.3/Android.bp
index 6a9b1d05c8..b6610e0602 100644
--- a/radio/1.3/Android.bp
+++ b/radio/1.3/Android.bp
@@ -17,6 +17,7 @@ hidl_interface {
"android.hardware.radio@1.1",
"android.hardware.radio@1.2",
"android.hidl.base@1.0",
+ "android.hidl.safe_union@1.0",
],
types: [
"AccessNetwork",
diff --git a/radio/1.3/types.hal b/radio/1.3/types.hal
index a41f4b2d65..9f0cc15cbb 100644
--- a/radio/1.3/types.hal
+++ b/radio/1.3/types.hal
@@ -26,6 +26,8 @@ import @1.2::AccessNetwork;
import @1.2::CellIdentity;
import @1.2::DataRegStateResult;
+import android.hidl.safe_union@1.0::Monostate;
+
enum AccessNetwork : @1.2::AccessNetwork {
/**
* Unknown access network
@@ -162,6 +164,8 @@ struct DataRegStateResult {
* will be empty when device is camped only on 2G/3G .
*/
safe_union VopsInfo {
+ Monostate noinit;
+
LteVopsInfo lteVopsInfo; // LTE network capability
} vopsInfo;
};
diff --git a/tests/safeunion/1.0/Android.bp b/tests/safeunion/1.0/Android.bp
index ede840188a..87edd537f4 100644
--- a/tests/safeunion/1.0/Android.bp
+++ b/tests/safeunion/1.0/Android.bp
@@ -9,6 +9,7 @@ hidl_interface {
],
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 f48248b51b..58c08c6153 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;
import IOtherInterface;
+import android.hidl.safe_union@1.0::Monostate;
+
interface ISafeUnion {
enum BitField : uint8_t {
@@ -33,14 +35,15 @@ interface ISafeUnion {
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 @@ interface ISafeUnion {
};
safe_union InterfaceTypeSafeUnion {
+ Monostate noinit;
+
uint32_t a;
int8_t[7] b;
IOtherInterface c;
@@ -76,6 +81,8 @@ interface ISafeUnion {
};
safe_union HandleTypeSafeUnion {
+ Monostate noinit;
+
handle a;
handle[5] b;
vec<handle> c;