Add examples to area access documentation
Also add VTS checks to ensure WRITE_ONLY configs don't exist along with
READ_ONLY and READ_WRITE configs
Bug: 332598311
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: Ie3d38fc2fd582d8949736739e83d277d75d69e62
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index 4ea6dfe..30661a2 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -752,9 +752,15 @@
}
}
- if (readOnlyPresent && !writeOnlyPresent) {
+ if (readOnlyPresent) {
+ ASSERT_FALSE(writeOnlyPresent) << StringPrintf(
+ "Found both READ_ONLY and WRITE_ONLY access modes in area configs, which is not "
+ "supported");
maximalAreaAccessSubset = toInt(VehiclePropertyAccess::READ);
} else if (writeOnlyPresent) {
+ ASSERT_FALSE(readWritePresent) << StringPrintf(
+ "Found both WRITE_ONLY and READ_WRITE access modes in area configs, which is not "
+ "supported");
maximalAreaAccessSubset = toInt(VehiclePropertyAccess::WRITE);
} else if (readWritePresent) {
maximalAreaAccessSubset = toInt(VehiclePropertyAccess::READ_WRITE);