Merge "wifi hostapd: add to current.xml"
diff --git a/audio/common/all-versions/default/service/Android.mk b/audio/common/all-versions/default/service/Android.mk
index e6ae03e..84de75e 100644
--- a/audio/common/all-versions/default/service/Android.mk
+++ b/audio/common/all-versions/default/service/Android.mk
@@ -57,4 +57,7 @@
LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
endif
+# b/117506164
+LOCAL_SANITIZE := never
+
include $(BUILD_EXECUTABLE)
diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h
index f27c739..f3256f1 100644
--- a/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h
+++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h
@@ -101,6 +101,7 @@
case -ENOENT: {
// No more effects available.
result.resize(i);
+ break;
}
default: {
result.resize(0);
diff --git a/camera/metadata/3.3/types.hal b/camera/metadata/3.3/types.hal
index a37e132..d21bb7c 100644
--- a/camera/metadata/3.3/types.hal
+++ b/camera/metadata/3.3/types.hal
@@ -100,7 +100,7 @@
/** android.request.availablePhysicalCameraRequestKeys [static, int32[], hidden]
*
- * <p>A subset of the available request keys that can be overriden for
+ * <p>A subset of the available request keys that can be overridden for
* physical devices backing a logical multi-camera.</p>
*/
ANDROID_REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS,
diff --git a/current.txt b/current.txt
index ad45c26..a7989d4 100644
--- a/current.txt
+++ b/current.txt
@@ -388,7 +388,7 @@
2a55e224aa9bc62c0387cd85ad3c97e33f0c33a4e1489cbae86b2523e6f9df35 android.hardware.camera.device@3.2::ICameraDevice
f61b616732d8f374e030f90575d7eba3ecc99d209a05b945949ba892bcb81e1d android.hardware.camera.device@3.2::ICameraDeviceSession
684702a60deef03a1e8093961dc0a18c555c857ad5a77ba7340b0635ae01eb70 android.hardware.camera.device@3.4::ICameraDeviceSession
-a95745bbf76aea16a76518bd7efe70cabc5886d09eaeffc993c2e1787a22ed23 android.hardware.camera.metadata@3.3::types
+dd2436f251a90f3e5e7ed773b1aeae21e381b00ae26b10ebe3a1001c894e5980 android.hardware.camera.metadata@3.3::types
da33234403ff5d60f3473711917b9948e6484a4260b5247acdafb111193a9de2 android.hardware.configstore@1.0::ISurfaceFlingerConfigs
78886339f2c848cf13c1edd3ebba63f89796b2620d3bf3b5c21d038a53519ba0 android.hardware.gnss@1.0::IGnssMeasurementCallback
b7ecf29927055ec422ec44bf776223f07d79ad9f92ccf9becf167e62c2607e7a android.hardware.keymaster@4.0::IKeymasterDevice
diff --git a/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h
index 0050e52..a64268f 100644
--- a/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h
+++ b/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h
@@ -34,9 +34,11 @@
namespace neuralnetworks {
namespace V1_1 {
-using V1_0::Request;
using V1_0::DeviceStatus;
using V1_0::ErrorStatus;
+using V1_0::Operand;
+using V1_0::OperandType;
+using V1_0::Request;
namespace vts {
namespace functional {
diff --git a/neuralnetworks/1.2/Android.bp b/neuralnetworks/1.2/Android.bp
index e183a26..3c4ff8b 100644
--- a/neuralnetworks/1.2/Android.bp
+++ b/neuralnetworks/1.2/Android.bp
@@ -17,6 +17,8 @@
],
types: [
"Model",
+ "Operand",
+ "OperandType",
"Operation",
"OperationType",
],
diff --git a/neuralnetworks/1.2/types.hal b/neuralnetworks/1.2/types.hal
index bed1d5c..95e97c4 100644
--- a/neuralnetworks/1.2/types.hal
+++ b/neuralnetworks/1.2/types.hal
@@ -16,10 +16,22 @@
package android.hardware.neuralnetworks@1.2;
-import @1.0::Operand;
+import @1.0::DataLocation;
+import @1.0::OperandLifeTime;
+import @1.0::OperandType;
import @1.0::PerformanceInfo;
import @1.1::OperationType;
+enum OperandType : @1.0::OperandType {
+ /**
+ * An 8 bit boolean scalar value.
+ *
+ * Values of this operand type are either true or false. A zero value
+ * represents false; any other value represents true.
+ */
+ BOOL = 6,
+};
+
/**
* Operation types.
*
@@ -102,6 +114,101 @@
};
/**
+ * Describes one operand of the model's graph.
+ */
+struct Operand {
+ /**
+ * Data type of the operand.
+ */
+ OperandType type;
+
+ /**
+ * Dimensions of the operand.
+ *
+ * For a scalar operand, dimensions.size() must be 0.
+ *
+ * For a tensor operand, dimensions.size() must be at least 1;
+ * however, any of the dimensions may be unspecified.
+ *
+ * A tensor operand with all dimensions specified has "fully
+ * specified" dimensions. Whenever possible (i.e., whenever the
+ * dimensions are known at model construction time), a tensor
+ * operand should have (but is not required to have) fully
+ * specified dimensions, in order to enable the best possible
+ * performance.
+ *
+ * If a tensor operand's dimensions are not fully specified, the
+ * dimensions of the operand are deduced from the operand
+ * dimensions and values of the operation for which that operand
+ * is an output.
+ *
+ * In the following situations, a tensor operand's dimensions must
+ * be fully specified:
+ *
+ * . The operand has lifetime CONSTANT_COPY or
+ * CONSTANT_REFERENCE.
+ *
+ * . The operand has lifetime MODEL_INPUT or MODEL_OUTPUT. Fully
+ * specified dimensions must either be present in the
+ * Operand or they must be provided in the corresponding
+ * RequestArgument.
+ * EXCEPTION: If the input or output is optional and omitted
+ * (by setting the hasNoValue field of the corresponding
+ * RequestArgument to true) then it need not have fully
+ * specified dimensions.
+ *
+ * A tensor operand with some number of unspecified dimensions is
+ * represented by setting each unspecified dimension to 0.
+ */
+ vec<uint32_t> dimensions;
+
+ /**
+ * The number of times this operand appears as an operation input.
+ *
+ * (For example, if this operand appears once in one operation's
+ * input list, and three times in another operation's input list,
+ * then numberOfConsumers = 4.)
+ */
+ uint32_t numberOfConsumers;
+
+ /**
+ * Quantized scale of the operand.
+ *
+ * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM or
+ * TENSOR_INT32.
+ */
+ float scale;
+
+ /**
+ * Quantized zero-point offset of the operand.
+ *
+ * Only applicable if the operand is of type TENSOR_QUANT8_ASYMM.
+ */
+ int32_t zeroPoint;
+
+ /**
+ * How the operand is used.
+ */
+ OperandLifeTime lifetime;
+
+ /**
+ * Where to find the data for this operand.
+ * If the lifetime is TEMPORARY_VARIABLE, MODEL_INPUT, MODEL_OUTPUT, or
+ * NO_VALUE:
+ * - All the fields must be 0.
+ * If the lifetime is CONSTANT_COPY:
+ * - location.poolIndex is 0.
+ * - location.offset is the offset in bytes into Model.operandValues.
+ * - location.length is set.
+ * If the lifetime is CONSTANT_REFERENCE:
+ * - location.poolIndex is set.
+ * - location.offset is the offset in bytes into the specified pool.
+ * - location.length is set.
+ */
+ DataLocation location;
+};
+
+/**
* A Neural Network Model.
*
* This includes not only the execution graph, but also constant data such as
diff --git a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
index 7ec6ff1..5a8b8c5 100644
--- a/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
+++ b/neuralnetworks/1.2/vts/functional/ValidateModel.cpp
@@ -26,9 +26,7 @@
namespace V1_2 {
using V1_0::IPreparedModel;
-using V1_0::Operand;
using V1_0::OperandLifeTime;
-using V1_0::OperandType;
using V1_1::ExecutionPreference;
namespace vts {
@@ -131,10 +129,10 @@
///////////////////////// VALIDATE MODEL OPERAND TYPE /////////////////////////
static const int32_t invalidOperandTypes[] = {
- static_cast<int32_t>(OperandType::FLOAT32) - 1, // lower bound fundamental
- static_cast<int32_t>(OperandType::TENSOR_QUANT8_ASYMM) + 1, // upper bound fundamental
- static_cast<int32_t>(OperandType::OEM) - 1, // lower bound OEM
- static_cast<int32_t>(OperandType::TENSOR_OEM_BYTE) + 1, // upper bound OEM
+ static_cast<int32_t>(OperandType::FLOAT32) - 1, // lower bound fundamental
+ static_cast<int32_t>(OperandType::BOOL) + 1, // upper bound fundamental
+ static_cast<int32_t>(OperandType::OEM) - 1, // lower bound OEM
+ static_cast<int32_t>(OperandType::TENSOR_OEM_BYTE) + 1, // upper bound OEM
};
static void mutateOperandTypeTest(const sp<IDevice>& device, const Model& model) {
@@ -157,6 +155,7 @@
case OperandType::FLOAT32:
case OperandType::INT32:
case OperandType::UINT32:
+ case OperandType::BOOL:
return 1;
case OperandType::TENSOR_FLOAT32:
case OperandType::TENSOR_INT32:
@@ -185,6 +184,7 @@
case OperandType::FLOAT32:
case OperandType::INT32:
case OperandType::UINT32:
+ case OperandType::BOOL:
case OperandType::TENSOR_FLOAT32:
return 1.0f;
case OperandType::TENSOR_INT32:
@@ -214,6 +214,7 @@
case OperandType::FLOAT32:
case OperandType::INT32:
case OperandType::UINT32:
+ case OperandType::BOOL:
case OperandType::TENSOR_FLOAT32:
case OperandType::TENSOR_INT32:
return {1};
@@ -253,6 +254,7 @@
case OperandType::FLOAT32:
case OperandType::INT32:
case OperandType::UINT32:
+ case OperandType::BOOL:
newOperand.dimensions = hidl_vec<uint32_t>();
newOperand.scale = 0.0f;
newOperand.zeroPoint = 0;
diff --git a/radio/1.3/Android.bp b/radio/1.3/Android.bp
index 6a9b1d0..b6610e0 100644
--- a/radio/1.3/Android.bp
+++ b/radio/1.3/Android.bp
@@ -17,6 +17,7 @@
"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 a41f4b2..9f0cc15 100644
--- a/radio/1.3/types.hal
+++ b/radio/1.3/types.hal
@@ -26,6 +26,8 @@
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 @@
* 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/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp
index a5747d4..52f5e4f 100644
--- a/sensors/1.0/default/convert.cpp
+++ b/sensors/1.0/default/convert.cpp
@@ -74,8 +74,7 @@
};
switch (dst->sensorType) {
- case SensorType::META_DATA:
- {
+ case SensorType::META_DATA: {
dst->u.meta.what = (MetaDataEventType)src.meta_data.what;
// Legacy HALs contain the handle reference in the meta data field.
// Copy that over to the handle of the event. In legacy HALs this
@@ -89,8 +88,7 @@
case SensorType::ORIENTATION:
case SensorType::GYROSCOPE:
case SensorType::GRAVITY:
- case SensorType::LINEAR_ACCELERATION:
- {
+ case SensorType::LINEAR_ACCELERATION: {
dst->u.vec3.x = src.acceleration.x;
dst->u.vec3.y = src.acceleration.y;
dst->u.vec3.z = src.acceleration.z;
@@ -98,10 +96,7 @@
break;
}
- case SensorType::ROTATION_VECTOR:
- case SensorType::GAME_ROTATION_VECTOR:
- case SensorType::GEOMAGNETIC_ROTATION_VECTOR:
- {
+ case SensorType::GAME_ROTATION_VECTOR: {
dst->u.vec4.x = src.data[0];
dst->u.vec4.y = src.data[1];
dst->u.vec4.z = src.data[2];
@@ -109,151 +104,150 @@
break;
}
- case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
- case SensorType::GYROSCOPE_UNCALIBRATED:
- case SensorType::ACCELEROMETER_UNCALIBRATED:
- {
- dst->u.uncal.x = src.uncalibrated_gyro.x_uncalib;
- dst->u.uncal.y = src.uncalibrated_gyro.y_uncalib;
- dst->u.uncal.z = src.uncalibrated_gyro.z_uncalib;
- dst->u.uncal.x_bias = src.uncalibrated_gyro.x_bias;
- dst->u.uncal.y_bias = src.uncalibrated_gyro.y_bias;
- dst->u.uncal.z_bias = src.uncalibrated_gyro.z_bias;
- break;
- }
+ case SensorType::ROTATION_VECTOR:
+ case SensorType::GEOMAGNETIC_ROTATION_VECTOR: {
+ dst->u.data[0] = src.data[0];
+ dst->u.data[1] = src.data[1];
+ dst->u.data[2] = src.data[2];
+ dst->u.data[3] = src.data[3];
+ dst->u.data[4] = src.data[4];
+ break;
+ }
- case SensorType::DEVICE_ORIENTATION:
- case SensorType::LIGHT:
- case SensorType::PRESSURE:
- case SensorType::TEMPERATURE:
- case SensorType::PROXIMITY:
- case SensorType::RELATIVE_HUMIDITY:
- case SensorType::AMBIENT_TEMPERATURE:
- case SensorType::SIGNIFICANT_MOTION:
- case SensorType::STEP_DETECTOR:
- case SensorType::TILT_DETECTOR:
- case SensorType::WAKE_GESTURE:
- case SensorType::GLANCE_GESTURE:
- case SensorType::PICK_UP_GESTURE:
- case SensorType::WRIST_TILT_GESTURE:
- case SensorType::STATIONARY_DETECT:
- case SensorType::MOTION_DETECT:
- case SensorType::HEART_BEAT:
- case SensorType::LOW_LATENCY_OFFBODY_DETECT:
- {
- dst->u.scalar = src.data[0];
- break;
- }
+ case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
+ case SensorType::GYROSCOPE_UNCALIBRATED:
+ case SensorType::ACCELEROMETER_UNCALIBRATED: {
+ dst->u.uncal.x = src.uncalibrated_gyro.x_uncalib;
+ dst->u.uncal.y = src.uncalibrated_gyro.y_uncalib;
+ dst->u.uncal.z = src.uncalibrated_gyro.z_uncalib;
+ dst->u.uncal.x_bias = src.uncalibrated_gyro.x_bias;
+ dst->u.uncal.y_bias = src.uncalibrated_gyro.y_bias;
+ dst->u.uncal.z_bias = src.uncalibrated_gyro.z_bias;
+ break;
+ }
- case SensorType::STEP_COUNTER:
- {
- dst->u.stepCount = src.u64.step_counter;
- break;
- }
+ case SensorType::DEVICE_ORIENTATION:
+ case SensorType::LIGHT:
+ case SensorType::PRESSURE:
+ case SensorType::TEMPERATURE:
+ case SensorType::PROXIMITY:
+ case SensorType::RELATIVE_HUMIDITY:
+ case SensorType::AMBIENT_TEMPERATURE:
+ case SensorType::SIGNIFICANT_MOTION:
+ case SensorType::STEP_DETECTOR:
+ case SensorType::TILT_DETECTOR:
+ case SensorType::WAKE_GESTURE:
+ case SensorType::GLANCE_GESTURE:
+ case SensorType::PICK_UP_GESTURE:
+ case SensorType::WRIST_TILT_GESTURE:
+ case SensorType::STATIONARY_DETECT:
+ case SensorType::MOTION_DETECT:
+ case SensorType::HEART_BEAT:
+ case SensorType::LOW_LATENCY_OFFBODY_DETECT: {
+ dst->u.scalar = src.data[0];
+ break;
+ }
- case SensorType::HEART_RATE:
- {
- dst->u.heartRate.bpm = src.heart_rate.bpm;
- dst->u.heartRate.status = (SensorStatus)src.heart_rate.status;
- break;
- }
+ case SensorType::STEP_COUNTER: {
+ dst->u.stepCount = src.u64.step_counter;
+ break;
+ }
- case SensorType::POSE_6DOF: // 15 floats
- {
- for (size_t i = 0; i < 15; ++i) {
- dst->u.pose6DOF[i] = src.data[i];
- }
- break;
- }
+ case SensorType::HEART_RATE: {
+ dst->u.heartRate.bpm = src.heart_rate.bpm;
+ dst->u.heartRate.status = (SensorStatus)src.heart_rate.status;
+ break;
+ }
- case SensorType::DYNAMIC_SENSOR_META:
- {
- dst->u.dynamic.connected = src.dynamic_sensor_meta.connected;
- dst->u.dynamic.sensorHandle = src.dynamic_sensor_meta.handle;
+ case SensorType::POSE_6DOF: { // 15 floats
+ for (size_t i = 0; i < 15; ++i) {
+ dst->u.pose6DOF[i] = src.data[i];
+ }
+ break;
+ }
- memcpy(dst->u.dynamic.uuid.data(),
- src.dynamic_sensor_meta.uuid,
- 16);
+ case SensorType::DYNAMIC_SENSOR_META: {
+ dst->u.dynamic.connected = src.dynamic_sensor_meta.connected;
+ dst->u.dynamic.sensorHandle = src.dynamic_sensor_meta.handle;
- break;
- }
+ memcpy(dst->u.dynamic.uuid.data(), src.dynamic_sensor_meta.uuid, 16);
- case SensorType::ADDITIONAL_INFO:
- {
- ::android::hardware::sensors::V1_0::AdditionalInfo *dstInfo =
- &dst->u.additional;
+ break;
+ }
- const additional_info_event_t &srcInfo = src.additional_info;
+ case SensorType::ADDITIONAL_INFO: {
+ ::android::hardware::sensors::V1_0::AdditionalInfo* dstInfo = &dst->u.additional;
- dstInfo->type =
- (::android::hardware::sensors::V1_0::AdditionalInfoType)
- srcInfo.type;
+ const additional_info_event_t& srcInfo = src.additional_info;
- dstInfo->serial = srcInfo.serial;
+ dstInfo->type = (::android::hardware::sensors::V1_0::AdditionalInfoType)srcInfo.type;
- CHECK_EQ(sizeof(dstInfo->u), sizeof(srcInfo.data_int32));
- memcpy(&dstInfo->u, srcInfo.data_int32, sizeof(srcInfo.data_int32));
- break;
- }
+ dstInfo->serial = srcInfo.serial;
- default:
- {
- CHECK_GE((int32_t)dst->sensorType,
- (int32_t)SensorType::DEVICE_PRIVATE_BASE);
+ CHECK_EQ(sizeof(dstInfo->u), sizeof(srcInfo.data_int32));
+ memcpy(&dstInfo->u, srcInfo.data_int32, sizeof(srcInfo.data_int32));
+ break;
+ }
- memcpy(dst->u.data.data(), src.data, 16 * sizeof(float));
- break;
- }
- }
+ default: {
+ CHECK_GE((int32_t)dst->sensorType, (int32_t)SensorType::DEVICE_PRIVATE_BASE);
+
+ memcpy(dst->u.data.data(), src.data, 16 * sizeof(float));
+ break;
+ }
+ }
}
void convertToSensorEvent(const Event &src, sensors_event_t *dst) {
- *dst = {
- .version = sizeof(sensors_event_t),
- .sensor = src.sensorHandle,
- .type = (int32_t)src.sensorType,
- .reserved0 = 0,
- .timestamp = src.timestamp
- };
+ *dst = {.version = sizeof(sensors_event_t),
+ .sensor = src.sensorHandle,
+ .type = (int32_t)src.sensorType,
+ .reserved0 = 0,
+ .timestamp = src.timestamp};
- switch (src.sensorType) {
- case SensorType::META_DATA:
- {
- // Legacy HALs expect the handle reference in the meta data field.
- // Copy it over from the handle of the event.
- dst->meta_data.what = (int32_t)src.u.meta.what;
- dst->meta_data.sensor = src.sensorHandle;
- // Set the sensor handle to 0 to maintain compatibility.
- dst->sensor = 0;
- break;
- }
+ switch (src.sensorType) {
+ case SensorType::META_DATA: {
+ // Legacy HALs expect the handle reference in the meta data field.
+ // Copy it over from the handle of the event.
+ dst->meta_data.what = (int32_t)src.u.meta.what;
+ dst->meta_data.sensor = src.sensorHandle;
+ // Set the sensor handle to 0 to maintain compatibility.
+ dst->sensor = 0;
+ break;
+ }
- case SensorType::ACCELEROMETER:
- case SensorType::MAGNETIC_FIELD:
- case SensorType::ORIENTATION:
- case SensorType::GYROSCOPE:
- case SensorType::GRAVITY:
- case SensorType::LINEAR_ACCELERATION:
- {
- dst->acceleration.x = src.u.vec3.x;
- dst->acceleration.y = src.u.vec3.y;
- dst->acceleration.z = src.u.vec3.z;
- dst->acceleration.status = (int8_t)src.u.vec3.status;
- break;
- }
+ case SensorType::ACCELEROMETER:
+ case SensorType::MAGNETIC_FIELD:
+ case SensorType::ORIENTATION:
+ case SensorType::GYROSCOPE:
+ case SensorType::GRAVITY:
+ case SensorType::LINEAR_ACCELERATION: {
+ dst->acceleration.x = src.u.vec3.x;
+ dst->acceleration.y = src.u.vec3.y;
+ dst->acceleration.z = src.u.vec3.z;
+ dst->acceleration.status = (int8_t)src.u.vec3.status;
+ break;
+ }
- case SensorType::ROTATION_VECTOR:
- case SensorType::GAME_ROTATION_VECTOR:
- case SensorType::GEOMAGNETIC_ROTATION_VECTOR:
- {
- dst->data[0] = src.u.vec4.x;
- dst->data[1] = src.u.vec4.y;
- dst->data[2] = src.u.vec4.z;
- dst->data[3] = src.u.vec4.w;
- break;
- }
+ case SensorType::GAME_ROTATION_VECTOR: {
+ dst->data[0] = src.u.vec4.x;
+ dst->data[1] = src.u.vec4.y;
+ dst->data[2] = src.u.vec4.z;
+ dst->data[3] = src.u.vec4.w;
+ break;
+ }
- case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
+ case SensorType::ROTATION_VECTOR:
+ case SensorType::GEOMAGNETIC_ROTATION_VECTOR: {
+ dst->data[0] = src.u.data[0];
+ dst->data[1] = src.u.data[1];
+ dst->data[2] = src.u.data[2];
+ dst->data[3] = src.u.data[3];
+ dst->data[4] = src.u.data[4];
+ break;
+ }
+
+ case SensorType::MAGNETIC_FIELD_UNCALIBRATED:
case SensorType::GYROSCOPE_UNCALIBRATED:
case SensorType::ACCELEROMETER_UNCALIBRATED:
{
@@ -283,35 +277,30 @@
case SensorType::STATIONARY_DETECT:
case SensorType::MOTION_DETECT:
case SensorType::HEART_BEAT:
- case SensorType::LOW_LATENCY_OFFBODY_DETECT:
- {
+ case SensorType::LOW_LATENCY_OFFBODY_DETECT: {
dst->data[0] = src.u.scalar;
break;
}
- case SensorType::STEP_COUNTER:
- {
+ case SensorType::STEP_COUNTER: {
dst->u64.step_counter = src.u.stepCount;
break;
}
- case SensorType::HEART_RATE:
- {
+ case SensorType::HEART_RATE: {
dst->heart_rate.bpm = src.u.heartRate.bpm;
dst->heart_rate.status = (int8_t)src.u.heartRate.status;
break;
}
- case SensorType::POSE_6DOF: // 15 floats
- {
+ case SensorType::POSE_6DOF: { // 15 floats
for (size_t i = 0; i < 15; ++i) {
dst->data[i] = src.u.pose6DOF[i];
}
break;
}
- case SensorType::DYNAMIC_SENSOR_META:
- {
+ case SensorType::DYNAMIC_SENSOR_META: {
dst->dynamic_sensor_meta.connected = src.u.dynamic.connected;
dst->dynamic_sensor_meta.handle = src.u.dynamic.sensorHandle;
dst->dynamic_sensor_meta.sensor = NULL; // to be filled in later
@@ -323,8 +312,7 @@
break;
}
- case SensorType::ADDITIONAL_INFO:
- {
+ case SensorType::ADDITIONAL_INFO: {
const ::android::hardware::sensors::V1_0::AdditionalInfo &srcInfo =
src.u.additional;
@@ -341,8 +329,7 @@
break;
}
- default:
- {
+ default: {
CHECK_GE((int32_t)src.sensorType,
(int32_t)SensorType::DEVICE_PRIVATE_BASE);
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;