Merge "Allow not implementing some config and network Radio HAL methods" into main
diff --git a/automotive/can/OWNERS b/automotive/can/OWNERS
index ffa4828..b738dac 100644
--- a/automotive/can/OWNERS
+++ b/automotive/can/OWNERS
@@ -1,3 +1,2 @@
-kevinme@google.com
chrisweir@google.com
twasilczyk@google.com
diff --git a/automotive/vehicle/OWNERS b/automotive/vehicle/OWNERS
index 22049de..066af9a 100644
--- a/automotive/vehicle/OWNERS
+++ b/automotive/vehicle/OWNERS
@@ -1,8 +1,6 @@
ericjeong@google.com
shanyu@google.com
-# GRPC VHAL
-
# Property definition
per-file aidl_property/** = tylertrephan@google.com
per-file aidl/generated_lib/** = tylertrephan@google.com
diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING
index de59fdc..cdc6e56 100644
--- a/automotive/vehicle/TEST_MAPPING
+++ b/automotive/vehicle/TEST_MAPPING
@@ -48,6 +48,9 @@
"name": "GRPCVehicleHardwareUnitTest"
},
{
+ "name": "GRPCVehicleProxyServerUnitTest"
+ },
+ {
"name": "CarServiceHalUnitTest"
},
{
diff --git a/automotive/vehicle/aidl/impl/current/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/current/default_config/config/DefaultProperties.json
index 90c53bd..2915cc1 100644
--- a/automotive/vehicle/aidl/impl/current/default_config/config/DefaultProperties.json
+++ b/automotive/vehicle/aidl/impl/current/default_config/config/DefaultProperties.json
@@ -166,22 +166,38 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -191,22 +207,38 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -246,27 +278,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -281,27 +333,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -316,27 +388,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -351,27 +443,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -386,27 +498,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -421,27 +553,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -456,27 +608,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -491,27 +663,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -526,27 +718,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -561,27 +773,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -596,27 +828,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -631,27 +883,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -666,27 +938,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -701,27 +993,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -736,27 +1048,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -771,27 +1103,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -806,27 +1158,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -841,27 +1213,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -876,27 +1268,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -911,27 +1323,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -946,27 +1378,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -981,27 +1433,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -1016,27 +1488,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -1051,27 +1543,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -1183,27 +1695,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -1218,27 +1750,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -1253,27 +1805,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -1288,27 +1860,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -1323,12 +1915,20 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 5
+ "maxInt32Value": 5,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 5
+ "maxInt32Value": 5,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -1674,22 +2274,38 @@
{
"areaId": "Constants::WHEEL_FRONT_LEFT",
"minFloatValue": 193.0,
- "maxFloatValue": 300.0
+ "maxFloatValue": 300.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WHEEL_FRONT_RIGHT",
"minFloatValue": 193.0,
- "maxFloatValue": 300.0
+ "maxFloatValue": 300.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WHEEL_REAR_LEFT",
"minFloatValue": 193.0,
- "maxFloatValue": 300.0
+ "maxFloatValue": 300.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WHEEL_REAR_RIGHT",
"minFloatValue": 193.0,
- "maxFloatValue": 300.0
+ "maxFloatValue": 300.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
],
"comment": "Units in kpa",
@@ -1809,7 +2425,11 @@
},
"areaId": "Constants::WHEEL_FRONT_LEFT",
"minInt32Value": -100,
- "maxInt32Value": 100
+ "maxInt32Value": 100,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"defaultValue": {
@@ -1819,7 +2439,11 @@
},
"areaId": "Constants::WHEEL_FRONT_RIGHT",
"minInt32Value": -100,
- "maxInt32Value": 100
+ "maxInt32Value": 100,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"defaultValue": {
@@ -1829,7 +2453,11 @@
},
"areaId": "Constants::WHEEL_REAR_RIGHT",
"minInt32Value": -100,
- "maxInt32Value": 100
+ "maxInt32Value": 100,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"defaultValue": {
@@ -1839,7 +2467,11 @@
},
"areaId": "Constants::WHEEL_REAR_LEFT",
"minInt32Value": -100,
- "maxInt32Value": 100
+ "maxInt32Value": 100,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
],
"maxSampleRate": 10.0,
@@ -1903,7 +2535,11 @@
{
"areaId": 0,
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -2326,27 +2962,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": 1,
- "maxInt32Value": 7
+ "maxInt32Value": 7,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": 1,
- "maxInt32Value": 7
+ "maxInt32Value": 7,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": 1,
- "maxInt32Value": 7
+ "maxInt32Value": 7,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": 1,
- "maxInt32Value": 7
+ "maxInt32Value": 7,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": 1,
- "maxInt32Value": 7
+ "maxInt32Value": 7,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -2418,27 +3074,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": 0,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
],
"comment": "0 is off and +ve values indicate ventilation level."
@@ -2454,7 +3130,11 @@
{
"areaId": 0,
"minInt32Value": -2,
- "maxInt32Value": 2
+ "maxInt32Value": 2,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
],
"comment": "+ve values for heating and -ve for cooling"
@@ -2470,27 +3150,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minInt32Value": -2,
- "maxInt32Value": 2
+ "maxInt32Value": 2,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": -2,
- "maxInt32Value": 2
+ "maxInt32Value": 2,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minInt32Value": -2,
- "maxInt32Value": 2
+ "maxInt32Value": 2,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minInt32Value": -2,
- "maxInt32Value": 2
+ "maxInt32Value": 2,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minInt32Value": -2,
- "maxInt32Value": 2
+ "maxInt32Value": 2,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
],
"comment": "+ve values for heating and -ve for cooling"
@@ -2506,7 +3206,11 @@
{
"areaId": "Constants::MIRROR_DRIVER_LEFT_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 2
+ "maxInt32Value": 2,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -2546,27 +3250,47 @@
{
"areaId": "Constants::SEAT_1_LEFT",
"minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "maxFloatValue": 32.5,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_1_RIGHT",
"minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "maxFloatValue": 32.5,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_LEFT",
"minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "maxFloatValue": 32.5,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_RIGHT",
"minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "maxFloatValue": 32.5,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::SEAT_2_CENTER",
"minFloatValue": 17.5,
- "maxFloatValue": 32.5
+ "maxFloatValue": 32.5,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
],
"comment":
@@ -2802,27 +3526,47 @@
{
"areaId": "Constants::DOOR_1_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::DOOR_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::DOOR_2_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::DOOR_2_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::DOOR_REAR",
"minInt32Value": 0,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -2837,22 +3581,38 @@
{
"areaId": "Constants::DOOR_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::DOOR_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::DOOR_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::DOOR_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -2867,17 +3627,29 @@
{
"areaId": "VehicleAreaMirror::DRIVER_LEFT",
"minInt32Value": -3,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "VehicleAreaMirror::DRIVER_RIGHT",
"minInt32Value": -3,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "VehicleAreaMirror::DRIVER_CENTER",
"minInt32Value": -3,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -2892,17 +3664,29 @@
{
"areaId": "VehicleAreaMirror::DRIVER_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "VehicleAreaMirror::DRIVER_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "VehicleAreaMirror::DRIVER_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -2917,17 +3701,29 @@
{
"areaId": "VehicleAreaMirror::DRIVER_LEFT",
"minInt32Value": -3,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "VehicleAreaMirror::DRIVER_RIGHT",
"minInt32Value": -3,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "VehicleAreaMirror::DRIVER_CENTER",
"minInt32Value": -3,
- "maxInt32Value": 3
+ "maxInt32Value": 3,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -2942,17 +3738,29 @@
{
"areaId": "VehicleAreaMirror::DRIVER_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "VehicleAreaMirror::DRIVER_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "VehicleAreaMirror::DRIVER_CENTER",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -3022,27 +3830,47 @@
{
"areaId": "Constants::WINDOW_1_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_2_LEFT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_2_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_ROOF_TOP_1",
"minInt32Value": -10,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -3057,27 +3885,47 @@
{
"areaId": "Constants::WINDOW_1_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_1_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_2_LEFT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_2_RIGHT",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "Constants::WINDOW_ROOF_TOP_1",
"minInt32Value": -1,
- "maxInt32Value": 1
+ "maxInt32Value": 1,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -3092,12 +3940,20 @@
{
"areaId": "VehicleAreaWindow::FRONT_WINDSHIELD",
"minInt32Value": 0,
- "maxInt32Value": 3000
+ "maxInt32Value": 3000,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"areaId": "VehicleAreaWindow::REAR_WINDSHIELD",
"minInt32Value": 0,
- "maxInt32Value": 3000
+ "maxInt32Value": 3000,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -3178,7 +4034,11 @@
{
"areaId": 0,
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -3193,7 +4053,11 @@
{
"areaId": 0,
"minInt32Value": -2,
- "maxInt32Value": 2
+ "maxInt32Value": 2,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -3208,7 +4072,11 @@
{
"areaId": 0,
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -3223,7 +4091,11 @@
{
"areaId": 0,
"minInt32Value": -2,
- "maxInt32Value": 2
+ "maxInt32Value": 2,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -3262,7 +4134,11 @@
{
"areaId": "Constants::SEAT_1_RIGHT",
"minInt32Value": 0,
- "maxInt32Value": 10
+ "maxInt32Value": 10,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -4565,7 +5441,11 @@
{
"areaId": 0,
"minFloatValue": 20.0,
- "maxFloatValue": 35.0
+ "maxFloatValue": 35.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
]
},
@@ -4596,7 +5476,11 @@
{
"areaId": 0,
"minInt32Value": 0,
- "maxInt32Value": 200000
+ "maxInt32Value": 200000,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
],
"maxSampleRate": 10.0,
diff --git a/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json b/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json
index 83debf7..5779050 100644
--- a/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json
+++ b/automotive/vehicle/aidl/impl/current/default_config/config/TestProperties.json
@@ -77,7 +77,11 @@
},
"areaId": "Constants::HVAC_LEFT",
"minFloatValue": -10.0,
- "maxFloatValue": 10.0
+ "maxFloatValue": 10.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
},
{
"defaultValue": {
@@ -87,7 +91,11 @@
},
"areaId": "Constants::HVAC_RIGHT",
"minFloatValue": -10.0,
- "maxFloatValue": 10.0
+ "maxFloatValue": 10.0,
+ "hasSupportedValueInfo": {
+ "hasMinSupportedValue": true,
+ "hasMaxSupportedValue": true
+ }
}
],
"access": "VehiclePropertyAccess::READ_WRITE",
@@ -103,6 +111,8 @@
]
},
"areaId": "VehicleAreaWindow::FRONT_WINDSHIELD",
+ "minInt32Value": -100,
+ "maxInt32Value": 100,
"hasSupportedValueInfo": {
"hasMinSupportedValue": true,
"hasMaxSupportedValue": true,
diff --git a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/include/FakeVehicleHardware.h
index e20befc..b9d315a 100644
--- a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/include/FakeVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/include/FakeVehicleHardware.h
@@ -193,6 +193,13 @@
int32_t mMaxSupportedValueForTestIntProp GUARDED_BY(mLock) = 10;
std::vector<int32_t> mSupportedValuesListForTestIntProp GUARDED_BY(mLock) = {0, 2, 4, 6, 8, 10};
+ std::unordered_map<PropIdAreaId, aidl::android::hardware::automotive::vehicle::RawPropValues,
+ PropIdAreaIdHash>
+ mMinSupportedValueByPropIdAreaId GUARDED_BY(mLock);
+ std::unordered_map<PropIdAreaId, aidl::android::hardware::automotive::vehicle::RawPropValues,
+ PropIdAreaIdHash>
+ mMaxSupportedValueByPropIdAreaId GUARDED_BY(mLock);
+
// PendingRequestHandler is thread-safe.
mutable PendingRequestHandler<GetValuesCallback,
aidl::android::hardware::automotive::vehicle::GetValueRequest>
@@ -323,6 +330,15 @@
void triggerSupportedValueChange(
const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config)
EXCLUDES(mLock);
+ void triggerSupportedValueChange(int32_t propId, int32_t areaId) EXCLUDES(mLock);
+ template <class T>
+ void setMinSupportedValueLocked(int32_t propId, int32_t areaId, T minValue) REQUIRES(mLock);
+ template <class T>
+ void setMaxSupportedValueLocked(int32_t propId, int32_t areaId, T maxValue) REQUIRES(mLock);
+ template <class T>
+ android::base::Result<void> parseAndSetMinMaxValue(int32_t propId, int32_t areaId,
+ const std::vector<std::string>& options,
+ size_t index) EXCLUDES(mLock);
static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwInputKeyProp(
aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction action,
@@ -355,6 +371,9 @@
size_t index);
static android::base::Result<int32_t> parseAreaId(const std::vector<std::string>& options,
size_t index, int32_t propId);
+ template <class T>
+ static android::base::Result<std::vector<T>> parseValues(
+ const std::vector<std::string>& options, size_t index);
};
} // namespace fake
diff --git a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/src/FakeVehicleHardware.cpp
index 01e40fb..c174e92 100644
--- a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -398,26 +398,128 @@
return configsByPropId;
}
+template <>
+void FakeVehicleHardware::setMinSupportedValueLocked(int32_t propId, int32_t areaId,
+ int32_t minValue) {
+ mMinSupportedValueByPropIdAreaId[PropIdAreaId{.propId = propId, .areaId = areaId}] =
+ RawPropValues{.int32Values = {minValue}};
+}
+
+template <>
+void FakeVehicleHardware::setMaxSupportedValueLocked(int32_t propId, int32_t areaId,
+ int32_t maxValue) {
+ mMaxSupportedValueByPropIdAreaId[PropIdAreaId{.propId = propId, .areaId = areaId}] =
+ RawPropValues{.int32Values = {maxValue}};
+}
+
+template <>
+void FakeVehicleHardware::setMinSupportedValueLocked(int32_t propId, int32_t areaId,
+ int64_t minValue) {
+ mMinSupportedValueByPropIdAreaId[PropIdAreaId{.propId = propId, .areaId = areaId}] =
+ RawPropValues{.int64Values = {minValue}};
+}
+
+template <>
+void FakeVehicleHardware::setMaxSupportedValueLocked(int32_t propId, int32_t areaId,
+ int64_t maxValue) {
+ mMaxSupportedValueByPropIdAreaId[PropIdAreaId{.propId = propId, .areaId = areaId}] =
+ RawPropValues{.int64Values = {maxValue}};
+}
+
+template <>
+void FakeVehicleHardware::setMinSupportedValueLocked(int32_t propId, int32_t areaId,
+ float minValue) {
+ mMinSupportedValueByPropIdAreaId[PropIdAreaId{.propId = propId, .areaId = areaId}] =
+ RawPropValues{.floatValues = {minValue}};
+}
+
+template <>
+void FakeVehicleHardware::setMaxSupportedValueLocked(int32_t propId, int32_t areaId,
+ float maxValue) {
+ mMaxSupportedValueByPropIdAreaId[PropIdAreaId{.propId = propId, .areaId = areaId}] =
+ RawPropValues{.floatValues = {maxValue}};
+}
+
void FakeVehicleHardware::init(int32_t s2rS2dConfig) {
maybeGetGrpcServiceInfo(&mPowerControllerServiceAddress);
- for (auto& [_, configDeclaration] : loadConfigDeclarations()) {
- VehiclePropConfig cfg = configDeclaration.config;
- VehiclePropertyStore::TokenFunction tokenFunction = nullptr;
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ for (auto& [_, configDeclaration] : loadConfigDeclarations()) {
+ VehiclePropConfig cfg = configDeclaration.config;
+ VehiclePropertyStore::TokenFunction tokenFunction = nullptr;
- if (cfg.prop == toInt(VehicleProperty::AP_POWER_STATE_REQ)) {
- cfg.configArray[0] = s2rS2dConfig;
- } else if (cfg.prop == OBD2_FREEZE_FRAME) {
- tokenFunction = [](const VehiclePropValue& propValue) { return propValue.timestamp; };
- }
+ if (cfg.prop == toInt(VehicleProperty::AP_POWER_STATE_REQ)) {
+ cfg.configArray[0] = s2rS2dConfig;
+ } else if (cfg.prop == OBD2_FREEZE_FRAME) {
+ tokenFunction = [](const VehiclePropValue& propValue) {
+ return propValue.timestamp;
+ };
+ }
- mServerSidePropStore->registerProperty(cfg, tokenFunction);
- if (obd2frame::FakeObd2Frame::isDiagnosticProperty(cfg)) {
- // Ignore storing default value for diagnostic property. They have special get/set
- // logic.
- continue;
+ mServerSidePropStore->registerProperty(cfg, tokenFunction);
+ if (obd2frame::FakeObd2Frame::isDiagnosticProperty(cfg)) {
+ // Ignore storing default value for diagnostic property. They have special get/set
+ // logic.
+ continue;
+ }
+ storePropInitialValue(configDeclaration);
+
+ int32_t propertyType = cfg.prop & toInt(VehiclePropertyType::MASK);
+ for (const auto& areaConfig : cfg.areaConfigs) {
+ if (!areaConfig.hasSupportedValueInfo.has_value()) {
+ continue;
+ }
+ if (!areaConfig.hasSupportedValueInfo->hasMinSupportedValue &&
+ !areaConfig.hasSupportedValueInfo->hasMaxSupportedValue) {
+ continue;
+ }
+ if (areaConfig.hasSupportedValueInfo->hasMinSupportedValue) {
+ RawPropValues rawPropValues = {};
+ switch (propertyType) {
+ case toInt(VehiclePropertyType::INT32):
+ setMinSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.minInt32Value);
+ break;
+ case toInt(VehiclePropertyType::INT64):
+ setMinSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.minInt64Value);
+ break;
+ case toInt(VehiclePropertyType::FLOAT):
+ setMinSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.minFloatValue);
+ break;
+ default:
+ ALOGE("hasMinSupportedValue must only be true for INT32, INT64 or "
+ "FLOAT "
+ "type property");
+ continue;
+ }
+ }
+ if (areaConfig.hasSupportedValueInfo->hasMaxSupportedValue) {
+ RawPropValues rawPropValues = {};
+ switch (propertyType) {
+ case toInt(VehiclePropertyType::INT32):
+ setMaxSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.maxInt32Value);
+ break;
+ case toInt(VehiclePropertyType::INT64):
+ setMaxSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.maxInt64Value);
+ break;
+ case toInt(VehiclePropertyType::FLOAT):
+ setMaxSupportedValueLocked(cfg.prop, areaConfig.areaId,
+ areaConfig.maxFloatValue);
+ break;
+ default:
+ ALOGE("hasMaxSupportedValue must only be true for INT32, INT64 or "
+ "FLOAT "
+ "type property");
+ continue;
+ }
+ }
+ }
}
- storePropInitialValue(configDeclaration);
}
// OBD2_LIVE_FRAME and OBD2_FREEZE_FRAME must be configured in default configs.
@@ -1800,38 +1902,122 @@
}
std::string FakeVehicleHardware::dumpSetMinMaxValue(const std::vector<std::string>& options) {
- if (auto result = checkArgumentsSize(options, /*minSize=*/3); !result.ok()) {
- return getErrorMsg(result);
+ // Requires at least --set-minmaxvalue <PropId> <MinValue> <MaxValue>
+ if (auto result = checkArgumentsSize(options, /*minSize=*/4); !result.ok()) {
+ return StringPrintf("Not enough arguments\n");
}
- int testPropId = toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY);
- auto configResult = mServerSidePropStore->getPropConfig(testPropId);
+ size_t index = 1;
+ const std::string& propIdStr = options[index];
+ auto maybePropId = parsePropId(options, index);
+ index++;
+ if (!maybePropId.ok()) {
+ return StringPrintf("Failed to set min/max supported value: propId not valid: %s\n",
+ propIdStr.c_str());
+ }
+ int32_t propId = maybePropId.value();
+ auto configResult = mServerSidePropStore->getPropConfig(propId);
if (!configResult.ok()) {
- return "Failed to set min/max supported value: VENDOR_EXTENSION_INT_PROPERTY not supported";
+ return "Failed to set min/max supported value: property not supported\n";
}
- int32_t values[2];
- for (size_t i = 1; i < 3; i++) {
- auto int32Result = safelyParseInt<int32_t>(i, options[i]);
- if (!int32Result.ok()) {
- return StringPrintf(
- "Failed to set min/max supported value: Value: \"%s\" is not a valid int: %s\n",
- options[i].c_str(), getErrorMsg(int32Result).c_str());
+ std::string areaIdStr = "0";
+ int32_t areaId = 0;
+ if (EqualsIgnoreCase(options[index], "-a")) {
+ index++;
+ if (index >= options.size()) {
+ return StringPrintf("Not enough arguments\n");
}
- values[i - 1] = int32Result.value();
+ areaIdStr = options[index];
+ auto maybeAreaId = parseAreaId(options, index, propId);
+ if (!maybeAreaId.ok()) {
+ return StringPrintf("Failed to set min/max supported value: areaId not valid: %s\n",
+ areaIdStr.c_str());
+ }
+ areaId = maybeAreaId.value();
+ index++;
}
- int32_t minValue = values[0];
- int32_t maxValue = values[1];
+
+ if (index + 1 >= options.size()) {
+ return StringPrintf("Not enough arguments\n");
+ }
+ Result<void> parseAndSetValueResult = {};
+ switch (propId & toInt(VehiclePropertyType::MASK)) {
+ case toInt(VehiclePropertyType::INT32):
+ parseAndSetValueResult =
+ parseAndSetMinMaxValue<int32_t>(propId, areaId, options, index);
+ break;
+ case toInt(VehiclePropertyType::INT64):
+ parseAndSetValueResult =
+ parseAndSetMinMaxValue<int64_t>(propId, areaId, options, index);
+ break;
+ case toInt(VehiclePropertyType::FLOAT):
+ parseAndSetValueResult = parseAndSetMinMaxValue<float>(propId, areaId, options, index);
+ break;
+ default:
+ return StringPrintf(
+ "Failed to set min/max supported value: only int32/int64/float type"
+ " property is supported\n");
+ }
+ if (!parseAndSetValueResult.ok()) {
+ return parseAndSetValueResult.error().message();
+ }
+
+ triggerSupportedValueChange(propId, areaId);
+ return StringPrintf("Min/Max supported value for propId: %s, areaId: %s set", propIdStr.c_str(),
+ areaIdStr.c_str());
+}
+
+template <class T>
+Result<void> FakeVehicleHardware::parseAndSetMinMaxValue(int32_t propId, int32_t areaId,
+ const std::vector<std::string>& options,
+ size_t index) {
+ auto valuesResult = parseValues<T>(options, index);
+ if (!valuesResult.ok()) {
+ return Error() << "Failed to set min/max supported value: "
+ << valuesResult.error().message();
+ }
+ T minValue = (*valuesResult)[0];
+ T maxValue = (*valuesResult)[1];
if (minValue > maxValue) {
- return StringPrintf("Failed to set min/max supported value: MinValue: %" PRId32
- " must not > MaxValue: %" PRId32,
- minValue, maxValue);
+ return Error() << "Failed to set min/max supported value: MinValue: " << minValue
+ << " must not > MaxValue: " << maxValue;
}
{
std::scoped_lock<std::mutex> lockGuard(mLock);
- mMinSupportedValueForTestIntProp = minValue;
- mMaxSupportedValueForTestIntProp = maxValue;
+ setMinSupportedValueLocked(propId, areaId, minValue);
+ setMaxSupportedValueLocked(propId, areaId, maxValue);
}
- triggerSupportedValueChange(configResult.value());
- return "Min/Max supported value for VENDOR_EXTENSION_INT_PROPERTY set";
+ return {};
+}
+
+template <class T>
+Result<std::vector<T>> FakeVehicleHardware::parseValues(const std::vector<std::string>& options,
+ size_t index) {
+ std::vector<T> values;
+ for (size_t i = index; i < index + 2; i++) {
+ auto result = safelyParseInt<T>(i, options[i]);
+ if (!result.ok()) {
+ return Error() << StringPrintf("Value: \"%s\" is not a valid int: %s",
+ options[i].c_str(), getErrorMsg(result).c_str());
+ }
+ values.push_back(result.value());
+ }
+ return values;
+}
+
+// This is a special version of parseValues for float type.
+template <>
+Result<std::vector<float>> FakeVehicleHardware::parseValues(const std::vector<std::string>& options,
+ size_t index) {
+ std::vector<float> values;
+ for (size_t i = index; i < index + 2; i++) {
+ auto result = safelyParseFloat(i, options[i]);
+ if (!result.ok()) {
+ return Error() << StringPrintf("Value: \"%s\" is not a valid float: %s",
+ options[i].c_str(), getErrorMsg(result).c_str());
+ }
+ values.push_back(result.value());
+ }
+ return values;
}
std::string FakeVehicleHardware::dumpSetSupportedValues(const std::vector<std::string>& options) {
@@ -1862,6 +2048,18 @@
return "Supported values list for VENDOR_EXTENSION_INT_PROPERTY set";
}
+void FakeVehicleHardware::triggerSupportedValueChange(int32_t propId, int32_t areaId) {
+ if (mOnSupportedValueChangeCallback == nullptr) {
+ ALOGE("onSupportedValueChangeCallback is not registered, ignore event");
+ return;
+ }
+
+ (*mOnSupportedValueChangeCallback)({PropIdAreaId{
+ .propId = propId,
+ .areaId = areaId,
+ }});
+}
+
// Triggers supported value change for all areaIds that specify hasSupportedValueInfo.
void FakeVehicleHardware::triggerSupportedValueChange(const VehiclePropConfig& config) {
if (mOnSupportedValueChangeCallback == nullptr) {
@@ -1892,8 +2090,8 @@
"The value arguments constructs a VehiclePropValue used in the getValue request. \n"
"--set <PROP_ID> [ValueArguments]: sets the value of property PROP_ID, the value "
"arguments constructs a VehiclePropValue used in the setValue request. \n"
- "--set-minmaxvalue <MIN_VALUE(int)> <MAX_VALUE(int)>: sets the min max supported value "
- "for VENDOR_EXTENSION_INT_PROPERTY\n"
+ "--set-minmaxvalue <PROP_ID> [-a AREA_ID] <MIN_VALUE> <MAX_VALUE>: sets the min max "
+ "supported value e.g. --set-minmaxvalue HVAC_TEMPERATURE_SET -a ROW_1_LEFT -5.1 5.1\n"
"--set-supportedvalues <VALUE_1(int)> [VALUE_2(int) ...]: sets the supported values list"
"for VENDOR_EXTENSION_INT_PROPERTY\n"
"--save-prop <PROP_ID> [-a AREA_ID]: saves the current value for PROP_ID, integration "
@@ -2405,27 +2603,24 @@
const std::vector<PropIdAreaId>& propIdAreaIds) {
std::scoped_lock<std::mutex> lockGuard(mLock);
std::vector<MinMaxSupportedValueResult> results;
- // We only support VENDOR_EXTENSION_INT_PROPERTY
for (const auto& propIdAreaId : propIdAreaIds) {
- int propId = propIdAreaId.propId;
- int areaId = propIdAreaId.areaId;
- if (propId != toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY)) {
+ const auto minIt = mMinSupportedValueByPropIdAreaId.find(propIdAreaId);
+ const auto maxIt = mMaxSupportedValueByPropIdAreaId.find(propIdAreaId);
+ if (minIt == mMinSupportedValueByPropIdAreaId.end() &&
+ maxIt == mMaxSupportedValueByPropIdAreaId.end()) {
results.push_back(MinMaxSupportedValueResult{
.status = StatusCode::INVALID_ARG,
});
continue;
}
- results.push_back(MinMaxSupportedValueResult{
- .status = StatusCode::OK,
- .minSupportedValue =
- RawPropValues{
- .int32Values = {mMinSupportedValueForTestIntProp},
- },
- .maxSupportedValue =
- RawPropValues{
- .int32Values = {mMaxSupportedValueForTestIntProp},
- },
- });
+ auto result = MinMaxSupportedValueResult{.status = StatusCode::OK};
+ if (minIt != mMinSupportedValueByPropIdAreaId.end()) {
+ result.minSupportedValue = minIt->second;
+ }
+ if (maxIt != mMaxSupportedValueByPropIdAreaId.end()) {
+ result.maxSupportedValue = maxIt->second;
+ }
+ results.push_back(std::move(result));
}
return results;
}
diff --git a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
index df5c2a3..617d2d2 100644
--- a/automotive/vehicle/aidl/impl/current/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
@@ -399,15 +399,15 @@
};
VehiclePropValue leftHvacTemp = {
+ .areaId = SEAT_1_LEFT,
.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_CURRENT),
.value = {.floatValues = {170.0}},
- .areaId = SEAT_1_LEFT,
};
VehiclePropValue rightHvacTemp = {
+ .areaId = SEAT_1_RIGHT,
.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_CURRENT),
.value = {.floatValues = {180.0}},
- .areaId = SEAT_1_RIGHT,
};
return {oilLevel, leftHvacTemp, rightHvacTemp};
@@ -534,8 +534,8 @@
for (auto areaConfig : config.config.areaConfigs) {
StatusCode status = StatusCode::OK;
VehiclePropValue propValue{
- .prop = propId,
.areaId = areaConfig.areaId,
+ .prop = propId,
};
if (config.initialAreaValues.empty()) {
if (config.initialValue == RawPropValues{}) {
@@ -790,12 +790,12 @@
// If we set the value, it should update despite the override.
ASSERT_EQ(setValue(VehiclePropValue{
+ .timestamp = elapsedRealtimeNano(),
.prop = gearProp,
.value =
{
.int32Values = {5},
},
- .timestamp = elapsedRealtimeNano(),
}),
StatusCode::OK)
<< "expect to set the overridden property ok";
@@ -821,8 +821,8 @@
int hvacProp = toInt(VehicleProperty::HVAC_TEMPERATURE_SET);
auto result = getValue(VehiclePropValue{
- .prop = hvacProp,
.areaId = HVAC_LEFT,
+ .prop = hvacProp,
});
ASSERT_TRUE(result.ok()) << "expect to get the overridden property ok: " << getStatus(result);
@@ -1247,16 +1247,16 @@
.value.int32Values = {0},
},
VehiclePropValue{
+ .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT),
.prop = toInt(
VehicleProperty::BLIND_SPOT_WARNING_STATE),
- .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT),
.value.int32Values = {toInt(
ErrorState::NOT_AVAILABLE_DISABLED)},
},
VehiclePropValue{
+ .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT),
.prop = toInt(
VehicleProperty::BLIND_SPOT_WARNING_STATE),
- .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT),
.value.int32Values = {toInt(
ErrorState::NOT_AVAILABLE_DISABLED)},
},
@@ -1280,15 +1280,15 @@
.value.int32Values = {1},
},
VehiclePropValue{
+ .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT),
.prop = toInt(
VehicleProperty::BLIND_SPOT_WARNING_STATE),
- .areaId = toInt(VehicleAreaMirror::DRIVER_LEFT),
.value.int32Values = {1},
},
VehiclePropValue{
+ .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT),
.prop = toInt(
VehicleProperty::BLIND_SPOT_WARNING_STATE),
- .areaId = toInt(VehicleAreaMirror::DRIVER_RIGHT),
.value.int32Values = {1},
},
},
@@ -1757,7 +1757,7 @@
std::vector<VehiclePropValue> gotValues;
for (const auto& value : tc.expectedValuesToGet) {
- auto result = getValue(VehiclePropValue{.prop = value.prop, .areaId = value.areaId});
+ auto result = getValue(VehiclePropValue{.areaId = value.areaId, .prop = value.prop});
ASSERT_TRUE(result.ok()) << "failed to get property " << value.prop
<< " status:" << getStatus(result);
@@ -1880,8 +1880,8 @@
for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
// Turn off HVAC_POWER_ON for only 1 area ID
- StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ StatusCode status = setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {0}});
EXPECT_EQ(status, StatusCode::OK);
@@ -1895,8 +1895,8 @@
for (auto& powerPropAreaConfig : powerPropConfig->areaConfigs) {
int powerDependentAreaId = powerPropAreaConfig.areaId;
auto getValueResult = getValue(VehiclePropValue{
- .prop = powerPropId,
.areaId = powerDependentAreaId,
+ .prop = powerPropId,
});
// If the current area ID is contained within the HVAC_POWER_ON area ID
@@ -1914,8 +1914,8 @@
// Resetting HVAC_POWER_ON at areaId back to ON state to ensure that there's no dependence
// on this value from any power dependent property values other than those with the same
// areaId.
- setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {1}});
}
}
@@ -1927,8 +1927,8 @@
for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
// Turn off HVAC_POWER_ON for only 1 area ID
- StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ StatusCode status = setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {0}});
EXPECT_EQ(status, StatusCode::OK);
@@ -1942,7 +1942,7 @@
// Try setting a value at each area ID supported by the power dependent property
for (auto& powerPropAreaConfig : powerPropConfig->areaConfigs) {
int powerDependentAreaId = powerPropAreaConfig.areaId;
- auto val = VehiclePropValue{.prop = powerPropId, .areaId = powerDependentAreaId};
+ auto val = VehiclePropValue{.areaId = powerDependentAreaId, .prop = powerPropId};
if (propType == VehiclePropertyType::FLOAT) {
val.value.floatValues.emplace_back(20);
} else {
@@ -1964,8 +1964,8 @@
// Resetting HVAC_POWER_ON at areaId back to ON state to ensure that there's no dependence
// on this value from any power dependent property values other than those with the same
// areaId.
- setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {1}});
}
}
@@ -1976,8 +1976,8 @@
EXPECT_NE(hvacPowerOnConfig, nullptr);
for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
- StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ StatusCode status = setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {0}});
EXPECT_EQ(status, StatusCode::OK);
auto events = getChangedProperties();
@@ -1992,8 +1992,8 @@
}
clearChangedProperties();
- status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = hvacPowerAreaId,
+ status = setValue(VehiclePropValue{.areaId = hvacPowerAreaId,
+ .prop = toInt(VehicleProperty::HVAC_POWER_ON),
.value.int32Values = {1}});
EXPECT_EQ(status, StatusCode::OK);
events = getChangedProperties();
@@ -2024,8 +2024,8 @@
for (auto& hvacDualOnConfig : hvacDualOnConfig->areaConfigs) {
int32_t hvacDualOnAreaId = hvacDualOnConfig.areaId;
subscribe(toInt(VehicleProperty::HVAC_DUAL_ON), hvacDualOnAreaId, /*sampleRateHz*/ 0);
- StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_DUAL_ON),
- .areaId = hvacDualOnAreaId,
+ StatusCode status = setValue(VehiclePropValue{.areaId = hvacDualOnAreaId,
+ .prop = toInt(VehicleProperty::HVAC_DUAL_ON),
.value.int32Values = {1}});
EXPECT_EQ(status, StatusCode::OK);
@@ -2056,8 +2056,8 @@
continue;
}
float expectedValue = 25;
- status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
- .areaId = hvacTemperatureSetAreaId,
+ status = setValue(VehiclePropValue{.areaId = hvacTemperatureSetAreaId,
+ .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
.value.floatValues = {expectedValue}});
EXPECT_EQ(status, StatusCode::OK);
events = getChangedProperties();
@@ -2069,8 +2069,8 @@
clearChangedProperties();
}
- status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_DUAL_ON),
- .areaId = hvacDualOnAreaId,
+ status = setValue(VehiclePropValue{.areaId = hvacDualOnAreaId,
+ .prop = toInt(VehicleProperty::HVAC_DUAL_ON),
.value.int32Values = {0}});
EXPECT_EQ(status, StatusCode::OK);
@@ -2090,8 +2090,8 @@
continue;
}
float expectedValue = 24;
- status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
- .areaId = hvacTemperatureSetAreaId,
+ status = setValue(VehiclePropValue{.areaId = hvacTemperatureSetAreaId,
+ .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
.value.floatValues = {expectedValue}});
EXPECT_EQ(status, StatusCode::OK);
events = getChangedProperties();
@@ -2354,8 +2354,8 @@
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION),
.areaId = 1,
+ .prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION),
.value.int32Values = {666, 1, 1, 2},
};
@@ -2390,8 +2390,8 @@
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = propSwitchUser,
.areaId = 1,
+ .prop = propSwitchUser,
.value.int32Values = {666, 3, 2},
};
@@ -2401,8 +2401,8 @@
// Simulate a request from Android side.
VehiclePropValue switchUserRequest = {
- .prop = propSwitchUser,
.areaId = 0,
+ .prop = propSwitchUser,
.value.int32Values = {666, 3},
};
// Clear existing events.
@@ -2455,8 +2455,8 @@
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = toInt(VehicleProperty::CREATE_USER),
.areaId = 1,
+ .prop = toInt(VehicleProperty::CREATE_USER),
.value.int32Values = {666, 2},
};
@@ -2466,8 +2466,8 @@
// Simulate a request from Android side.
VehiclePropValue createUserRequest = {
- .prop = propCreateUser,
.areaId = 0,
+ .prop = propCreateUser,
.value.int32Values = {666},
};
// Clear existing events.
@@ -2517,8 +2517,8 @@
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = propInitialUserInfo,
.areaId = 1,
+ .prop = propInitialUserInfo,
.value.int32Values = {666, 1, 11},
};
@@ -2528,8 +2528,8 @@
// Simulate a request from Android side.
VehiclePropValue initialUserInfoRequest = {
- .prop = propInitialUserInfo,
.areaId = 0,
+ .prop = propInitialUserInfo,
.value.int32Values = {3},
};
// Clear existing events.
@@ -2697,8 +2697,8 @@
ASSERT_THAT(result.buffer, ContainsRegex("saved"));
ASSERT_EQ(setValue(VehiclePropValue{
- .prop = prop,
.areaId = WHEEL_FRONT_LEFT,
+ .prop = prop,
.value =
{
.floatValues = {210.0},
@@ -2711,7 +2711,7 @@
ASSERT_FALSE(result.callerShouldDumpState);
ASSERT_THAT(result.buffer, ContainsRegex("restored"));
- auto getResult = getValue(VehiclePropValue{.prop = prop, .areaId = WHEEL_FRONT_LEFT});
+ auto getResult = getValue(VehiclePropValue{.areaId = WHEEL_FRONT_LEFT, .prop = prop});
ASSERT_TRUE(getResult.ok());
// The default value is 200.0.
@@ -2761,8 +2761,9 @@
"response\nNo SetUserIdentificationAssociation response\n"));
}
-TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue) {
- std::vector<std::string> options = {"--set-minmaxvalue", "1", "100"};
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_Int) {
+ std::vector<std::string> options = {
+ "--set-minmaxvalue", "SEAT_MEMORY_SELECT", "-a", "ROW_1_LEFT", "1", "4"};
std::vector<PropIdAreaId> changedPropIdAreaIds;
getHardware()->registerSupportedValueChangeCallback(
@@ -2776,30 +2777,116 @@
ASSERT_THAT(result.buffer, ContainsRegex("Min/Max supported value .* set"));
ASSERT_EQ(changedPropIdAreaIds.size(), 1u);
+ EXPECT_EQ(changedPropIdAreaIds[0], (PropIdAreaId{
+ .propId = toInt(VehicleProperty::SEAT_MEMORY_SELECT),
+ .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT),
+ }));
- auto results = getHardware()->getMinMaxSupportedValues({PropIdAreaId{
- .propId = toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY), .areaId = 0}});
+ auto results = getHardware()->getMinMaxSupportedValues({changedPropIdAreaIds[0]});
ASSERT_EQ(results.size(), 1u);
EXPECT_EQ(results[0].status, StatusCode::OK);
EXPECT_EQ(results[0].minSupportedValue.value(), RawPropValues{.int32Values = {1}});
- EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.int32Values = {100}});
+ EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.int32Values = {4}});
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_forGlobalProperty) {
+ // -a can be emitted for global property
+ std::vector<std::string> options = {"--set-minmaxvalue", "EV_BRAKE_REGENERATION_LEVEL", "1",
+ "4"};
+ std::vector<PropIdAreaId> changedPropIdAreaIds;
+
+ getHardware()->registerSupportedValueChangeCallback(
+ std::make_unique<IVehicleHardware::SupportedValueChangeCallback>(
+ [&changedPropIdAreaIds](std::vector<PropIdAreaId> propIdAreaIds) {
+ changedPropIdAreaIds = propIdAreaIds;
+ }));
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_FALSE(result.callerShouldDumpState);
+ ASSERT_THAT(result.buffer, ContainsRegex("Min/Max supported value .* set"));
+
+ ASSERT_EQ(changedPropIdAreaIds.size(), 1u);
+ EXPECT_EQ(changedPropIdAreaIds[0],
+ (PropIdAreaId{
+ .propId = toInt(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL),
+ .areaId = 0,
+ }));
+
+ auto results = getHardware()->getMinMaxSupportedValues({changedPropIdAreaIds[0]});
+
+ ASSERT_EQ(results.size(), 1u);
+ EXPECT_EQ(results[0].status, StatusCode::OK);
+ EXPECT_EQ(results[0].minSupportedValue.value(), RawPropValues{.int32Values = {1}});
+ EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.int32Values = {4}});
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_Float) {
+ std::vector<std::string> options = {
+ "--set-minmaxvalue", "HVAC_TEMPERATURE_SET", "-a", "ROW_1_LEFT", "-5.1", "5.1"};
+ std::vector<PropIdAreaId> changedPropIdAreaIds;
+
+ getHardware()->registerSupportedValueChangeCallback(
+ std::make_unique<IVehicleHardware::SupportedValueChangeCallback>(
+ [&changedPropIdAreaIds](std::vector<PropIdAreaId> propIdAreaIds) {
+ changedPropIdAreaIds = propIdAreaIds;
+ }));
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_FALSE(result.callerShouldDumpState);
+ ASSERT_THAT(result.buffer, ContainsRegex("Min/Max supported value .* set"));
+
+ ASSERT_EQ(changedPropIdAreaIds.size(), 1u);
+ EXPECT_EQ(changedPropIdAreaIds[0],
+ (PropIdAreaId{
+ .propId = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
+ .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT),
+ }));
+
+ auto results = getHardware()->getMinMaxSupportedValues({changedPropIdAreaIds[0]});
+
+ ASSERT_EQ(results.size(), 1u);
+ EXPECT_EQ(results[0].status, StatusCode::OK);
+ EXPECT_EQ(results[0].minSupportedValue.value(), RawPropValues{.floatValues = {-5.1}});
+ EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.floatValues = {5.1}});
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_notEnoughArguments) {
+ std::vector<std::string> options = {"--set-minmaxvalue", "SEAT_MEMORY_SELECT"};
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_THAT(result.buffer, ContainsRegex("Not enough arguments"));
+
+ options = {"--set-minmaxvalue", "SEAT_MEMORY_SELECT", "2"};
+
+ result = getHardware()->dump(options);
+ ASSERT_THAT(result.buffer, ContainsRegex("Not enough arguments"));
+}
+
+TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_notEnoughArguments_missingMax) {
+ std::vector<std::string> options = {"--set-minmaxvalue", "SEAT_MEMORY_SELECT", "-a",
+ "ROW_1_LEFT", "2"};
+
+ DumpResult result = getHardware()->dump(options);
+ ASSERT_THAT(result.buffer, ContainsRegex("Not enough arguments"));
}
TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_invalidInt) {
- std::vector<std::string> options = {"--set-minmaxvalue", "abc", "100"};
+ std::vector<std::string> options = {
+ "--set-minmaxvalue", "HVAC_TEMPERATURE_SET", "-a", "ROW_1_LEFT", "abc", "100"};
DumpResult result = getHardware()->dump(options);
ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
- options = {"--set-minmaxvalue", "1", "abc"};
+ options = {"--set-minmaxvalue", "HVAC_TEMPERATURE_SET", "-a", "ROW_1_LEFT", "100", "abc"};
result = getHardware()->dump(options);
ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
}
TEST_F(FakeVehicleHardwareTest, testDumpSetMinMaxValue_minLargerThanMax) {
- std::vector<std::string> options = {"--set-minmaxvalue", "2", "1"};
+ std::vector<std::string> options = {
+ "--set-minmaxvalue", "SEAT_MEMORY_SELECT", "-a", "ROW_1_LEFT", "2", "1"};
DumpResult result = getHardware()->dump(options);
ASSERT_THAT(result.buffer, ContainsRegex("Failed"));
@@ -3569,15 +3656,15 @@
ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe";
status = setValue({
- .prop = propSpeed,
.areaId = 0,
+ .prop = propSpeed,
.value.floatValues = {1.1f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set speed";
status = setValue({
- .prop = propSpeed,
.areaId = 0,
+ .prop = propSpeed,
.value.floatValues = {1.2f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set speed";
@@ -3604,8 +3691,8 @@
ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe";
status = setValue({
- .prop = propHvac,
.areaId = areaId,
+ .prop = propHvac,
.value.floatValues = {20.0f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value";
@@ -3615,8 +3702,8 @@
clearChangedProperties();
status = setValue({
- .prop = propHvac,
.areaId = areaId,
+ .prop = propHvac,
.value.floatValues = {21.0f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value";
@@ -3629,8 +3716,8 @@
ASSERT_EQ(status, StatusCode::OK);
status = setValue({
- .prop = propHvac,
.areaId = areaId,
+ .prop = propHvac,
.value.floatValues = {22.0f},
});
ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value";
@@ -3655,31 +3742,31 @@
subscribe(propHvacTempValueSuggest, HVAC_ALL, /*sampleRateHz*/ 0);
VehiclePropValue floatArraySizeFour = {
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {0, CELSIUS, 0, 0},
};
StatusCode status = setValue(floatArraySizeFour);
EXPECT_EQ(status, StatusCode::OK);
VehiclePropValue floatArraySizeZero = {
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
};
status = setValue(floatArraySizeZero);
EXPECT_EQ(status, StatusCode::INVALID_ARG);
VehiclePropValue floatArraySizeFive = {
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {0, CELSIUS, 0, 0, 0},
};
status = setValue(floatArraySizeFive);
EXPECT_EQ(status, StatusCode::INVALID_ARG);
VehiclePropValue invalidUnit = {
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {0, 0, 0, 0},
};
status = setValue(invalidUnit);
@@ -3709,16 +3796,16 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius, CELSIUS, 0, 0},
},
},
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius, CELSIUS,
minTempInCelsius,
minTempInFahrenheit},
@@ -3730,8 +3817,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit, FAHRENHEIT,
0, 0},
},
@@ -3739,8 +3826,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit, FAHRENHEIT,
minTempInCelsius,
minTempInFahrenheit},
@@ -3752,16 +3839,16 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInCelsius, CELSIUS, 0, 0},
},
},
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInCelsius, CELSIUS,
maxTempInCelsius,
maxTempInFahrenheit},
@@ -3773,8 +3860,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInFahrenheit, FAHRENHEIT,
0, 0},
},
@@ -3782,8 +3869,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInFahrenheit, FAHRENHEIT,
maxTempInCelsius,
maxTempInFahrenheit},
@@ -3795,8 +3882,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius - 1, CELSIUS, 0,
0},
},
@@ -3804,8 +3891,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius - 1, CELSIUS,
minTempInCelsius,
minTempInFahrenheit},
@@ -3817,8 +3904,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit - 1,
FAHRENHEIT, 0, 0},
},
@@ -3826,8 +3913,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit - 1,
FAHRENHEIT, minTempInCelsius,
minTempInFahrenheit},
@@ -3839,8 +3926,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInCelsius + 1, CELSIUS, 0,
0},
},
@@ -3848,8 +3935,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInCelsius + 1, CELSIUS,
maxTempInCelsius,
maxTempInFahrenheit},
@@ -3861,8 +3948,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInFahrenheit + 1,
FAHRENHEIT, 0, 0},
},
@@ -3870,8 +3957,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {maxTempInFahrenheit + 1,
FAHRENHEIT, maxTempInCelsius,
maxTempInFahrenheit},
@@ -3883,8 +3970,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInCelsius +
incrementInCelsius * 2.5f,
CELSIUS, 0, 0},
@@ -3893,8 +3980,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues =
{minTempInCelsius + incrementInCelsius * 2.5f,
CELSIUS,
@@ -3909,8 +3996,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues = {minTempInFahrenheit +
incrementInFahrenheit *
2.5f,
@@ -3920,8 +4007,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
+ .prop = propHvacTempValueSuggest,
.value.floatValues =
{minTempInFahrenheit +
incrementInFahrenheit * 2.5f,
@@ -3968,9 +4055,10 @@
TEST_F(FakeVehicleHardwareTest, testGetMinMaxSupportedValues) {
auto results = getHardware()->getMinMaxSupportedValues({
- PropIdAreaId{.propId = toInt(TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY),
- .areaId = 0},
- PropIdAreaId{.propId = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), .areaId = 0},
+ PropIdAreaId{.propId = toInt(VehicleProperty::SEAT_MEMORY_SELECT),
+ .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT)},
+ // This property does not specify min/max value
+ PropIdAreaId{.propId = toInt(VehicleProperty::EV_BATTERY_DISPLAY_UNITS), .areaId = 0},
});
ASSERT_EQ(results.size(), 2u);
@@ -3978,7 +4066,7 @@
EXPECT_NE(results[0].minSupportedValue, std::nullopt);
EXPECT_EQ(results[0].minSupportedValue.value(), RawPropValues{.int32Values = {0}});
EXPECT_NE(results[0].maxSupportedValue, std::nullopt);
- EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.int32Values = {10}});
+ EXPECT_EQ(results[0].maxSupportedValue.value(), RawPropValues{.int32Values = {3}});
EXPECT_EQ(results[1].status, StatusCode::INVALID_ARG);
}
diff --git a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.cpp b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.cpp
index 8750375..e64c696 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.cpp
@@ -29,19 +29,45 @@
namespace android::hardware::automotive::vehicle::virtualization {
+using ::grpc::ChannelCredentials;
+using ::grpc::ClientContext;
+using ::grpc::CreateChannel;
+using ::grpc::InsecureChannelCredentials;
+using ::grpc::Status;
+
namespace {
constexpr size_t MAX_RETRY_COUNT = 5;
-std::shared_ptr<::grpc::ChannelCredentials> getChannelCredentials() {
- return ::grpc::InsecureChannelCredentials();
+std::shared_ptr<ChannelCredentials> getChannelCredentials() {
+ return InsecureChannelCredentials();
+}
+
+template <class ProtoRequestType>
+void fillPropIdAreaIdsToProtoRequest(const std::vector<PropIdAreaId>& propIdAreaIds,
+ ProtoRequestType* protoRequest) {
+ for (const auto& propIdAreaId : propIdAreaIds) {
+ proto_msg_converter::aidlToProto(propIdAreaId, protoRequest->add_prop_id_area_id());
+ }
+}
+
+template <class AidlResultType, class ProtoResultType>
+std::vector<AidlResultType> convertSupportedValueProtoResultToAidlResults(
+ const std::vector<PropIdAreaId>& propIdAreaIds, const ProtoResultType& protoResult) {
+ std::vector<AidlResultType> aidlResults;
+ for (const auto& protoResultPerRequest : protoResult.result()) {
+ AidlResultType aidlResult = {};
+ proto_msg_converter::protoToAidl(protoResultPerRequest, &aidlResult);
+ aidlResults.push_back(std::move(aidlResult));
+ }
+ return aidlResults;
}
} // namespace
GRPCVehicleHardware::GRPCVehicleHardware(std::string service_addr)
: mServiceAddr(std::move(service_addr)),
- mGrpcChannel(::grpc::CreateChannel(mServiceAddr, getChannelCredentials())),
+ mGrpcChannel(CreateChannel(mServiceAddr, getChannelCredentials())),
mGrpcStub(proto::VehicleServer::NewStub(mGrpcChannel)),
mValuePollingThread([this] { ValuePollingLoop(); }) {}
@@ -67,7 +93,7 @@
std::vector<aidlvhal::VehiclePropConfig> GRPCVehicleHardware::getAllPropertyConfigs() const {
std::vector<aidlvhal::VehiclePropConfig> configs;
- ::grpc::ClientContext context;
+ ClientContext context;
auto config_stream = mGrpcStub->GetAllPropertyConfig(&context, ::google::protobuf::Empty());
proto::VehiclePropConfig protoConfig;
while (config_stream->Read(&protoConfig)) {
@@ -97,7 +123,7 @@
aidlvhal::StatusCode GRPCVehicleHardware::setValues(
std::shared_ptr<const SetValuesCallback> callback,
const std::vector<aidlvhal::SetValueRequest>& requests) {
- ::grpc::ClientContext context;
+ ClientContext context;
proto::VehiclePropValueRequests protoRequests;
proto::SetValueResults protoResults;
for (const auto& request : requests) {
@@ -160,7 +186,7 @@
}
// TODO(chenhaosjtuacm): Make it Async.
- ::grpc::ClientContext context;
+ ClientContext context;
proto::GetValueResults protoResults;
auto grpc_status = mGrpcStub->GetValues(&context, protoRequests, &protoResults);
if (!grpc_status.ok()) {
@@ -262,7 +288,7 @@
}
DumpResult GRPCVehicleHardware::dump(const std::vector<std::string>& options) {
- ::grpc::ClientContext context;
+ ClientContext context;
proto::DumpOptions protoDumpOptions;
proto::DumpResult protoDumpResult;
for (const auto& option : options) {
@@ -281,7 +307,7 @@
}
aidlvhal::StatusCode GRPCVehicleHardware::checkHealth() {
- ::grpc::ClientContext context;
+ ClientContext context;
proto::VehicleHalCallStatus protoStatus;
auto grpc_status = mGrpcStub->CheckHealth(&context, ::google::protobuf::Empty(), &protoStatus);
if (!grpc_status.ok()) {
@@ -293,7 +319,7 @@
aidlvhal::StatusCode GRPCVehicleHardware::subscribe(aidlvhal::SubscribeOptions options) {
proto::SubscribeRequest request;
- ::grpc::ClientContext context;
+ ClientContext context;
proto::VehicleHalCallStatus protoStatus;
proto_msg_converter::aidlToProto(options, request.mutable_options());
auto grpc_status = mGrpcStub->Subscribe(&context, request, &protoStatus);
@@ -311,7 +337,7 @@
aidlvhal::StatusCode GRPCVehicleHardware::unsubscribe(int32_t propId, int32_t areaId) {
proto::UnsubscribeRequest request;
- ::grpc::ClientContext context;
+ ClientContext context;
proto::VehicleHalCallStatus protoStatus;
request.set_prop_id(propId);
request.set_area_id(areaId);
@@ -330,7 +356,7 @@
aidlvhal::StatusCode GRPCVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId,
float sampleRate) {
- ::grpc::ClientContext context;
+ ClientContext context;
proto::UpdateSampleRateRequest request;
proto::VehicleHalCallStatus protoStatus;
request.set_prop(propId);
@@ -357,7 +383,7 @@
}
void GRPCVehicleHardware::pollValue() {
- ::grpc::ClientContext context;
+ ClientContext context;
bool rpc_stopped{false};
std::thread shuttingdown_watcher([this, &rpc_stopped, &context]() {
@@ -408,4 +434,56 @@
LOG(ERROR) << __func__ << ": GRPC Value Streaming Failed: " << grpc_status.error_message();
}
+std::vector<aidlvhal::MinMaxSupportedValueResult> GRPCVehicleHardware::getMinMaxSupportedValues(
+ const std::vector<PropIdAreaId>& propIdAreaIds) {
+ ClientContext context;
+ proto::GetMinMaxSupportedValuesRequest protoRequest = {};
+ proto::GetMinMaxSupportedValuesResult protoResult = {};
+ fillPropIdAreaIdsToProtoRequest(propIdAreaIds, &protoRequest);
+
+ auto grpc_status = mGrpcStub->GetMinMaxSupportedValues(&context, protoRequest, &protoResult);
+ std::vector<aidlvhal::MinMaxSupportedValueResult> aidlResults;
+ if (!grpc_status.ok()) {
+ LOG(ERROR) << __func__
+ << ": GRPC GetMinMaxSupportedValues Failed: " << grpc_status.error_message();
+ for (const auto& propIdAreaId : propIdAreaIds) {
+ aidlResults.push_back({
+ .status = aidlvhal::StatusCode::INTERNAL_ERROR,
+ });
+ }
+ return aidlResults;
+ }
+ aidlResults =
+ convertSupportedValueProtoResultToAidlResults<aidlvhal::MinMaxSupportedValueResult,
+ proto::GetMinMaxSupportedValuesResult>(
+ propIdAreaIds, protoResult);
+ return aidlResults;
+}
+
+std::vector<aidlvhal::SupportedValuesListResult> GRPCVehicleHardware::getSupportedValuesLists(
+ const std::vector<PropIdAreaId>& propIdAreaIds) {
+ ClientContext context;
+ proto::GetSupportedValuesListsRequest protoRequest = {};
+ proto::GetSupportedValuesListsResult protoResult = {};
+ fillPropIdAreaIdsToProtoRequest(propIdAreaIds, &protoRequest);
+
+ auto grpc_status = mGrpcStub->GetSupportedValuesLists(&context, protoRequest, &protoResult);
+ std::vector<aidlvhal::SupportedValuesListResult> aidlResults;
+ if (!grpc_status.ok()) {
+ LOG(ERROR) << __func__
+ << ": GRPC GetSupportedValuesLists Failed: " << grpc_status.error_message();
+ for (const auto& propIdAreaId : propIdAreaIds) {
+ aidlResults.push_back({
+ .status = aidlvhal::StatusCode::INTERNAL_ERROR,
+ });
+ }
+ return aidlResults;
+ }
+ aidlResults =
+ convertSupportedValueProtoResultToAidlResults<aidlvhal::SupportedValuesListResult,
+ proto::GetSupportedValuesListsResult>(
+ propIdAreaIds, protoResult);
+ return aidlResults;
+}
+
} // namespace android::hardware::automotive::vehicle::virtualization
diff --git a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.h b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.h
index ad2f512..7fc3d79 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleHardware.h
@@ -90,6 +90,12 @@
aidlvhal::StatusCode unsubscribe(int32_t propId, int32_t areaId) override;
+ std::vector<aidlvhal::MinMaxSupportedValueResult> getMinMaxSupportedValues(
+ const std::vector<PropIdAreaId>& propIdAreaIds) override;
+
+ std::vector<aidlvhal::SupportedValuesListResult> getSupportedValuesLists(
+ const std::vector<PropIdAreaId>& propIdAreaIds) override;
+
bool waitForConnected(std::chrono::milliseconds waitTime);
protected:
diff --git a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.cpp b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.cpp
index 927a595..f216683 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.cpp
@@ -31,13 +31,33 @@
namespace android::hardware::automotive::vehicle::virtualization {
-std::atomic<uint64_t> GrpcVehicleProxyServer::ConnectionDescriptor::connection_id_counter_{0};
-
-static std::shared_ptr<::grpc::ServerCredentials> getServerCredentials() {
- // TODO(chenhaosjtuacm): get secured credentials here
+namespace {
+std::shared_ptr<::grpc::ServerCredentials> getServerCredentials() {
return ::grpc::InsecureServerCredentials();
}
+template <class ProtoRequestType>
+std::vector<PropIdAreaId> getPropIdAreaIdsFromProtoRequest(const ProtoRequestType* request) {
+ std::vector<PropIdAreaId> propIdAreaIds;
+ for (const proto::PropIdAreaId& protoPropIdAreaId : request->prop_id_area_id()) {
+ PropIdAreaId aidlPropIdAreaId = {};
+ proto_msg_converter::protoToAidl(protoPropIdAreaId, &aidlPropIdAreaId);
+ propIdAreaIds.push_back(aidlPropIdAreaId);
+ }
+ return propIdAreaIds;
+}
+
+template <class AidlResultType, class ProtoResultType>
+void aidlResultsToProtoResults(const AidlResultType& aidlResults, ProtoResultType* result) {
+ for (const auto& aidlResult : aidlResults) {
+ auto* protoResult = result->add_result();
+ proto_msg_converter::aidlToProto(aidlResult, protoResult);
+ }
+}
+} // namespace
+
+std::atomic<uint64_t> GrpcVehicleProxyServer::ConnectionDescriptor::connection_id_counter_{0};
+
GrpcVehicleProxyServer::GrpcVehicleProxyServer(std::string serverAddr,
std::unique_ptr<IVehicleHardware>&& hardware)
: GrpcVehicleProxyServer(std::vector<std::string>({serverAddr}), std::move(hardware)) {};
@@ -243,6 +263,26 @@
return ::grpc::Status(::grpc::StatusCode::ABORTED, "Connection lost.");
}
+::grpc::Status GrpcVehicleProxyServer::GetMinMaxSupportedValues(
+ ::grpc::ServerContext* context, const proto::GetMinMaxSupportedValuesRequest* request,
+ proto::GetMinMaxSupportedValuesResult* result) {
+ std::vector<PropIdAreaId> propIdAreaIds = getPropIdAreaIdsFromProtoRequest(request);
+ std::vector<aidlvhal::MinMaxSupportedValueResult> minMaxSupportedValueResults =
+ mHardware->getMinMaxSupportedValues(propIdAreaIds);
+ aidlResultsToProtoResults(minMaxSupportedValueResults, result);
+ return ::grpc::Status::OK;
+}
+
+::grpc::Status GrpcVehicleProxyServer::GetSupportedValuesLists(
+ ::grpc::ServerContext* context, const proto::GetSupportedValuesListsRequest* request,
+ proto::GetSupportedValuesListsResult* result) {
+ std::vector<PropIdAreaId> propIdAreaIds = getPropIdAreaIdsFromProtoRequest(request);
+ std::vector<aidlvhal::SupportedValuesListResult> supportedValuesListResults =
+ mHardware->getSupportedValuesLists(propIdAreaIds);
+ aidlResultsToProtoResults(supportedValuesListResults, result);
+ return ::grpc::Status::OK;
+}
+
void GrpcVehicleProxyServer::OnVehiclePropChange(
const std::vector<aidlvhal::VehiclePropValue>& values) {
std::unordered_set<uint64_t> brokenConn;
diff --git a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.h b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.h
index 5ffb531..eb261ca 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.h
+++ b/automotive/vehicle/aidl/impl/current/grpc/GRPCVehicleProxyServer.h
@@ -77,6 +77,14 @@
::grpc::ServerContext* context, const ::google::protobuf::Empty* request,
::grpc::ServerWriter<proto::VehiclePropValues>* stream) override;
+ ::grpc::Status GetMinMaxSupportedValues(
+ ::grpc::ServerContext* context, const proto::GetMinMaxSupportedValuesRequest* requests,
+ proto::GetMinMaxSupportedValuesResult* results) override;
+
+ ::grpc::Status GetSupportedValuesLists(::grpc::ServerContext* context,
+ const proto::GetSupportedValuesListsRequest* requests,
+ proto::GetSupportedValuesListsResult* results) override;
+
GrpcVehicleProxyServer& Start();
GrpcVehicleProxyServer& Shutdown();
diff --git a/automotive/vehicle/aidl/impl/current/grpc/proto/VehicleServer.proto b/automotive/vehicle/aidl/impl/current/grpc/proto/VehicleServer.proto
index 732957f..3364ed7 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/proto/VehicleServer.proto
+++ b/automotive/vehicle/aidl/impl/current/grpc/proto/VehicleServer.proto
@@ -20,6 +20,8 @@
import "android/hardware/automotive/vehicle/DumpOptions.proto";
import "android/hardware/automotive/vehicle/DumpResult.proto";
+import "android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.proto";
+import "android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.proto";
import "android/hardware/automotive/vehicle/SubscribeRequest.proto";
import "android/hardware/automotive/vehicle/StatusCode.proto";
import "android/hardware/automotive/vehicle/UnsubscribeRequest.proto";
@@ -46,4 +48,10 @@
rpc Subscribe(SubscribeRequest) returns (VehicleHalCallStatus) {}
rpc Unsubscribe(UnsubscribeRequest) returns (VehicleHalCallStatus) {}
+
+ rpc GetMinMaxSupportedValues(GetMinMaxSupportedValuesRequest)
+ returns (GetMinMaxSupportedValuesResult) {}
+
+ rpc GetSupportedValuesLists(GetSupportedValuesListsRequest)
+ returns (GetSupportedValuesListsResult) {}
}
diff --git a/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleHardwareUnitTest.cpp b/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleHardwareUnitTest.cpp
index 20af231..343e5b2 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleHardwareUnitTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleHardwareUnitTest.cpp
@@ -442,4 +442,119 @@
EXPECT_LT(gotResults[0].prop->timestamp, elapsedRealtimeNano());
}
+TEST_F(GRPCVehicleHardwareUnitTest, testGetMinMaxSupportedValues) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ int32_t testValue2 = 123456;
+ std::vector<PropIdAreaId> propIdAreaIds = {{.propId = testPropId, .areaId = testAreaId}};
+
+ EXPECT_CALL(*mGrpcStub, GetMinMaxSupportedValues(_, _, _))
+ .WillOnce([=](::grpc::ClientContext* context,
+ const proto::GetMinMaxSupportedValuesRequest& request,
+ proto::GetMinMaxSupportedValuesResult* response) {
+ for (const auto& propIdAreaId : request.prop_id_area_id()) {
+ proto::MinMaxSupportedValueResult* individualResult = response->add_result();
+ individualResult->set_status(proto::StatusCode::OK);
+ individualResult->mutable_min_supported_value()->add_int32_values(testValue1);
+ individualResult->mutable_max_supported_value()->add_int32_values(testValue2);
+ }
+ return ::grpc::Status::OK;
+ });
+
+ auto results = mHardware->getMinMaxSupportedValues(propIdAreaIds);
+
+ ASSERT_THAT(results, ::testing::SizeIs(1));
+ EXPECT_EQ(results[0].status, aidlvhal::StatusCode::OK);
+ ASSERT_TRUE(results[0].minSupportedValue.has_value());
+ EXPECT_EQ(results[0].minSupportedValue.value(),
+ aidlvhal::RawPropValues{.int32Values = {testValue1}});
+ ASSERT_TRUE(results[0].maxSupportedValue.has_value());
+ EXPECT_EQ(results[0].maxSupportedValue.value(),
+ aidlvhal::RawPropValues{.int32Values = {testValue2}});
+}
+
+TEST_F(GRPCVehicleHardwareUnitTest, testGetMinMaxSupportedValues_noMaxValue) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ std::vector<PropIdAreaId> propIdAreaIds = {{.propId = testPropId, .areaId = testAreaId}};
+
+ EXPECT_CALL(*mGrpcStub, GetMinMaxSupportedValues(_, _, _))
+ .WillOnce([=](::grpc::ClientContext* context,
+ const proto::GetMinMaxSupportedValuesRequest& request,
+ proto::GetMinMaxSupportedValuesResult* response) {
+ for (const auto& propIdAreaId : request.prop_id_area_id()) {
+ proto::MinMaxSupportedValueResult* individualResult = response->add_result();
+ individualResult->set_status(proto::StatusCode::OK);
+ individualResult->mutable_min_supported_value()->add_int32_values(testValue1);
+ }
+ return ::grpc::Status::OK;
+ });
+
+ auto results = mHardware->getMinMaxSupportedValues(propIdAreaIds);
+
+ ASSERT_THAT(results, ::testing::SizeIs(1));
+ EXPECT_EQ(results[0].status, aidlvhal::StatusCode::OK);
+ ASSERT_TRUE(results[0].minSupportedValue.has_value());
+ EXPECT_EQ(results[0].minSupportedValue.value(),
+ aidlvhal::RawPropValues{.int32Values = {testValue1}});
+ ASSERT_FALSE(results[0].maxSupportedValue.has_value());
+}
+
+TEST_F(GRPCVehicleHardwareUnitTest, testGetSupportedValuesLists) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ int32_t testValue2 = 123456;
+ std::vector<PropIdAreaId> propIdAreaIds = {{.propId = testPropId, .areaId = testAreaId}};
+
+ EXPECT_CALL(*mGrpcStub, GetSupportedValuesLists(_, _, _))
+ .WillOnce([=](::grpc::ClientContext* context,
+ const proto::GetSupportedValuesListsRequest& request,
+ proto::GetSupportedValuesListsResult* response) {
+ for (const auto& propIdAreaId : request.prop_id_area_id()) {
+ proto::SupportedValuesListResult* individualResult = response->add_result();
+ individualResult->set_status(proto::StatusCode::OK);
+ individualResult->add_supported_values_list()->add_int32_values(testValue1);
+ individualResult->add_supported_values_list()->add_int32_values(testValue2);
+ }
+ return ::grpc::Status::OK;
+ });
+
+ auto results = mHardware->getSupportedValuesLists(propIdAreaIds);
+
+ ASSERT_THAT(results, ::testing::SizeIs(1));
+ EXPECT_EQ(results[0].status, aidlvhal::StatusCode::OK);
+ ASSERT_TRUE(results[0].supportedValuesList.has_value());
+ ASSERT_THAT(results[0].supportedValuesList.value(), ::testing::SizeIs(2));
+ EXPECT_EQ(results[0].supportedValuesList.value()[0],
+ aidlvhal::RawPropValues{.int32Values = {testValue1}});
+ EXPECT_EQ(results[0].supportedValuesList.value()[1],
+ aidlvhal::RawPropValues{.int32Values = {testValue2}});
+}
+
+TEST_F(GRPCVehicleHardwareUnitTest, testGetSupportedValuesLists_noSupportedValue) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ std::vector<PropIdAreaId> propIdAreaIds = {{.propId = testPropId, .areaId = testAreaId}};
+
+ EXPECT_CALL(*mGrpcStub, GetSupportedValuesLists(_, _, _))
+ .WillOnce([=](::grpc::ClientContext* context,
+ const proto::GetSupportedValuesListsRequest& request,
+ proto::GetSupportedValuesListsResult* response) {
+ for (const auto& propIdAreaId : request.prop_id_area_id()) {
+ proto::SupportedValuesListResult* individualResult = response->add_result();
+ individualResult->set_status(proto::StatusCode::INTERNAL_ERROR);
+ }
+ return ::grpc::Status::OK;
+ });
+
+ auto results = mHardware->getSupportedValuesLists(propIdAreaIds);
+
+ ASSERT_THAT(results, ::testing::SizeIs(1));
+ EXPECT_EQ(results[0].status, aidlvhal::StatusCode::INTERNAL_ERROR);
+ ASSERT_FALSE(results[0].supportedValuesList.has_value());
+}
+
} // namespace android::hardware::automotive::vehicle::virtualization
diff --git a/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleProxyServerUnitTest.cpp b/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleProxyServerUnitTest.cpp
index ca5c2d5..c07c629 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleProxyServerUnitTest.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/test/GRPCVehicleProxyServerUnitTest.cpp
@@ -105,6 +105,10 @@
MOCK_METHOD(aidlvhal::StatusCode, unsubscribe, (int32_t propId, int32_t areaId), (override));
MOCK_METHOD(aidlvhal::StatusCode, updateSampleRate,
(int32_t propId, int32_t areaId, float sampleRate), (override));
+ MOCK_METHOD(std::vector<aidlvhal::MinMaxSupportedValueResult>, getMinMaxSupportedValues,
+ (const std::vector<PropIdAreaId>& propIdAreaIds), (override));
+ MOCK_METHOD(std::vector<aidlvhal::SupportedValuesListResult>, getSupportedValuesLists,
+ (const std::vector<PropIdAreaId>& propIdAreaIds), (override));
};
TEST(GRPCVehicleProxyServerUnitTest, ClientConnectDisconnect) {
@@ -117,7 +121,7 @@
constexpr auto kWaitForConnectionMaxTime = std::chrono::seconds(5);
constexpr auto kWaitForStreamStartTime = std::chrono::seconds(1);
- constexpr auto kWaitForUpdateDeliveryTime = std::chrono::milliseconds(100);
+ constexpr auto kWaitForUpdateDeliveryTime = std::chrono::seconds(1);
auto updateReceived1 = std::make_shared<bool>(false);
auto vehicleHardware1 = std::make_unique<GRPCVehicleHardware>(kFakeServerAddr);
@@ -129,7 +133,7 @@
// Client hardware 1 received update from the server.
EXPECT_FALSE(*updateReceived1);
- testHardwareRaw->onPropertyEvent({});
+ testHardwareRaw->onPropertyEvent({aidlvhal::VehiclePropValue{.prop = 1}});
// Wait for the update delivery.
std::this_thread::sleep_for(kWaitForUpdateDeliveryTime);
EXPECT_TRUE(*updateReceived1);
@@ -148,7 +152,7 @@
// Both client hardware 1 and 2 received update from the server.
EXPECT_FALSE(*updateReceived1);
EXPECT_FALSE(*updateReceived2);
- testHardwareRaw->onPropertyEvent({});
+ testHardwareRaw->onPropertyEvent({aidlvhal::VehiclePropValue{.prop = 1}});
// Wait for the update delivery.
std::this_thread::sleep_for(kWaitForUpdateDeliveryTime);
EXPECT_TRUE(*updateReceived1);
@@ -163,7 +167,7 @@
// Client 1 exited, only client hardware 2 received update from the server.
EXPECT_FALSE(*updateReceived1);
EXPECT_FALSE(*updateReceived2);
- testHardwareRaw->onPropertyEvent({});
+ testHardwareRaw->onPropertyEvent({aidlvhal::VehiclePropValue{.prop = 1}});
// Wait for the update delivery.
std::this_thread::sleep_for(kWaitForUpdateDeliveryTime);
EXPECT_FALSE(*updateReceived1);
@@ -238,4 +242,85 @@
EXPECT_EQ(returnStatus.status_code(), proto::StatusCode::OK);
}
+TEST(GRPCVehicleProxyServerUnitTest, testGetMinMaxSupportedValues) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ int32_t testValue2 = 54321;
+ auto mockHardware = std::make_unique<MockVehicleHardware>();
+ // We make sure this is alive inside the function scope.
+ MockVehicleHardware* mockHardwarePtr = mockHardware.get();
+ GrpcVehicleProxyServer server = GrpcVehicleProxyServer("", std::move(mockHardware));
+ ::grpc::ServerContext context;
+ proto::GetMinMaxSupportedValuesRequest request;
+ proto::GetMinMaxSupportedValuesResult result;
+ auto* requestPropIdAreaId = request.add_prop_id_area_id();
+ requestPropIdAreaId->set_prop_id(testPropId);
+ requestPropIdAreaId->set_area_id(testAreaId);
+ std::vector<PropIdAreaId> propIdAreaIds;
+ std::vector<aidlvhal::MinMaxSupportedValueResult> resultFromHardware = {{
+ .status = aidlvhal::StatusCode::OK,
+ .minSupportedValue = aidlvhal::RawPropValues{.int32Values = {testValue1}},
+ .maxSupportedValue = aidlvhal::RawPropValues{.int32Values = {testValue2}},
+ }};
+
+ EXPECT_CALL(*mockHardwarePtr, getMinMaxSupportedValues(_))
+ .WillOnce(DoAll(SaveArg<0>(&propIdAreaIds), Return(resultFromHardware)));
+
+ auto grpcStatus = server.GetMinMaxSupportedValues(&context, &request, &result);
+
+ ASSERT_THAT(propIdAreaIds, ::testing::SizeIs(1));
+ EXPECT_EQ(propIdAreaIds[0], PropIdAreaId({.propId = testPropId, .areaId = testAreaId}));
+
+ ASSERT_TRUE(grpcStatus.ok());
+ ASSERT_THAT(result.result(), ::testing::SizeIs(1));
+ EXPECT_EQ(result.result()[0].status(), proto::StatusCode::OK);
+ ASSERT_THAT(result.result()[0].min_supported_value().int32_values(), ::testing::SizeIs(1));
+ EXPECT_EQ(result.result()[0].min_supported_value().int32_values()[0], testValue1);
+ ASSERT_THAT(result.result()[0].max_supported_value().int32_values(), ::testing::SizeIs(1));
+ EXPECT_EQ(result.result()[0].max_supported_value().int32_values()[0], testValue2);
+}
+
+TEST(GRPCVehicleProxyServerUnitTest, testGetSupportedValuesLists) {
+ int32_t testPropId = 1234;
+ int32_t testAreaId = 4321;
+ int32_t testValue1 = 12345;
+ int32_t testValue2 = 54321;
+ auto mockHardware = std::make_unique<MockVehicleHardware>();
+ // We make sure this is alive inside the function scope.
+ MockVehicleHardware* mockHardwarePtr = mockHardware.get();
+ GrpcVehicleProxyServer server = GrpcVehicleProxyServer("", std::move(mockHardware));
+ ::grpc::ServerContext context;
+ proto::GetSupportedValuesListsRequest request;
+ proto::GetSupportedValuesListsResult result;
+ auto* requestPropIdAreaId = request.add_prop_id_area_id();
+ requestPropIdAreaId->set_prop_id(testPropId);
+ requestPropIdAreaId->set_area_id(testAreaId);
+ std::vector<PropIdAreaId> propIdAreaIds;
+ std::vector<aidlvhal::SupportedValuesListResult> resultFromHardware = {{
+ .status = aidlvhal::StatusCode::OK,
+ .supportedValuesList = std::vector<std::optional<aidlvhal::RawPropValues>>({
+ aidlvhal::RawPropValues{.int32Values = {testValue1}},
+ aidlvhal::RawPropValues{.int32Values = {testValue2}},
+ }),
+ }};
+
+ EXPECT_CALL(*mockHardwarePtr, getSupportedValuesLists(_))
+ .WillOnce(DoAll(SaveArg<0>(&propIdAreaIds), Return(resultFromHardware)));
+
+ auto grpcStatus = server.GetSupportedValuesLists(&context, &request, &result);
+
+ ASSERT_THAT(propIdAreaIds, ::testing::SizeIs(1));
+ EXPECT_EQ(propIdAreaIds[0], PropIdAreaId({.propId = testPropId, .areaId = testAreaId}));
+
+ ASSERT_TRUE(grpcStatus.ok());
+ ASSERT_THAT(result.result(), ::testing::SizeIs(1));
+ EXPECT_EQ(result.result()[0].status(), proto::StatusCode::OK);
+ ASSERT_THAT(result.result()[0].supported_values_list(), ::testing::SizeIs(2));
+ ASSERT_THAT(result.result()[0].supported_values_list()[0].int32_values(), ::testing::SizeIs(1));
+ EXPECT_THAT(result.result()[0].supported_values_list()[0].int32_values()[0], testValue1);
+ ASSERT_THAT(result.result()[0].supported_values_list()[1].int32_values(), ::testing::SizeIs(1));
+ EXPECT_THAT(result.result()[0].supported_values_list()[1].int32_values()[0], testValue2);
+}
+
} // namespace android::hardware::automotive::vehicle::virtualization
diff --git a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h
index 25c07ef..1cac067 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h
+++ b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/include/ProtoMessageConverter.h
@@ -18,6 +18,11 @@
#define android_hardware_automotive_vehicle_aidl_impl_grpc_utils_proto_message_converter_include_ProtoMessageConverter_H_
#include <VehicleHalTypes.h>
+#include <VehicleUtils.h>
+#include <android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.pb.h>
+#include <android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.pb.h>
+#include <android/hardware/automotive/vehicle/PropIdAreaId.pb.h>
+#include <android/hardware/automotive/vehicle/RawPropValues.pb.h>
#include <android/hardware/automotive/vehicle/SubscribeOptions.pb.h>
#include <android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h>
#include <android/hardware/automotive/vehicle/VehiclePropConfig.pb.h>
@@ -53,6 +58,34 @@
// Convert Protobuf SubscribeOptions to AIDL SubscribeOptions.
void protoToAidl(const ::android::hardware::automotive::vehicle::proto::SubscribeOptions& in,
::aidl::android::hardware::automotive::vehicle::SubscribeOptions* out);
+// Convert VehicleUtils PropIdAreaId to Protobuf PropIdAreaId.
+void aidlToProto(const PropIdAreaId& in,
+ ::android::hardware::automotive::vehicle::proto::PropIdAreaId* out);
+// Convert Protobuf PropIdAreaId to VehicleUtils PropIdAreaId.
+void protoToAidl(const ::android::hardware::automotive::vehicle::proto::PropIdAreaId& in,
+ PropIdAreaId* out);
+// Convert AIDL RawPropValues to Protobuf RawPropValues.
+void aidlToProto(const ::aidl::android::hardware::automotive::vehicle::RawPropValues& in,
+ ::android::hardware::automotive::vehicle::proto::RawPropValues* out);
+// Convert Protobuf RawPropValues to AIDL RawPropValues.
+void protoToAidl(const ::android::hardware::automotive::vehicle::proto::RawPropValues& in,
+ ::aidl::android::hardware::automotive::vehicle::RawPropValues* out);
+// Convert AIDL MinMaxSupportedValueResult to Protobuf MinMaxSupportedValueResult.
+void aidlToProto(
+ const ::aidl::android::hardware::automotive::vehicle::MinMaxSupportedValueResult& in,
+ ::android::hardware::automotive::vehicle::proto::MinMaxSupportedValueResult* out);
+// Convert Protobuf MinMaxSupportedValueResult to AIDL MinMaxSupportedValueResult.
+void protoToAidl(
+ const ::android::hardware::automotive::vehicle::proto::MinMaxSupportedValueResult& in,
+ ::aidl::android::hardware::automotive::vehicle::MinMaxSupportedValueResult* out);
+// Convert AIDL SupportedValuesListResult to Protobuf SupportedValuesListResult.
+void aidlToProto(
+ const ::aidl::android::hardware::automotive::vehicle::SupportedValuesListResult& in,
+ ::android::hardware::automotive::vehicle::proto::SupportedValuesListResult* out);
+// Convert Protobuf SupportedValuesListResult to AIDL SupportedValuesListResult.
+void protoToAidl(
+ const ::android::hardware::automotive::vehicle::proto::SupportedValuesListResult& in,
+ ::aidl::android::hardware::automotive::vehicle::SupportedValuesListResult* out);
} // namespace proto_msg_converter
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
index c40004a..bb16da4 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
@@ -80,6 +80,17 @@
}
}
protoACfg->set_support_variable_update_rate(areaConfig.supportVariableUpdateRate);
+ if (areaConfig.hasSupportedValueInfo.has_value()) {
+ // Creates the has_supported_value_info field.
+ proto::HasSupportedValueInfo* hasSupportedValueInfoProto =
+ protoACfg->mutable_has_supported_value_info();
+ hasSupportedValueInfoProto->set_has_min_supported_value(
+ areaConfig.hasSupportedValueInfo->hasMinSupportedValue);
+ hasSupportedValueInfoProto->set_has_max_supported_value(
+ areaConfig.hasSupportedValueInfo->hasMaxSupportedValue);
+ hasSupportedValueInfoProto->set_has_supported_values_list(
+ areaConfig.hasSupportedValueInfo->hasSupportedValuesList);
+ }
}
}
@@ -96,13 +107,13 @@
auto cast_to_acfg = [](const proto::VehicleAreaConfig& protoAcfg) {
auto vehicleAreaConfig = aidl_vehicle::VehicleAreaConfig{
.areaId = protoAcfg.area_id(),
- .access = static_cast<aidl_vehicle::VehiclePropertyAccess>(protoAcfg.access()),
.minInt32Value = protoAcfg.min_int32_value(),
.maxInt32Value = protoAcfg.max_int32_value(),
.minInt64Value = protoAcfg.min_int64_value(),
.maxInt64Value = protoAcfg.max_int64_value(),
.minFloatValue = protoAcfg.min_float_value(),
.maxFloatValue = protoAcfg.max_float_value(),
+ .access = static_cast<aidl_vehicle::VehiclePropertyAccess>(protoAcfg.access()),
.supportVariableUpdateRate = protoAcfg.support_variable_update_rate(),
};
if (protoAcfg.supported_enum_values().size() != 0) {
@@ -110,6 +121,16 @@
COPY_PROTOBUF_VEC_TO_VHAL_TYPE(protoAcfg, supported_enum_values, (&vehicleAreaConfig),
supportedEnumValues.value());
}
+ if (protoAcfg.has_has_supported_value_info()) {
+ aidl_vehicle::HasSupportedValueInfo hasSupportedValueInfo = {};
+ hasSupportedValueInfo.hasMinSupportedValue =
+ protoAcfg.has_supported_value_info().has_min_supported_value();
+ hasSupportedValueInfo.hasMaxSupportedValue =
+ protoAcfg.has_supported_value_info().has_max_supported_value();
+ hasSupportedValueInfo.hasSupportedValuesList =
+ protoAcfg.has_supported_value_info().has_supported_values_list();
+ vehicleAreaConfig.hasSupportedValueInfo = hasSupportedValueInfo;
+ }
return vehicleAreaConfig;
};
@@ -170,6 +191,94 @@
out->enableVariableUpdateRate = in.enable_variable_update_rate();
}
+void aidlToProto(const PropIdAreaId& in, proto::PropIdAreaId* out) {
+ out->set_prop_id(in.propId);
+ out->set_area_id(in.areaId);
+}
+
+void protoToAidl(const proto::PropIdAreaId& in, PropIdAreaId* out) {
+ out->propId = in.prop_id();
+ out->areaId = in.area_id();
+}
+
+void aidlToProto(const aidl_vehicle::RawPropValues& in, proto::RawPropValues* out) {
+ out->set_string_value(in.stringValue);
+ out->set_byte_values(in.byteValues.data(), in.byteValues.size());
+ for (auto& int32Value : in.int32Values) {
+ out->add_int32_values(int32Value);
+ }
+ for (auto& int64Value : in.int64Values) {
+ out->add_int64_values(int64Value);
+ }
+ for (auto& floatValue : in.floatValues) {
+ out->add_float_values(floatValue);
+ }
+}
+
+void protoToAidl(const proto::RawPropValues& in, aidl_vehicle::RawPropValues* out) {
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, int32_values, out, int32Values);
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, int64_values, out, int64Values);
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, float_values, out, floatValues);
+ out->stringValue = in.string_value();
+ for (const char& byte : in.byte_values()) {
+ out->byteValues.push_back(byte);
+ }
+}
+
+void aidlToProto(const aidl_vehicle::MinMaxSupportedValueResult& in,
+ proto::MinMaxSupportedValueResult* out) {
+ out->set_status(static_cast<proto::StatusCode>(in.status));
+ if (in.minSupportedValue.has_value()) {
+ aidlToProto(in.minSupportedValue.value(), out->mutable_min_supported_value());
+ }
+ if (in.maxSupportedValue.has_value()) {
+ aidlToProto(in.maxSupportedValue.value(), out->mutable_max_supported_value());
+ }
+}
+
+void protoToAidl(const proto::MinMaxSupportedValueResult& in,
+ aidl_vehicle::MinMaxSupportedValueResult* out) {
+ out->status = static_cast<aidl_vehicle::StatusCode>(in.status());
+ if (in.has_min_supported_value()) {
+ aidl_vehicle::RawPropValues minSupportedValue = {};
+ protoToAidl(in.min_supported_value(), &minSupportedValue);
+ out->minSupportedValue = minSupportedValue;
+ }
+ if (in.has_max_supported_value()) {
+ aidl_vehicle::RawPropValues maxSupportedValue = {};
+ protoToAidl(in.max_supported_value(), &maxSupportedValue);
+ out->maxSupportedValue = maxSupportedValue;
+ }
+}
+
+void aidlToProto(const aidl_vehicle::SupportedValuesListResult& in,
+ proto::SupportedValuesListResult* out) {
+ out->set_status(static_cast<proto::StatusCode>(in.status));
+ if (!in.supportedValuesList.has_value()) {
+ return;
+ }
+ for (const auto& protoSupportedValue : in.supportedValuesList.value()) {
+ if (protoSupportedValue.has_value()) {
+ aidlToProto(protoSupportedValue.value(), out->add_supported_values_list());
+ }
+ }
+}
+
+void protoToAidl(const proto::SupportedValuesListResult& in,
+ aidl_vehicle::SupportedValuesListResult* out) {
+ out->status = static_cast<aidl_vehicle::StatusCode>(in.status());
+ if (out->status != aidl_vehicle::StatusCode::OK) {
+ return;
+ }
+ std::vector<std::optional<aidl_vehicle::RawPropValues>> aidlSupportedValuesList;
+ for (const auto& protoRawPropValues : in.supported_values_list()) {
+ aidl_vehicle::RawPropValues aidlRawPropValues = {};
+ protoToAidl(protoRawPropValues, &aidlRawPropValues);
+ aidlSupportedValuesList.push_back(std::move(aidlRawPropValues));
+ }
+ out->supportedValuesList = std::move(aidlSupportedValuesList);
+}
+
#undef COPY_PROTOBUF_VEC_TO_VHAL_TYPE
#undef CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE
diff --git a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp
index 2efda5b..eafbe91 100644
--- a/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp
+++ b/automotive/vehicle/aidl/impl/current/grpc/utils/proto_message_converter/test/proto_message_converter_test.cpp
@@ -83,7 +83,7 @@
} // namespace
-TEST_P(PropConfigConversionTest, testConversion) {
+TEST_P(PropConfigConversionTest, testConvertPropConfig) {
proto::VehiclePropConfig protoCfg;
aidl_vehicle::VehiclePropConfig aidlCfg;
@@ -93,7 +93,7 @@
EXPECT_EQ(aidlCfg, GetParam());
}
-TEST_P(PropValueConversionTest, testConversion) {
+TEST_P(PropValueConversionTest, testConvertPropValue) {
proto::VehiclePropValue protoVal;
aidl_vehicle::VehiclePropValue aidlVal;
@@ -130,6 +130,132 @@
EXPECT_EQ(aidlOptions, outputOptions);
}
+TEST_F(PropValueConversionTest, testConvertPropIdAreaId) {
+ proto::PropIdAreaId protoValue;
+ PropIdAreaId aidlValue = {.propId = 12, .areaId = 34};
+ PropIdAreaId outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertRawPropValues) {
+ proto::RawPropValues protoValue;
+ aidl_vehicle::RawPropValues aidlValue = {
+ .int32Values = {1, 2, 3, 4},
+ .floatValues = {1.1, 2.2, 3.3, 4.4},
+ .int64Values = {4L, 3L, 2L, 1L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::RawPropValues outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertMinMaxSupportedValueResult) {
+ proto::MinMaxSupportedValueResult protoValue;
+ aidl_vehicle::RawPropValues aidlValue1 = {
+ .int32Values = {1, 2, 3, 4},
+ .floatValues = {1.1, 2.2, 3.3, 4.4},
+ .int64Values = {4L, 3L, 2L, 1L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::RawPropValues aidlValue2 = {
+ .int32Values = {4, 3, 2, 1},
+ .floatValues = {3.3},
+ .int64Values = {2L, 3L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::MinMaxSupportedValueResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::OK,
+ .minSupportedValue = aidlValue1,
+ .maxSupportedValue = aidlValue2,
+ };
+ aidl_vehicle::MinMaxSupportedValueResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertMinMaxSupportedValueResult_errorStatus) {
+ proto::MinMaxSupportedValueResult protoValue;
+ aidl_vehicle::MinMaxSupportedValueResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::INTERNAL_ERROR,
+ };
+ aidl_vehicle::MinMaxSupportedValueResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertSupportedValuesListResult) {
+ proto::SupportedValuesListResult protoValue;
+ aidl_vehicle::RawPropValues aidlValue1 = {
+ .int32Values = {1, 2, 3, 4},
+ .floatValues = {1.1, 2.2, 3.3, 4.4},
+ .int64Values = {4L, 3L, 2L, 1L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::RawPropValues aidlValue2 = {
+ .int32Values = {4, 3, 2, 1},
+ .floatValues = {3.3},
+ .int64Values = {2L, 3L},
+ .byteValues = {0xde, 0xad, 0xbe, 0xef},
+ .stringValue = "test",
+ };
+ aidl_vehicle::SupportedValuesListResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::OK,
+ .supportedValuesList = std::vector<std::optional<aidl_vehicle::RawPropValues>>(
+ {aidlValue1, aidlValue2}),
+ };
+ aidl_vehicle::SupportedValuesListResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertSupportedValuesListResult_emptySupportedValues) {
+ proto::SupportedValuesListResult protoValue;
+ aidl_vehicle::SupportedValuesListResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::OK,
+ .supportedValuesList = std::vector<std::optional<aidl_vehicle::RawPropValues>>({}),
+ };
+ aidl_vehicle::SupportedValuesListResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
+TEST_F(PropValueConversionTest, testConvertSupportedValuesListResult_errorStatus) {
+ proto::SupportedValuesListResult protoValue;
+ aidl_vehicle::SupportedValuesListResult aidlValue = {
+ .status = aidl_vehicle::StatusCode::INTERNAL_ERROR,
+ };
+ aidl_vehicle::SupportedValuesListResult outputValue;
+
+ aidlToProto(aidlValue, &protoValue);
+ protoToAidl(protoValue, &outputValue);
+
+ EXPECT_EQ(aidlValue, outputValue);
+}
+
} // namespace proto_msg_converter
} // namespace vehicle
} // namespace automotive
diff --git a/automotive/vehicle/aidl/impl/current/proto/Android.bp b/automotive/vehicle/aidl/impl/current/proto/Android.bp
index 2b5cdf4..b12288b 100644
--- a/automotive/vehicle/aidl/impl/current/proto/Android.bp
+++ b/automotive/vehicle/aidl/impl/current/proto/Android.bp
@@ -42,6 +42,11 @@
out: [
"android/hardware/automotive/vehicle/DumpOptions.pb.h",
"android/hardware/automotive/vehicle/DumpResult.pb.h",
+ "android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.pb.h",
+ "android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.pb.h",
+ "android/hardware/automotive/vehicle/HasSupportedValueInfo.pb.h",
+ "android/hardware/automotive/vehicle/PropIdAreaId.pb.h",
+ "android/hardware/automotive/vehicle/RawPropValues.pb.h",
"android/hardware/automotive/vehicle/StatusCode.pb.h",
"android/hardware/automotive/vehicle/VehicleAreaConfig.pb.h",
"android/hardware/automotive/vehicle/VehiclePropConfig.pb.h",
@@ -69,6 +74,11 @@
out: [
"android/hardware/automotive/vehicle/DumpOptions.pb.cc",
"android/hardware/automotive/vehicle/DumpResult.pb.cc",
+ "android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.pb.cc",
+ "android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.pb.cc",
+ "android/hardware/automotive/vehicle/HasSupportedValueInfo.pb.cc",
+ "android/hardware/automotive/vehicle/PropIdAreaId.pb.cc",
+ "android/hardware/automotive/vehicle/RawPropValues.pb.cc",
"android/hardware/automotive/vehicle/StatusCode.pb.cc",
"android/hardware/automotive/vehicle/VehicleAreaConfig.pb.cc",
"android/hardware/automotive/vehicle/VehiclePropConfig.pb.cc",
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.proto
new file mode 100644
index 0000000..b70c24c
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetMinMaxSupportedValuesTypes.proto
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+import "android/hardware/automotive/vehicle/PropIdAreaId.proto";
+import "android/hardware/automotive/vehicle/RawPropValues.proto";
+import "android/hardware/automotive/vehicle/StatusCode.proto";
+
+message MinMaxSupportedValueResult {
+ /**
+ * The status for result. If this is not OK, the operation failed for this
+ * [propId, areaId].
+ */
+ StatusCode status = 1;
+ /**
+ * The min supported value.
+ *
+ * If the [propId, areaId] does not specify a min supported value, this
+ * is {@code null}.
+ */
+ RawPropValues min_supported_value = 2;
+ /**
+ * The max supported value.
+ *
+ * If the [propId, areaId] does not specify a max supported value, this
+ * is {@code null}.
+ *
+ * This must be ignored if status is not {@code StatusCode.OK}.
+ */
+ RawPropValues max_supported_value = 3;
+};
+
+message GetMinMaxSupportedValuesRequest {
+ repeated PropIdAreaId prop_id_area_id = 1;
+};
+
+message GetMinMaxSupportedValuesResult {
+ repeated MinMaxSupportedValueResult result = 1;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.proto
new file mode 100644
index 0000000..a1488ea
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/GetSupportedValuesListsTypes.proto
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+import "android/hardware/automotive/vehicle/PropIdAreaId.proto";
+import "android/hardware/automotive/vehicle/RawPropValues.proto";
+import "android/hardware/automotive/vehicle/StatusCode.proto";
+
+message SupportedValuesListResult {
+ /**
+ * The status for result. If this is not OK, the operation failed for this
+ * [propId, areaId].
+ */
+ StatusCode status = 1;
+ /**
+ * The supported values list.
+ *
+ * If the [propId, areaId] does not specify a supported values list, this
+ * is {@code null}.
+ *
+ * This must be ignored if status is not {@code StatusCode.OK}.
+ */
+ repeated RawPropValues supported_values_list = 2;
+};
+
+message GetSupportedValuesListsRequest {
+ repeated PropIdAreaId prop_id_area_id = 1;
+};
+
+message GetSupportedValuesListsResult {
+ repeated SupportedValuesListResult result = 1;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/HasSupportedValueInfo.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/HasSupportedValueInfo.proto
new file mode 100644
index 0000000..c04deb4
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/HasSupportedValueInfo.proto
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+/* Must be in sync with HasSupportedValueInfo.aidl. */
+message HasSupportedValueInfo {
+ /**
+ * Whether [propId, areaId] has min supported value specified.
+ *
+ * If this is {@code true}, the hardware specifies a min supported value.
+ * If {@code MinMaxSupportedValueResult}'s {@code status} is
+ * {@code StatusCode.OK}, its {@code minSupportedValue} must not be
+ * {@code null}.
+ *
+ * If this is {@code false}, {@code minSupportedValue} must be {@code null}.
+ *
+ * Unless otherwise specified, this field is set to {@code false} for any
+ * properties whose type is not int32, int64 or float.
+ *
+ * For certain properties, e.g. {@code EV_BRAKE_REGENERATION_LEVEL}, this
+ * must always be {@code true}. Check {@code VehicleProperty}
+ * documentation.
+ */
+ bool has_min_supported_value = 1;
+
+ /**
+ * Whether [propId, areaId] has max supported value specified.
+ *
+ * If this is {@code true}, the hardware specifies a max supported value.
+ * If {@code MinMaxSupportedValueResult}'s {@code status} is
+ * {@code StatusCode.OK}, its {@code maxSupportedValue} must not be
+ * {@code null}.
+ *
+ * If this is {@code false}, {@code maxSupportedValue} must be {@code null}.
+ *
+ * Unless otherwise specified, this field is set to {@code false} for any
+ * properties whose type is not int32, int64 or float.
+ *
+ * For certain properties, e.g. {@code EV_BRAKE_REGENERATION_LEVEL}, this
+ * must always be {@code true}. Check {@code VehicleProperty}
+ * documentation.
+ */
+ bool has_max_supported_value = 2;
+
+ /**
+ * Whether [propId, areaId] has supported values list specified.
+ *
+ * If this is {@code true}, it means the hardware specifies supported
+ * values for this property.
+ * If {@code SupportedValueListResult}'s {@code status} is
+ * {@code StatusCode.OK}, its {@code supportedValuesList} must not be
+ * {@code null}.
+ *
+ * If this is {@code false}, {@code supportedValuesList} must always be
+ * {@code null}.
+ *
+ * The supported value is the superset for both the input value for writable
+ * property and the output value for readable property.
+ *
+ * For certain properties, e.g. {@code GEAR_SELECTION}, this must always be
+ * {@code true}. Check {@code VehicleProperty} documentation.
+ */
+ bool has_supported_values_list = 3;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/PropIdAreaId.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/PropIdAreaId.proto
new file mode 100644
index 0000000..556eec6
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/PropIdAreaId.proto
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+message PropIdAreaId {
+ int32 prop_id = 1;
+ int32 area_id = 2;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/RawPropValues.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/RawPropValues.proto
new file mode 100644
index 0000000..8f54fea
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/RawPropValues.proto
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto3";
+
+package android.hardware.automotive.vehicle.proto;
+
+/* Must be in sync with RawPropValues.aidl. */
+message RawPropValues {
+ /* This is used for properties of types VehiclePropertyType#INT
+ * and VehiclePropertyType#INT_VEC */
+ repeated int32 int32_values = 1;
+
+ /* This is used for properties of types VehiclePropertyType#FLOAT
+ * and VehiclePropertyType#FLOAT_VEC */
+ repeated float float_values = 2;
+
+ /* This is used for properties of type VehiclePropertyType#INT64 */
+ repeated int64 int64_values = 3;
+
+ /* This is used for properties of type VehiclePropertyType#BYTES */
+ bytes byte_values = 4;
+
+ /* This is used for properties of type VehiclePropertyType#STRING */
+ string string_value = 5;
+};
diff --git a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
index 7ea8540..695af31 100644
--- a/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
+++ b/automotive/vehicle/aidl/impl/current/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
@@ -19,6 +19,7 @@
package android.hardware.automotive.vehicle.proto;
import "android/hardware/automotive/vehicle/VehiclePropertyAccess.proto";
+import "android/hardware/automotive/vehicle/HasSupportedValueInfo.proto";
/* Must be in sync with VehicleAreaConfig.aidl. */
message VehicleAreaConfig {
@@ -47,4 +48,30 @@
repeated int64 supported_enum_values = 8;
VehiclePropertyAccess access = 9;
bool support_variable_update_rate = 10;
+ /**
+ * This specifies whether this property may have min/max supported value or supported values
+ * list for [propId, areaId] that supports new supported values APIs.
+ *
+ * If this is not {@code null}. The client may use {@code getMinMaxSupportedValue},
+ * {@code getSupportedValuesLists}, {@code subscribeSupportedValueChange},
+ * {@code unsubscribeSupportedValueChange}.
+ *
+ * If this is not {@code null}. The VHAL implementation must implement
+ * {@code getMinMaxSupportedValue}, {@code getSupportedValuesLists},
+ * {@code subscribeSupportedValueChange} for the [propId, areaId].
+ *
+ * This should be non-null if the VHAL implementation wants to expose
+ * min/max supported value or supported values list that may change dynamically. For example,
+ * if the max HVAC fan speed may change due to HVAC power settings.
+ *
+ * This should not be non-null if the VHAL implementation wants to expose supported
+ * values list for property ID that is not an enum type (hence do not support
+ * {@code VehicleAreaConfig#supportedEnumValues}).
+ *
+ * If this is {@code null}, the APIs mentioned before are not supported.
+ * Client must fallback to use static supported value information in {@code VehicleAreaConfig}.
+ *
+ * For VHAL implementation < V4, this is always {@code null}.
+ */
+ HasSupportedValueInfo has_supported_value_info = 11;
};
diff --git a/bluetooth/aidl/Android.bp b/bluetooth/aidl/Android.bp
index 4ee2f49..0daecf7 100644
--- a/bluetooth/aidl/Android.bp
+++ b/bluetooth/aidl/Android.bp
@@ -16,6 +16,13 @@
srcs: ["android/hardware/bluetooth/*.aidl"],
stability: "vintf",
backend: {
+ cpp: {
+ // FIXME should this be disabled?
+ // prefer NDK backend which can be used anywhere
+ // If you disable this, you also need to delete the C++
+ // translate code.
+ enabled: true,
+ },
rust: {
enabled: true,
},
@@ -37,4 +44,5 @@
},
],
frozen: true,
+
}
diff --git a/bluetooth/aidl/default/Android.bp b/bluetooth/aidl/default/Android.bp
index d3f6364..46a6983 100644
--- a/bluetooth/aidl/default/Android.bp
+++ b/bluetooth/aidl/default/Android.bp
@@ -2,61 +2,58 @@
default_applicable_licenses: ["Android-Apache-2.0"],
}
-cc_library_static {
- name: "libbluetoothhcihalimpl",
- vendor_available: true,
- host_supported: true,
- srcs: [
- "BluetoothHci.cpp",
- "net_bluetooth_mgmt.cpp",
- ],
+cc_defaults {
+ name: "android.hardware.bluetooth-service-build-defaults",
cflags: [
"-Wall",
"-Wextra",
],
- header_libs: [
- "libbluetooth_offload_hal_headers",
+ shared_libs: [
+ "android.hardware.bluetooth-V1-ndk",
+ "libbase",
+ "libbinder_ndk",
+ "libcutils",
+ "libhidlbase",
+ "liblog",
+ "libutils",
],
static_libs: [
"android.hardware.bluetooth.async",
"android.hardware.bluetooth.hci",
- ],
- shared_libs: [
- "libbase",
- "libcutils",
- "liblog",
- "libutils",
+ "libbluetooth_offload_hal",
],
}
-rust_binary {
+cc_library_static {
+ name: "libbluetoothhcihalimpl",
+ vendor_available: true,
+ defaults: ["android.hardware.bluetooth-service-build-defaults"],
+ srcs: [
+ "BluetoothHci.cpp",
+ "net_bluetooth_mgmt.cpp",
+ ],
+}
+
+cc_binary {
name: "android.hardware.bluetooth-service.default",
- crate_name: "bluetooth_hci_hal_server",
relative_install_path: "hw",
init_rc: ["bluetooth-service-default.rc"],
vintf_fragments: [":manifest_android.hardware.bluetooth-service.default.xml"],
vendor: true,
- prefer_rlib: true,
- srcs: ["main.rs"],
- rustlibs: [
- "android.hardware.bluetooth-V1-rust",
- "libbluetooth_offload_hal",
- "libbluetooth_offload_leaudio_hci",
- "libbinder_rs",
- "liblogger",
- "liblog_rust",
- ],
- static_libs: [
- "android.hardware.bluetooth.async",
- "android.hardware.bluetooth.hci",
- "libbluetoothhcihalimpl",
+ defaults: ["android.hardware.bluetooth-service-build-defaults"],
+ srcs: [
+ "service.cpp",
],
shared_libs: [
+ "android.hardware.bluetooth-V1-ndk",
"libbase",
- "libc++",
- "libcutils",
- "liblog",
+ "libbinder_ndk",
+ "libhidlbase",
"libutils",
+ "liblog",
+ ],
+ static_libs: [
+ "libbluetoothhcihalimpl",
],
}
diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp
index bcdb67e..5ac3afe 100644
--- a/bluetooth/aidl/default/BluetoothHci.cpp
+++ b/bluetooth/aidl/default/BluetoothHci.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,20 +16,18 @@
#define LOG_TAG "android.hardware.bluetooth.service.default"
+#include "BluetoothHci.h"
+
#include <cutils/properties.h>
#include <fcntl.h>
-#include <hal/ffi.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <poll.h>
#include <string.h>
+#include <sys/uio.h>
#include <termios.h>
-#include <future>
-#include <memory>
-#include <vector>
-
-#include "async_fd_watcher.h"
-#include "h4_protocol.h"
#include "log/log.h"
-#include "net_bluetooth_mgmt.h"
namespace {
int SetTerminalRaw(int fd) {
@@ -46,6 +44,7 @@
using namespace ::android::hardware::bluetooth::hci;
using namespace ::android::hardware::bluetooth::async;
+using aidl::android::hardware::bluetooth::hal::Status;
namespace aidl::android::hardware::bluetooth::impl {
@@ -62,298 +61,234 @@
return str.compare(0, prefix.length(), prefix) == 0;
}
-class Hal {
- public:
- Hal(const std::string& dev_path = "/dev/hvc5") {
- char property_bytes[PROPERTY_VALUE_MAX];
- property_get("vendor.ser.bt-uart", property_bytes, dev_path.c_str());
- mDevPath = std::string(property_bytes);
- }
+BluetoothHci::BluetoothHci(const std::string& dev_path) {
+ char property_bytes[PROPERTY_VALUE_MAX];
+ property_get("vendor.ser.bt-uart", property_bytes, dev_path.c_str());
+ mDevPath = std::string(property_bytes);
+}
- static void Initialize(void* instance,
- const struct hal_callbacks* callbacks) {
- static_cast<Hal*>(instance)->Initialize(callbacks);
- }
-
- static void Close(void* instance) { static_cast<Hal*>(instance)->Close(); }
-
- static void SendCommand(void* instance, const uint8_t* data, size_t len) {
- static_cast<Hal*>(instance)->SendCommand(
- std::vector<uint8_t>(data, data + len));
- }
-
- static void SendAcl(void* instance, const uint8_t* data, size_t len) {
- static_cast<Hal*>(instance)->SendAcl(
- std::vector<uint8_t>(data, data + len));
- }
-
- static void SendSco(void* instance, const uint8_t* data, size_t len) {
- static_cast<Hal*>(instance)->SendSco(
- std::vector<uint8_t>(data, data + len));
- }
-
- static void SendIso(void* instance, const uint8_t* data, size_t len) {
- static_cast<Hal*>(instance)->SendIso(
- std::vector<uint8_t>(data, data + len));
- }
-
- private:
- int getFdFromDevPath() {
- int fd = open(mDevPath.c_str(), O_RDWR);
- if (fd < 0) {
- ALOGE("Could not connect to bt: %s (%s)", mDevPath.c_str(),
- strerror(errno));
- return fd;
- }
- if (int ret = SetTerminalRaw(fd) < 0) {
- ALOGI("Could not make %s a raw terminal %d(%s)", mDevPath.c_str(), ret,
- strerror(errno));
- }
+int BluetoothHci::getFdFromDevPath() {
+ int fd = open(mDevPath.c_str(), O_RDWR);
+ if (fd < 0) {
+ ALOGE("Could not connect to bt: %s (%s)", mDevPath.c_str(),
+ strerror(errno));
return fd;
}
+ if (int ret = SetTerminalRaw(fd) < 0) {
+ ALOGI("Could not make %s a raw terminal %d(%s)", mDevPath.c_str(), ret,
+ strerror(errno));
+ }
+ return fd;
+}
- void reset() {
- // Send a reset command and wait until the command complete comes back.
+void BluetoothHci::reset() {
+ // Send a reset command and wait until the command complete comes back.
- std::vector<uint8_t> reset = {0x03, 0x0c, 0x00};
+ std::vector<uint8_t> reset = {0x03, 0x0c, 0x00};
- auto resetPromise = std::make_shared<std::promise<void>>();
- auto resetFuture = resetPromise->get_future();
+ auto resetPromise = std::make_shared<std::promise<void>>();
+ auto resetFuture = resetPromise->get_future();
- mH4 = std::make_shared<H4Protocol>(
- mFd,
- [](const std::vector<uint8_t>& raw_command) {
- ALOGI("Discarding %d bytes with command type",
- static_cast<int>(raw_command.size()));
- },
- [](const std::vector<uint8_t>& raw_acl) {
- ALOGI("Discarding %d bytes with acl type",
- static_cast<int>(raw_acl.size()));
- },
- [](const std::vector<uint8_t>& raw_sco) {
- ALOGI("Discarding %d bytes with sco type",
- static_cast<int>(raw_sco.size()));
- },
- [resetPromise](const std::vector<uint8_t>& raw_event) {
- std::vector<uint8_t> reset_complete = {0x0e, 0x04, 0x01,
- 0x03, 0x0c, 0x00};
- bool valid = raw_event.size() == 6 &&
- raw_event[0] == reset_complete[0] &&
- raw_event[1] == reset_complete[1] &&
- // Don't compare the number of packets field.
- raw_event[3] == reset_complete[3] &&
- raw_event[4] == reset_complete[4] &&
- raw_event[5] == reset_complete[5];
- if (valid) {
- resetPromise->set_value();
- } else {
- ALOGI("Discarding %d bytes with event type",
- static_cast<int>(raw_event.size()));
- }
- },
- [](const std::vector<uint8_t>& raw_iso) {
- ALOGI("Discarding %d bytes with iso type",
- static_cast<int>(raw_iso.size()));
- },
- [this]() {
- ALOGI("HCI socket device disconnected while waiting for reset");
- mFdWatcher.StopWatchingFileDescriptors();
- });
- mFdWatcher.WatchFdForNonBlockingReads(mFd,
- [this](int) { mH4->OnDataReady(); });
+ mH4 = std::make_shared<H4Protocol>(
+ mFd,
+ [](const std::vector<uint8_t>& raw_command) {
+ ALOGI("Discarding %d bytes with command type",
+ static_cast<int>(raw_command.size()));
+ },
+ [](const std::vector<uint8_t>& raw_acl) {
+ ALOGI("Discarding %d bytes with acl type",
+ static_cast<int>(raw_acl.size()));
+ },
+ [](const std::vector<uint8_t>& raw_sco) {
+ ALOGI("Discarding %d bytes with sco type",
+ static_cast<int>(raw_sco.size()));
+ },
+ [resetPromise](const std::vector<uint8_t>& raw_event) {
+ std::vector<uint8_t> reset_complete = {0x0e, 0x04, 0x01,
+ 0x03, 0x0c, 0x00};
+ bool valid = raw_event.size() == 6 &&
+ raw_event[0] == reset_complete[0] &&
+ raw_event[1] == reset_complete[1] &&
+ // Don't compare the number of packets field.
+ raw_event[3] == reset_complete[3] &&
+ raw_event[4] == reset_complete[4] &&
+ raw_event[5] == reset_complete[5];
+ if (valid) {
+ resetPromise->set_value();
+ } else {
+ ALOGI("Discarding %d bytes with event type",
+ static_cast<int>(raw_event.size()));
+ }
+ },
+ [](const std::vector<uint8_t>& raw_iso) {
+ ALOGI("Discarding %d bytes with iso type",
+ static_cast<int>(raw_iso.size()));
+ },
+ [this]() {
+ ALOGI("HCI socket device disconnected while waiting for reset");
+ mFdWatcher.StopWatchingFileDescriptors();
+ });
+ mFdWatcher.WatchFdForNonBlockingReads(mFd,
+ [this](int) { mH4->OnDataReady(); });
- if (!send(PacketType::COMMAND, reset)) {
- ALOGE("Error sending reset command");
- }
- auto status = resetFuture.wait_for(std::chrono::seconds(1));
- mFdWatcher.StopWatchingFileDescriptors();
- if (status == std::future_status::ready) {
- ALOGI("HCI Reset successful");
- } else {
- ALOGE("HCI Reset Response not received in one second");
- }
-
- resetPromise.reset();
+ send(PacketType::COMMAND, reset);
+ auto status = resetFuture.wait_for(std::chrono::seconds(1));
+ mFdWatcher.StopWatchingFileDescriptors();
+ if (status == std::future_status::ready) {
+ ALOGI("HCI Reset successful");
+ } else {
+ ALOGE("HCI Reset Response not received in one second");
}
- void Initialize(const struct hal_callbacks* callbacks) {
- ALOGI(__func__);
+ resetPromise.reset();
+}
- HalState old_state = HalState::READY;
- {
- std::lock_guard<std::mutex> guard(mStateMutex);
- if (mState != HalState::READY) {
- old_state = mState;
- } else {
- mState = HalState::INITIALIZING;
- }
- }
+void BluetoothHci::initialize(
+ const std::shared_ptr<hal::IBluetoothHciCallbacks>& cb) {
+ ALOGI(__func__);
- if (old_state != HalState::READY) {
- ALOGE("initialize: Unexpected State %d", static_cast<int>(old_state));
- Close();
- callbacks->initialization_complete(callbacks->handle,
- STATUS_ALREADY_INITIALIZED);
- return;
- }
-
- mCallbacks = std::make_unique<struct hal_callbacks>(*callbacks);
- management_.reset(new NetBluetoothMgmt);
- mFd = management_->openHci();
- if (mFd < 0) {
- management_.reset();
-
- ALOGI("Unable to open Linux interface, trying default path.");
- mFd = getFdFromDevPath();
- if (mFd < 0) {
- mState = HalState::READY;
- mCallbacks->initialization_complete(mCallbacks->handle,
- STATUS_UNABLE_TO_OPEN_INTERFACE);
- return;
- }
- }
-
- // TODO: HCI Reset on emulators since the bluetooth controller
- // cannot be powered on/off during the HAL setup; and the stack
- // might received spurious packets/events during boottime.
- // Proper solution would be to use bt-virtio or vsock to better
- // control the link to rootcanal and the controller lifetime.
- const std::string kBoardProperty = "ro.product.board";
- const std::string kCuttlefishBoard = "cutf";
- auto board_name = GetSystemProperty(kBoardProperty);
- if (board_name.has_value() &&
- (starts_with(board_name.value(), "cutf") ||
- starts_with(board_name.value(), "goldfish"))) {
- reset();
- }
-
- mH4 = std::make_shared<H4Protocol>(
- mFd,
- [](const std::vector<uint8_t>& /* raw_command */) {
- LOG_ALWAYS_FATAL("Unexpected command!");
- },
- [this](const std::vector<uint8_t>& raw_acl) {
- mCallbacks->acl_received(mCallbacks->handle, raw_acl.data(),
- raw_acl.size());
- },
- [this](const std::vector<uint8_t>& raw_sco) {
- mCallbacks->sco_received(mCallbacks->handle, raw_sco.data(),
- raw_sco.size());
- },
- [this](const std::vector<uint8_t>& raw_event) {
- mCallbacks->event_received(mCallbacks->handle, raw_event.data(),
- raw_event.size());
- },
- [this](const std::vector<uint8_t>& raw_iso) {
- mCallbacks->iso_received(mCallbacks->handle, raw_iso.data(),
- raw_iso.size());
- },
- [this]() {
- ALOGI("HCI socket device disconnected");
- mFdWatcher.StopWatchingFileDescriptors();
- });
- mFdWatcher.WatchFdForNonBlockingReads(mFd,
- [this](int) { mH4->OnDataReady(); });
-
- {
- std::lock_guard<std::mutex> guard(mStateMutex);
- mState = HalState::ONE_CLIENT;
- }
-
- ALOGI("initialization complete");
- mCallbacks->initialization_complete(mCallbacks->handle, STATUS_SUCCESS);
+ if (cb == nullptr) {
+ ALOGE("cb == nullptr! -> Unable to call initializationComplete(ERR)");
+ abort();
}
- void Close() {
- ALOGI(__func__);
- {
- std::lock_guard<std::mutex> guard(mStateMutex);
- if (mState != HalState::ONE_CLIENT) {
- LOG_ALWAYS_FATAL_IF(mState == HalState::INITIALIZING,
- "mState is INITIALIZING");
- ALOGI("Already closed");
- return;
- }
- mCallbacks.reset();
- mState = HalState::CLOSING;
- }
-
- mFdWatcher.StopWatchingFileDescriptors();
-
- if (management_) {
- management_->closeHci();
- } else {
- ::close(mFd);
- }
-
- {
- std::lock_guard<std::mutex> guard(mStateMutex);
- mState = HalState::READY;
- mH4 = nullptr;
- }
- }
-
- void SendCommand(const std::vector<uint8_t>& data) {
- send(PacketType::COMMAND, data);
- }
- void SendAcl(const std::vector<uint8_t>& data) {
- send(PacketType::ACL_DATA, data);
- }
- void SendSco(const std::vector<uint8_t>& data) {
- send(PacketType::SCO_DATA, data);
- }
- void SendIso(const std::vector<uint8_t>& data) {
- send(PacketType::ISO_DATA, data);
- }
-
- bool send(PacketType type, const std::vector<uint8_t>& v) {
- if (v.empty()) {
- ALOGE("Packet is empty, no data was found to be sent");
- return false;
- }
-
+ HalState old_state = HalState::READY;
+ {
std::lock_guard<std::mutex> guard(mStateMutex);
- if (mH4 == nullptr) {
- ALOGE("Illegal State");
- return false;
+ if (mState != HalState::READY) {
+ old_state = mState;
+ } else {
+ mState = HalState::INITIALIZING;
}
-
- mH4->Send(type, v);
- return true;
}
- std::unique_ptr<struct hal_callbacks> mCallbacks;
- std::string mDevPath;
- int mFd{-1};
- ::android::hardware::bluetooth::async::AsyncFdWatcher mFdWatcher;
- std::shared_ptr<::android::hardware::bluetooth::hci::H4Protocol> mH4;
- std::unique_ptr<NetBluetoothMgmt> management_{};
+ if (old_state != HalState::READY) {
+ ALOGE("initialize: Unexpected State %d", static_cast<int>(old_state));
+ close();
+ cb->initializationComplete(Status::ALREADY_INITIALIZED);
+ }
- // Don't close twice or open before close is complete
- std::mutex mStateMutex;
- enum class HalState {
- READY,
- INITIALIZING,
- ONE_CLIENT,
- CLOSING,
- } mState{HalState::READY};
-};
+ mCb = cb;
+ management_.reset(new NetBluetoothMgmt);
+ mFd = management_->openHci();
+ if (mFd < 0) {
+ management_.reset();
+
+ ALOGI("Unable to open Linux interface, trying default path.");
+ mFd = getFdFromDevPath();
+ if (mFd < 0) {
+ mState = HalState::READY;
+ cb->initializationComplete(Status::UNABLE_TO_OPEN_INTERFACE);
+ }
+ }
+
+ // TODO: HCI Reset on emulators since the bluetooth controller
+ // cannot be powered on/off during the HAL setup; and the stack
+ // might received spurious packets/events during boottime.
+ // Proper solution would be to use bt-virtio or vsock to better
+ // control the link to rootcanal and the controller lifetime.
+ const std::string kBoardProperty = "ro.product.board";
+ const std::string kCuttlefishBoard = "cutf";
+ auto board_name = GetSystemProperty(kBoardProperty);
+ if (board_name.has_value() && (
+ starts_with(board_name.value(), "cutf") ||
+ starts_with(board_name.value(), "goldfish"))) {
+ reset();
+ }
+
+ mH4 = std::make_shared<H4Protocol>(
+ mFd,
+ [](const std::vector<uint8_t>& /* raw_command */) {
+ LOG_ALWAYS_FATAL("Unexpected command!");
+ },
+ [this](const std::vector<uint8_t>& raw_acl) {
+ mCb->aclDataReceived(raw_acl);
+ },
+ [this](const std::vector<uint8_t>& raw_sco) {
+ mCb->scoDataReceived(raw_sco);
+ },
+ [this](const std::vector<uint8_t>& raw_event) {
+ mCb->hciEventReceived(raw_event);
+ },
+ [this](const std::vector<uint8_t>& raw_iso) {
+ mCb->isoDataReceived(raw_iso);
+ },
+ [this]() {
+ ALOGI("HCI socket device disconnected");
+ mFdWatcher.StopWatchingFileDescriptors();
+ });
+ mFdWatcher.WatchFdForNonBlockingReads(mFd,
+ [this](int) { mH4->OnDataReady(); });
+
+ {
+ std::lock_guard<std::mutex> guard(mStateMutex);
+ mState = HalState::ONE_CLIENT;
+ }
+ ALOGI("initialization complete");
+ mCb->initializationComplete(Status::SUCCESS);
+}
+
+void BluetoothHci::close() {
+ ALOGI(__func__);
+ {
+ std::lock_guard<std::mutex> guard(mStateMutex);
+ if (mState != HalState::ONE_CLIENT) {
+ LOG_ALWAYS_FATAL_IF(mState == HalState::INITIALIZING,
+ "mState is INITIALIZING");
+ ALOGI("Already closed");
+ }
+ mState = HalState::CLOSING;
+ }
+
+ mFdWatcher.StopWatchingFileDescriptors();
+
+ if (management_) {
+ management_->closeHci();
+ } else {
+ ::close(mFd);
+ }
+
+ {
+ std::lock_guard<std::mutex> guard(mStateMutex);
+ mState = HalState::READY;
+ mH4 = nullptr;
+ }
+}
+
+void BluetoothHci::clientDied() {
+ ALOGI(__func__);
+ close();
+}
+
+void BluetoothHci::sendHciCommand(const std::vector<uint8_t>& packet) {
+ return send(PacketType::COMMAND, packet);
+}
+
+void BluetoothHci::sendAclData(const std::vector<uint8_t>& packet) {
+ return send(PacketType::ACL_DATA, packet);
+}
+
+void BluetoothHci::sendScoData(const std::vector<uint8_t>& packet) {
+ return send(PacketType::SCO_DATA, packet);
+}
+
+void BluetoothHci::sendIsoData(const std::vector<uint8_t>& packet) {
+ return send(PacketType::ISO_DATA, packet);
+}
+
+void BluetoothHci::send(PacketType type, const std::vector<uint8_t>& v) {
+ if (v.empty()) {
+ ALOGE("Packet is empty, no data was found to be sent");
+ abort();
+ }
+
+ std::lock_guard<std::mutex> guard(mStateMutex);
+ if (mH4 == nullptr) {
+ ALOGE("Illegal State");
+ abort();
+ }
+
+ mH4->Send(type, v);
+}
} // namespace aidl::android::hardware::bluetooth::impl
-
-extern "C" {
-
-using namespace aidl::android::hardware::bluetooth::impl;
-
-struct hal_interface hal_new() {
- return (struct hal_interface){
- .handle = new Hal(),
- .initialize = &Hal::Initialize,
- .close = &Hal::Close,
- .send_command = &Hal::SendCommand,
- .send_acl = &Hal::SendAcl,
- .send_sco = &Hal::SendSco,
- .send_iso = &Hal::SendIso,
- };
-}
-}
diff --git a/bluetooth/aidl/default/BluetoothHci.h b/bluetooth/aidl/default/BluetoothHci.h
new file mode 100644
index 0000000..5c31468
--- /dev/null
+++ b/bluetooth/aidl/default/BluetoothHci.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <hal/ffi.h>
+
+#include <future>
+#include <string>
+
+#include "async_fd_watcher.h"
+#include "h4_protocol.h"
+#include "net_bluetooth_mgmt.h"
+
+namespace aidl::android::hardware::bluetooth::impl {
+
+// This Bluetooth HAL implementation connects with a serial port at dev_path_.
+class BluetoothHci : public hal::IBluetoothHci {
+ public:
+ BluetoothHci(const std::string& dev_path = "/dev/hvc5");
+
+ void initialize(
+ const std::shared_ptr<hal::IBluetoothHciCallbacks>& cb) override;
+
+ void sendHciCommand(const std::vector<uint8_t>& packet) override;
+
+ void sendAclData(const std::vector<uint8_t>& packet) override;
+
+ void sendScoData(const std::vector<uint8_t>& packet) override;
+
+ void sendIsoData(const std::vector<uint8_t>& packet) override;
+
+ void close() override;
+
+ void clientDied() override;
+
+ static void OnPacketReady();
+
+ static BluetoothHci* get();
+
+ private:
+ int mFd{-1};
+ std::shared_ptr<hal::IBluetoothHciCallbacks> mCb = nullptr;
+
+ std::shared_ptr<::android::hardware::bluetooth::hci::H4Protocol> mH4;
+
+ std::string mDevPath;
+
+ ::android::hardware::bluetooth::async::AsyncFdWatcher mFdWatcher;
+
+ int getFdFromDevPath();
+ void send(::android::hardware::bluetooth::hci::PacketType type,
+ const std::vector<uint8_t>& packet);
+ std::unique_ptr<NetBluetoothMgmt> management_{};
+
+ // Send a reset command and discard all packets until a reset is received.
+ void reset();
+
+ // Don't close twice or open before close is complete
+ std::mutex mStateMutex;
+ enum class HalState {
+ READY,
+ INITIALIZING,
+ ONE_CLIENT,
+ CLOSING,
+ } mState{HalState::READY};
+};
+
+} // namespace aidl::android::hardware::bluetooth::impl
diff --git a/bluetooth/aidl/default/main.rs b/bluetooth/aidl/default/main.rs
deleted file mode 100644
index b30162a..0000000
--- a/bluetooth/aidl/default/main.rs
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2024, The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use android_hardware_bluetooth::aidl::android::hardware::bluetooth::IBluetoothHci::{
- self,
- IBluetoothHci as _
-};
-use android_hardware_bluetooth::binder;
-use bluetooth_offload_hal::{ HciHalProxy, CInterface };
-use bluetooth_offload_leaudio_hci::LeAudioModuleBuilder;
-use log;
-use std::panic;
-
-fn new_hal() -> CInterface {
- extern "C" { fn hal_new() -> CInterface; }
- unsafe { hal_new() }
-}
-
-fn main() {
- logger::init(
- logger::Config::default()
- .with_max_level(log::LevelFilter::Debug)
- .with_tag_on_device("android.hardware.bluetooth"),
- );
-
- panic::set_hook(Box::new(|panic_info| {
- log::error!("{}", panic_info);
- }));
-
- log::info!("Bluetooth HAL starting up");
-
- binder::ProcessState::set_thread_pool_max_thread_count(0);
- binder::ProcessState::start_thread_pool();
-
- binder::add_service(
- &format!("{}/default", IBluetoothHci::BpBluetoothHci::get_descriptor()),
- IBluetoothHci::BnBluetoothHci::new_binder(
- HciHalProxy::new(
- vec![ Box::new(LeAudioModuleBuilder {}) ],
- new_hal()
- ),
- binder::BinderFeatures::default(),
- ).as_binder()
- ).expect("Failed to register service");
-
- binder::ProcessState::join_thread_pool();
-}
diff --git a/bluetooth/aidl/default/service.cpp b/bluetooth/aidl/default/service.cpp
new file mode 100644
index 0000000..9e1a22c
--- /dev/null
+++ b/bluetooth/aidl/default/service.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "aidl.android.hardware.bluetooth.service.default"
+
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <hidl/HidlSupport.h>
+#include <hidl/HidlTransportSupport.h>
+
+#include "BluetoothHci.h"
+
+using ::aidl::android::hardware::bluetooth::hal::IBluetoothHci_addService;
+using ::aidl::android::hardware::bluetooth::impl::BluetoothHci;
+using ::android::hardware::configureRpcThreadpool;
+using ::android::hardware::joinRpcThreadpool;
+
+int main(int /* argc */, char** /* argv */) {
+ ALOGI("Bluetooth HAL starting");
+ if (!ABinderProcess_setThreadPoolMaxThreadCount(0)) {
+ ALOGI("failed to set thread pool max thread count");
+ return 1;
+ }
+
+ IBluetoothHci_addService(new BluetoothHci());
+ ABinderProcess_joinThreadPool();
+ return 0;
+}
diff --git a/bluetooth/audio/aidl/default/A2dpOffloadCodecSbc.cpp b/bluetooth/audio/aidl/default/A2dpOffloadCodecSbc.cpp
index 6b9046c..10c347b 100644
--- a/bluetooth/audio/aidl/default/A2dpOffloadCodecSbc.cpp
+++ b/bluetooth/audio/aidl/default/A2dpOffloadCodecSbc.cpp
@@ -102,7 +102,7 @@
kBlockLength16
};
-enum { kSubbands8 = kSubbands.first, kSubbands4 };
+enum { kSubbands4 = kSubbands.first, kSubbands8 };
enum {
kAllocationMethodSnr = kAllocationMethod.first,
@@ -486,7 +486,7 @@
}
min_bitpool = std::max(min_bitpool, uint8_t(lcaps.get(kMinimumBitpool)));
- max_bitpool = std::max(max_bitpool, uint8_t(lcaps.get(kMaximumBitpool)));
+ max_bitpool = std::min(max_bitpool, uint8_t(lcaps.get(kMaximumBitpool)));
if (hint) {
min_bitpool =
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
index 003da11..9cd63d6 100644
--- a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
@@ -37,8 +37,9 @@
/**
* The value used by the Host stack for the local Maximum Packet Size shall be the value
* LE_ACL_Data_Packet_Length returned by the controller in response to the command HCI LE Read
- * Buffer Size. Then, the MPS size must be in range 1 to 255. We do not make the MPS
- * configurable in HAL because using the maximum value does not require a large amount of
- * memory.
+ * Buffer Size if Total_Num_LE_ACL_Data_Packets is not zero. The MPS shall be the value
+ * ACL_Data_Packet_Length returned in response to the command HCI Read Buffer Size if
+ * Total_Num_LE_ACL_Data_Packets is zero. We do not make the MPS configurable in HAL because
+ * using the maximum value does not require a large amount of memory.
*/
}
diff --git a/configstore/OWNERS b/configstore/OWNERS
index 70ad434..74789b5 100644
--- a/configstore/OWNERS
+++ b/configstore/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 24939
-lpy@google.com
diff --git a/confirmationui/1.0/default/OWNERS b/confirmationui/1.0/default/OWNERS
index 17aed51..d8b8840 100644
--- a/confirmationui/1.0/default/OWNERS
+++ b/confirmationui/1.0/default/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 1124672
-jdanis@google.com
swillden@google.com
diff --git a/confirmationui/1.0/vts/OWNERS b/confirmationui/1.0/vts/OWNERS
index aa07242..b0ee996 100644
--- a/confirmationui/1.0/vts/OWNERS
+++ b/confirmationui/1.0/vts/OWNERS
@@ -1,4 +1,3 @@
# Bug component: 1124672
-jdanis@google.com
swillden@google.com
yim@google.com
diff --git a/confirmationui/support/OWNERS b/confirmationui/support/OWNERS
index 17aed51..d8b8840 100644
--- a/confirmationui/support/OWNERS
+++ b/confirmationui/support/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 1124672
-jdanis@google.com
swillden@google.com
diff --git a/gatekeeper/1.0/default/OWNERS b/gatekeeper/1.0/default/OWNERS
index c97fba6..d552a9a 100644
--- a/gatekeeper/1.0/default/OWNERS
+++ b/gatekeeper/1.0/default/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 1124862
-jdanis@google.com
swillden@google.com
diff --git a/gatekeeper/1.0/software/OWNERS b/gatekeeper/1.0/software/OWNERS
index c97fba6..d552a9a 100644
--- a/gatekeeper/1.0/software/OWNERS
+++ b/gatekeeper/1.0/software/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 1124862
-jdanis@google.com
swillden@google.com
diff --git a/gnss/OWNERS b/gnss/OWNERS
index 57982e7..2c54f9f 100644
--- a/gnss/OWNERS
+++ b/gnss/OWNERS
@@ -2,7 +2,6 @@
gomo@google.com
smalkos@google.com
-trong@google.com
wyattriley@google.com
yim@google.com
yuhany@google.com
diff --git a/graphics/OWNERS b/graphics/OWNERS
index 4317831..9ba1ee0 100644
--- a/graphics/OWNERS
+++ b/graphics/OWNERS
@@ -5,5 +5,4 @@
alecmouri@google.com
chrisforbes@google.com
jreck@google.com
-lpy@google.com
sumir@google.com
diff --git a/ir/OWNERS b/ir/OWNERS
index 04de9ef..376fe0a 100644
--- a/ir/OWNERS
+++ b/ir/OWNERS
@@ -1,2 +1,2 @@
# Bug component: 163905
-connoro@google.com
+devinmoore@google.com
\ No newline at end of file
diff --git a/nfc/1.0/default/OWNERS b/nfc/1.0/default/OWNERS
index 5febd1d..e681870 100644
--- a/nfc/1.0/default/OWNERS
+++ b/nfc/1.0/default/OWNERS
@@ -1,2 +1 @@
rmojumder@google.com
-zachoverflow@google.com
diff --git a/nfc/1.2/vts/OWNERS b/nfc/1.2/vts/OWNERS
index 21d4df1..eeeadd1 100644
--- a/nfc/1.2/vts/OWNERS
+++ b/nfc/1.2/vts/OWNERS
@@ -1,3 +1,2 @@
-zachoverflow@google.com
jackcwyu@google.com
georgekgchang@google.com
diff --git a/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp b/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp
index 9c44c3a..d3fcbb3 100644
--- a/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp
+++ b/nfc/aidl/vts/functional/VtsNfcBehaviorChangesTest.cpp
@@ -153,8 +153,7 @@
SyncEventGuard guard(sNfaVsCommand);
sNfaVsCommand.notifyOne();
} break;
- case NCI_ANDROID_SET_PASSIVE_OBSERVER_TECH:
- case NCI_ANDROID_PASSIVE_OBSERVE: {
+ case NCI_ANDROID_SET_PASSIVE_OBSERVER_TECH: {
if (param_len == 5) {
if ((p_param[0] & NCI_MT_MASK) == (NCI_MT_RSP << NCI_MT_SHIFT)) {
sVSCmdStatus = p_param[4];
@@ -190,36 +189,6 @@
}
/*
- * Enable passive observe mode.
- */
-tNFA_STATUS static nfaObserveModeEnable(bool enable) {
- tNFA_STATUS status = NFA_STATUS_FAILED;
-
- status = NFA_StopRfDiscovery();
- if (status == NFA_STATUS_OK) {
- if (!sNfaEnableDisablePollingEvent.wait(1000)) {
- LOG(WARNING) << "Timeout waiting to disable NFC RF discovery";
- return NFA_STATUS_TIMEOUT;
- }
- }
-
- uint8_t cmd[] = {NCI_ANDROID_PASSIVE_OBSERVE,
- static_cast<uint8_t>(enable ? NCI_ANDROID_PASSIVE_OBSERVE_PARAM_ENABLE
- : NCI_ANDROID_PASSIVE_OBSERVE_PARAM_DISABLE)};
-
- status = NFA_SendVsCommand(NCI_MSG_PROP_ANDROID, sizeof(cmd), cmd, nfaVSCallback);
-
- if (status == NFA_STATUS_OK) {
- if (!sNfaVsCommand.wait(1000)) {
- LOG(WARNING) << "Timeout waiting for set observe mode command response";
- return NFA_STATUS_TIMEOUT;
- }
- }
-
- return status;
-}
-
-/*
* Get observe mode state.
*/
tNFA_STATUS static nfaQueryObserveModeState() {
@@ -322,33 +291,6 @@
};
/*
- * ObserveModeEnableDisable:
- * Attempts to enable observe mode. Does not test Observe Mode functionality,
- * but simply verifies that the enable command responds successfully.
- *
- * @VsrTest = GMS-VSR-3.2.8-001
- */
-TEST_P(NfcBehaviorChanges, ObserveModeEnableDisable) {
- if (get_vsr_api_level() < 202404) {
- GTEST_SKIP() << "Skipping test for board API level < 202404";
- }
-
- tNFA_STATUS status = nfaObserveModeEnable(true);
- ASSERT_EQ(status, NFA_STATUS_OK);
-
- status = nfaQueryObserveModeState();
- ASSERT_EQ(status, NFA_STATUS_OK);
- ASSERT_NE(sObserveModeState, 0);
-
- status = nfaObserveModeEnable(false);
- ASSERT_EQ(status, NFA_STATUS_OK);
-
- status = nfaQueryObserveModeState();
- ASSERT_EQ(status, NFA_STATUS_OK);
- ASSERT_EQ(sObserveModeState, 0);
-}
-
-/*
* SetPassiveObserverTech_getCaps:
* Verifies GET_CAPS returns get correct value for observe mode capabilities.
*/
diff --git a/power/1.0/vts/OWNERS b/power/1.0/vts/OWNERS
index 6de2cd5..53948b9 100644
--- a/power/1.0/vts/OWNERS
+++ b/power/1.0/vts/OWNERS
@@ -1,2 +1 @@
# Bug component: 158088
-connoro@google.com
diff --git a/power/1.1/vts/functional/OWNERS b/power/1.1/vts/functional/OWNERS
index 6de2cd5..53948b9 100644
--- a/power/1.1/vts/functional/OWNERS
+++ b/power/1.1/vts/functional/OWNERS
@@ -1,2 +1 @@
# Bug component: 158088
-connoro@google.com
diff --git a/power/stats/1.0/default/OWNERS b/power/stats/1.0/default/OWNERS
index 2d95a97..0557220 100644
--- a/power/stats/1.0/default/OWNERS
+++ b/power/stats/1.0/default/OWNERS
@@ -1,3 +1,2 @@
krossmo@google.com
bsschwar@google.com
-tstrudel@google.com
diff --git a/security/secretkeeper/OWNERS b/security/secretkeeper/OWNERS
index acf4c6c..d63ba9b 100644
--- a/security/secretkeeper/OWNERS
+++ b/security/secretkeeper/OWNERS
@@ -1,6 +1,5 @@
# Bug component: 867125
-alanstokes@google.com
drysdale@google.com
hasinitg@google.com
shikhapanwar@google.com
diff --git a/sensors/aidl/android/hardware/sensors/SensorType.aidl b/sensors/aidl/android/hardware/sensors/SensorType.aidl
index adaf8e6..bc1b4b2 100644
--- a/sensors/aidl/android/hardware/sensors/SensorType.aidl
+++ b/sensors/aidl/android/hardware/sensors/SensorType.aidl
@@ -275,8 +275,9 @@
* than every period_ns passed to setDelay() or to batch().
* See the definition of the on-change reporting mode for more information.
*
- * SensorInfo.requiredPermission must be set to
- * SENSOR_PERMISSION_BODY_SENSORS.
+ * The framework will override the SensorInfo.requiredPermission to either
+ * SENSOR_PERMISSION_BODY_SENSORS or SENSOR_PERMISSION_READ_HEART_RATE
+ * depending on the platform SDK version in order to ensure compatibility.
*
* Both wake-up and non wake-up versions are useful.
*/
diff --git a/threadnetwork/aidl/default/Android.bp b/threadnetwork/aidl/default/Android.bp
index a840fa3..481f027 100644
--- a/threadnetwork/aidl/default/Android.bp
+++ b/threadnetwork/aidl/default/Android.bp
@@ -45,6 +45,41 @@
],
}
+cc_library_static {
+ name: "android.hardware.threadnetwork.lib",
+
+ vendor: true,
+ export_include_dirs: ["."],
+
+ defaults: ["android.hardware.threadnetwork-service.defaults"],
+
+ srcs: [
+ "service.cpp",
+ "thread_chip.cpp",
+ "utils.cpp",
+ ],
+
+ shared_libs: [
+ "libbinder_ndk",
+ "liblog",
+ ],
+
+ static_libs: [
+ "android.hardware.threadnetwork-V1-ndk",
+ "libbase",
+ "libcutils",
+ "libutils",
+ "openthread-common",
+ "openthread-hdlc",
+ "openthread-platform",
+ "openthread-posix",
+ "openthread-spi",
+ "openthread-url",
+ ],
+
+ stl: "c++_static",
+}
+
cc_defaults {
name: "android.hardware.threadnetwork-service.defaults",
product_variables: {
diff --git a/threadnetwork/aidl/default/thread_chip.cpp b/threadnetwork/aidl/default/thread_chip.cpp
index e312728..ba0baf2 100644
--- a/threadnetwork/aidl/default/thread_chip.cpp
+++ b/threadnetwork/aidl/default/thread_chip.cpp
@@ -83,6 +83,11 @@
mRxFrameBuffer.GetFrame(), mRxFrameBuffer.GetFrame() + mRxFrameBuffer.GetLength()));
}
+ if (mVendorCallback != nullptr) {
+ mVendorCallback->onReceiveSpinelFrame(std::vector<uint8_t>(
+ mRxFrameBuffer.GetFrame(), mRxFrameBuffer.GetFrame() + mRxFrameBuffer.GetLength()));
+ }
+
mRxFrameBuffer.DiscardFrame();
}
@@ -193,6 +198,10 @@
}
}
+void ThreadChip::setVendorCallback(const std::shared_ptr<IThreadChipCallback>& vendorCallback) {
+ mVendorCallback = vendorCallback;
+}
+
ndk::ScopedAStatus ThreadChip::errorStatus(int32_t error, const char* message) {
return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage(error, message));
}
diff --git a/threadnetwork/aidl/default/thread_chip.hpp b/threadnetwork/aidl/default/thread_chip.hpp
index d07d049..6f23efe 100644
--- a/threadnetwork/aidl/default/thread_chip.hpp
+++ b/threadnetwork/aidl/default/thread_chip.hpp
@@ -43,6 +43,7 @@
ndk::ScopedAStatus hardwareReset() override;
void Update(otSysMainloopContext& context) override;
void Process(const otSysMainloopContext& context) override;
+ void setVendorCallback(const std::shared_ptr<IThreadChipCallback>& vendorCallback);
private:
static void onBinderDiedJump(void* context);
@@ -59,6 +60,7 @@
std::shared_ptr<ot::Spinel::SpinelInterface> mSpinelInterface;
ot::Spinel::SpinelInterface::RxFrameBuffer mRxFrameBuffer;
std::shared_ptr<IThreadChipCallback> mCallback;
+ std::shared_ptr<IThreadChipCallback> mVendorCallback;
::ndk::ScopedAIBinder_DeathRecipient mDeathRecipient;
};
diff --git a/wifi/OWNERS b/wifi/OWNERS
index c10bbab..ec21f2e 100644
--- a/wifi/OWNERS
+++ b/wifi/OWNERS
@@ -7,4 +7,3 @@
# This will get them auto-assigned to the on-call triage engineer, ensuring quickest response.
#
arabawy@google.com
-etancohen@google.com
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index 6c7ae09..8bc9d1a 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -3895,12 +3895,13 @@
return false;
}
*aidl_scan_result = {};
- aidl_scan_result->timeStampInUs =
- ts_us - (static_cast<uint64_t>(legacy_scan_result.age_ms) * 1000);
- if (aidl_scan_result->timeStampInUs < 0) {
+ // Ensure that subtracting does not result in a negative value
+ uint64_t age_us = static_cast<uint64_t>(legacy_scan_result.age_ms) * 1000;
+ if (ts_us < age_us) {
aidl_scan_result->timeStampInUs = 0;
return false;
}
+ aidl_scan_result->timeStampInUs = ts_us - age_us;
size_t max_len_excluding_null = sizeof(legacy_scan_result.ssid) - 1;
size_t ssid_len = strnlen((const char*)legacy_scan_result.ssid, max_len_excluding_null);
aidl_scan_result->ssid =