Merge "Adds documentation for a test echo endpoint service" into main
diff --git a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
index 272f7c5..6cd7d1f 100644
--- a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
+++ b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
@@ -218,7 +218,7 @@
{
"name": "Tire pressure",
"value": 392168201,
- "description": "Tire pressure\n{@code HasSupportedValueInfo.hasMinSupportedValue} and {@code HasSupportedValueInfo.hasMaxSupportedValue} must be {@code true} for all areas.\n{@code MinMaxSupportedValueResult.minSupportedValue} represents the lower bound of the recommended tire pressure for the tire at the specified area ID.\n{@code MinMaxSupportedValueResult.maxSupportedValue} represents the upper bound of the recommended tire pressure for the tire at the specified area ID.\nFor example, if the recommended tire pressure of left_front tire is from 200.0 KILOPASCAL to 240.0 KILOPASCAL, {@code getMinMaxSupportedValue} for [propId=TIRE_PRESSURE, areaId=VehicleAreaWheel::LEFT_FRONT] must return a {@code MinMaxSupportedValueResult} with OK status, 200.0 as minSupportedValue, 240.0 as maxSupportedValue.\nFor backward compatibility, minFloatValue and maxFloatValue in {@code VehicleAreaConfig} must be set to the same as minSupportedValue and maxSupportedValue at boot time.\nEach tire is identified by its areaConfig.areaId config.\nFor example: .areaConfigs = { VehicleAreaConfig { .areaId = VehicleAreaWheel::LEFT_FRONT, .minFloatValue = 200.0, .maxFloatValue = 240.0, } },"
+ "description": "Tire pressure\nEach tire is identified by its areaConfig.areaId config and its minFloatValue\/maxFloatValue are used to store OEM recommended pressure range.\nThe minFloatValue and maxFloatValue in VehicleAreaConfig must be defined.\nThe minFloatValue in the areaConfig data represents the lower bound of the recommended tire pressure.\nThe maxFloatValue in the areaConfig data represents the upper bound of the recommended tire pressure.\nFor example:\nThe following areaConfig indicates the recommended tire pressure of the left_front tire is from 200.0 KILOPASCAL to 240.0 KILOPASCAL. .areaConfigs = { VehicleAreaConfig { .areaId = VehicleAreaWheel::LEFT_FRONT, .minFloatValue = 200.0, .maxFloatValue = 240.0, } }\nIf {@code HasSupportedValueInfo} for a specific area ID is not {@code null}:\n{@code HasSupportedValueInfo.hasMinSupportedValue} and {@code HasSupportedValueInfo.hasMaxSupportedValue} must be {@code true} for the area ID.\n{@code MinMaxSupportedValueResult.minSupportedValue} represents the lower bound of the recommended tire pressure for the tire at the specified area ID.\n{@code MinMaxSupportedValueResult.maxSupportedValue} represents the upper bound of the recommended tire pressure for the tire at the specified area ID.\nFor example, if the recommended tire pressure of left_front tire is from 200.0 KILOPASCAL to 240.0 KILOPASCAL, {@code getMinMaxSupportedValue} for [propId=TIRE_PRESSURE, areaId=VehicleAreaWheel::LEFT_FRONT] must return a {@code MinMaxSupportedValueResult} with OK status, 200.0 as minSupportedValue, 240.0 as maxSupportedValue.\nAt boot, minFloatValue is equal to minSupportedValue, maxFloatValue is equal to maxSupportedValue."
},
{
"name": "Critically low tire pressure",
@@ -262,7 +262,7 @@
"ImpactSensorLocation"
],
"data_enum": "ImpactSensorLocation",
- "description": "Impact detected.\nBit flag property to relay information on whether an impact has occurred on a particular side of the vehicle as described through the ImpactSensorLocation enum. As a bit flag property, this property can be set to multiple ORed together values of the enum when necessary.\nFor the global area ID (0), {@code getSupportedValuesList} must return a {@code SupportedValuesListResult} that contains supported values unless all bit flags of ImpactSensorLocation are supported.\nFor backward compatibility, if {@code SupportedValuesListResult} is defined, {@code VehicleAreaConfig#supportedEnumValues} must be set to the same values."
+ "description": "Impact detected.\nBit flag property to relay information on whether an impact has occurred on a particular side of the vehicle as described through the ImpactSensorLocation enum. As a bit flag property, this property can be set to multiple ORed together values of the enum when necessary.\nFor the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined unless all bit flags of ImpactSensorLocation are supported.\nIf {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):\n{@code getSupportedValuesList} must return a {@code SupportedValuesListResult} that contains supported values unless all bit flags of ImpactSensorLocation are supported.\nAt boot, supportedEnumValues is equal to the supported values list."
},
{
"name": "Vehicle horn engaged.",
@@ -276,7 +276,7 @@
"VehicleGear"
],
"data_enum": "VehicleGear",
- "description": "Currently selected gear\nThis is the gear selected by the user.\n{@code VehicleAreaConfig.HasSupportedValueInfo.hasSupportedValuesList} for the global area ID (0) must be {@code true}.\n{@code getSupportedValuesList} for [GEAR_SELECTION, areaId=0] must return a {@code SupportedValuesListResult} that contains non-null {@code supportedValuesList}.\nThe supportedValues must represent the list of supported gears for this vehicle. For example, for an automatic transmission, the list can be {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_DRIVE, GEAR_1, GEAR_2,...} and for manual transmission it can be {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}.\nIn the case of an automatic transmission vehicle that allows the driver to select specific gears on demand (i.e. \"manual mode\"), GEAR_SELECTION's value must be set to the specific gear selected by the driver instead of simply GEAR_DRIVE.\nFor backward compatibility, config array for this property must be a list of values same as the supported values at boot-time."
+ "description": "Currently selected gear\nThis is the gear selected by the user.\nValues in the config array must represent the list of supported gears for this vehicle at boot time. For example, config array for an automatic transmission must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_DRIVE, GEAR_1, GEAR_2,...} and for manual transmission the list must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}\nIn the case of an automatic transmission vehicle that allows the driver to select specific gears on demand (i.e. \"manual mode\"), GEAR_SELECTION's value must be set to the specific gear selected by the driver instead of simply GEAR_DRIVE.\nIf {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):\n{@code VehicleAreaConfig.HasSupportedValueInfo.hasSupportedValuesList} for the global area ID (0) must be {@code true}.\n{@code getSupportedValuesList} for [GEAR_SELECTION, areaId=0] must return a {@code SupportedValuesListResult} that contains non-null {@code supportedValuesList}.\nThe supportedValues must represent the list of supported gears for this vehicle. For example, for an automatic transmission, the list can be {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_DRIVE, GEAR_1, GEAR_2,...} and for manual transmission it can be {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}.\nIn the case of an automatic transmission vehicle that allows the driver to select specific gears on demand (i.e. \"manual mode\"), the GEAR_SELECTION property value must be set to the specific gear selected by the driver instead of simply GEAR_DRIVE.\nAt boot, the config array's values are equal to the supported values list."
},
{
"name": "CURRENT_GEAR",
@@ -285,7 +285,7 @@
"VehicleGear"
],
"data_enum": "VehicleGear",
- "description": "Current gear. In non-manual case, selected gear may not match the current gear. For example, if the selected gear is GEAR_DRIVE, the current gear will be one of GEAR_1, GEAR_2 etc, which reflects the actual gear the transmission is currently running in.\n{@code VehicleAreaConfig.HasSupportedValueInfo.hasSupportedValuesList} for the global area ID (0) must be {@code true}.\n{@code getSupportedValuesList} for [GEAR_SELECTION, areaId=0] must return a {@code SupportedValuesListResult} that contains non-null {@code supportedValuesList}.\nThe supported values list must represent the list of supported gears for this vehicle. For example, for an automatic transmission, this list can be {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_1, GEAR_2,...} and for manual transmission the list can be {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}. This list need not be the same as that of the supported gears reported in GEAR_SELECTION.\nFor backward compatibility, config array for this property must be a list of values same as the supported values at boot-time."
+ "description": "Current gear. In non-manual case, selected gear may not match the current gear. For example, if the selected gear is GEAR_DRIVE, the current gear will be one of GEAR_1, GEAR_2 etc, which reflects the actual gear the transmission is currently running in.\nValues in the config array must represent the list of supported gears for this vehicle at boot time. For example, config array for an automatic transmission must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_1, GEAR_2,...} and for manual transmission the list must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}. This list need not be the same as that of the supported gears reported in GEAR_SELECTION.\nIf {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):\n{@code VehicleAreaConfig.HasSupportedValueInfo.hasSupportedValuesList} for the global area ID (0) must be {@code true}.\n{@code getSupportedValuesList} for [GEAR_SELECTION, areaId=0] must return a {@code SupportedValuesListResult} that contains non-null {@code supportedValuesList}.\nThe supported values list must represent the list of supported gears for this vehicle. For example, for an automatic transmission, this list can be {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_1, GEAR_2,...} and for manual transmission the list can be {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}. This list need not be the same as that of the supported gears reported in GEAR_SELECTION.\nAt boot, the config array's values are equal to the supported values list."
},
{
"name": "Parking brake state.",
@@ -300,7 +300,7 @@
{
"name": "EV_BRAKE_REGENERATION_LEVEL",
"value": 289408012,
- "description": "Regenerative braking level of a electronic vehicle\n{@code HasSupportedValueInfo.hasMinSupportedValue} and {@code HasSupportedValueInfo.hasMaxSupportedValue} must be {@code true} for global area ID(0)\n{@code MinMaxSupportedValueResult.minSupportedValue} must be 0.\n{@code MinMaxSupportedValueResult.maxSupportedValue} indicates the setting for the maximum amount of energy regenerated from braking. The minSupportedValue indicates the setting for no regenerative braking.\nAll values between min and max supported value must be supported.\nFor backward compatibility, minInt32Value and maxInt32Value in {@code VehicleAreaConfig} must be set to the same as minSupportedValue and maxSupportedValue at boot time.\nThis property is a more granular form of EV_REGENERATIVE_BRAKING_STATE. It allows the user to set a more specific level of regenerative braking if the states in EvRegenerativeBrakingState are not granular enough for the OEM.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
+ "description": "Regenerative braking level of a electronic vehicle\nThe minInt32Value and maxInt32Value in VehicleAreaConfig must be defined. All values between minInt32Value and maxInt32Value must be supported.\nThe minInt32Value indicates the setting for no regenerative braking, must be 0.\nThe maxInt32Value indicates the setting for the maximum amount of energy regenerated from braking.\nAll values between min and max supported value must be supported.\nIf {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):\n{@code HasSupportedValueInfo.hasMinSupportedValue} and {@code HasSupportedValueInfo.hasMaxSupportedValue} must be {@code true} for global area ID(0)\n{@code MinMaxSupportedValueResult.minSupportedValue} must be 0.\n{@code MinMaxSupportedValueResult.maxSupportedValue} indicates the setting for the maximum amount of energy regenerated from braking. The minSupportedValue indicates the setting for no regenerative braking.\nAt boot, minInt32Value is equal to minSupportedValue, maxInt32Value is equal to maxSupportedValue.\n\nThis property is a more granular form of EV_REGENERATIVE_BRAKING_STATE. It allows the user to set a more specific level of regenerative braking if the states in EvRegenerativeBrakingState are not granular enough for the OEM.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
"name": "Warning for fuel low level.",
@@ -347,7 +347,7 @@
"EvStoppingMode"
],
"data_enum": "EvStoppingMode",
- "description": "Represents property for the current stopping mode of the vehicle.\nFor the global area ID (0), {@code getSupportedValuesList} must return a {@code SupportedValuesListResult} that contains supported values unless all enum values of EvStoppingMode are supported.\nFor backward compatibility, if {@code SupportedValuesListResult} is defined, {@code VehicleAreaConfig#supportedEnumValues} must be set to the same values.\nThe EvStoppingMode enum may be extended to include more states in the future.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
+ "description": "Represents property for the current stopping mode of the vehicle.\nFor the global area ID (0), the VehicleAreaConfig#supportedEnumValues must be defined unless all enum values of EvStoppingMode are supported.\nIf {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):\nFor the global area ID (0), {@code getSupportedValuesList} must return a {@code SupportedValuesListResult} that contains supported values unless all enum values of EvStoppingMode are supported.\nAt boot, supportedEnumValues is equal to the supported values list.\n\nThe EvStoppingMode enum may be extended to include more states in the future.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
"name": "ELECTRONIC_STABILITY_CONTROL_ENABLED",
@@ -362,7 +362,7 @@
"ErrorState"
],
"data_enum": "ElectronicStabilityControlState",
- "description": "Electronic Stability Control (ESC) state.\nReturns the current state of ESC. This property must always return a valid state defined in ElectronicStabilityControlState or ErrorState. It must not surface errors through StatusCode and must use the supported error states instead.\nFor the global area ID (0), {@code getSupportedValuesList} must return a {@code SupportedValuesListResult} that contains supported values unless all states of both ElectronicStabilityControlState (including OTHER, which is not recommended) and ErrorState are supported.\nFor backward compatibility, if {@code SupportedValuesListResult} is defined, {@code VehicleAreaConfig#supportedEnumValues} must be set to the same values."
+ "description": "Electronic Stability Control (ESC) state.\nReturns the current state of ESC. This property must always return a valid state defined in ElectronicStabilityControlState or ErrorState. It must not surface errors through StatusCode and must use the supported error states instead.\nFor the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined unless all states of both ElectronicStabilityControlState (including OTHER, which is not recommended) and ErrorState are supported.\nIf {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):\nFor the global area ID (0), {@code getSupportedValuesList} must return a {@code SupportedValuesListResult} that contains supported values unless all states of both ElectronicStabilityControlState (including OTHER, which is not recommended) and ErrorState are supported.\nAt boot, supportedEnumValues is equal to the supported values list."
},
{
"name": "Turn signal light state.",
@@ -552,7 +552,7 @@
"VehicleUnit"
],
"data_enum": "VehicleUnit",
- "description": "Speed units for display\nIndicates type of units the car is using to display speed to user. Eg. m\/s, km\/h, or mph.\n{@code VehicleAreaConfig.HasSupportedValueInfo.hasSupportedValuesList} for the global area ID (0) must be {@code true}.\n{@code getSupportedValuesLists} for [VEHICLE_SPEED_DISPLAY_UNITS, areaId=0] must return a {@code SupportedValuesListResult} that contains non-null {@code supportedValuesList}, e.g. [METER_PER_SEC, MILES_PER_HOUR, KILOMETERS_PER_HOUR].\nFor backward compatibility, config array for this property must contain the same values as supported values at boot time. For example: configArray[0] = METER_PER_SEC configArray[1] = MILES_PER_HOUR configArray[2] = KILOMETERS_PER_HOUR\nIf updating VEHICLE_SPEED_DISPLAY_UNITS affects the values of other *_DISPLAY_UNITS properties, then their values must be updated and communicated to the AAOS framework as well.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
+ "description": "Speed units for display\nIndicates type of units the car is using to display speed to user. Eg. m\/s, km\/h, or mph.\nVehiclePropConfig.configArray is used to indicate the supported speed display units. Pressure units are defined in VehicleUnit. For example: configArray[0] = METER_PER_SEC configArray[1] = MILES_PER_HOUR configArray[2] = KILOMETERS_PER_HOUR\nIf {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):\n{@code VehicleAreaConfig.HasSupportedValueInfo.hasSupportedValuesList} for the global area ID (0) must be {@code true}.\n{@code getSupportedValuesLists} for [VEHICLE_SPEED_DISPLAY_UNITS, areaId=0] must return a {@code SupportedValuesListResult} that contains non-null {@code supportedValuesList}, e.g. [METER_PER_SEC, MILES_PER_HOUR, KILOMETERS_PER_HOUR].\nAt boot, the values in the config array are equal to the supported values list.\n\nIf updating VEHICLE_SPEED_DISPLAY_UNITS affects the values of other *_DISPLAY_UNITS properties, then their values must be updated and communicated to the AAOS framework as well.\nThis property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to implement it as VehiclePropertyAccess.READ only."
},
{
"name": "EXTERNAL_CAR_TIME",
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index 43675ff..f8cce1a 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -596,8 +596,33 @@
/**
* Tire pressure
*
+ * Each tire is identified by its areaConfig.areaId config and its minFloatValue/maxFloatValue
+ * are used to store OEM recommended pressure range.
+ *
+ * The minFloatValue and maxFloatValue in VehicleAreaConfig must be defined.
+ *
+ * The minFloatValue in the areaConfig data represents the lower bound of the recommended tire
+ * pressure.
+ *
+ * The maxFloatValue in the areaConfig data represents the upper bound of the recommended tire
+ * pressure.
+ *
+ * For example:
+ *
+ * The following areaConfig indicates the recommended tire pressure
+ * of the left_front tire is from 200.0 KILOPASCAL to 240.0 KILOPASCAL.
+ * .areaConfigs = {
+ * VehicleAreaConfig {
+ * .areaId = VehicleAreaWheel::LEFT_FRONT,
+ * .minFloatValue = 200.0,
+ * .maxFloatValue = 240.0,
+ * }
+ * }
+ *
+ * If {@code HasSupportedValueInfo} for a specific area ID is not {@code null}:
+ *
* {@code HasSupportedValueInfo.hasMinSupportedValue} and
- * {@code HasSupportedValueInfo.hasMaxSupportedValue} must be {@code true} for all areas.
+ * {@code HasSupportedValueInfo.hasMaxSupportedValue} must be {@code true} for the area ID.
*
* {@code MinMaxSupportedValueResult.minSupportedValue} represents the lower bound of the
* recommended tire pressure for the tire at the specified area ID.
@@ -611,19 +636,8 @@
* {@code MinMaxSupportedValueResult} with OK status, 200.0 as minSupportedValue, 240.0 as
* maxSupportedValue.
*
- * For backward compatibility, minFloatValue and maxFloatValue in {@code VehicleAreaConfig}
- * must be set to the same as minSupportedValue and maxSupportedValue at boot time.
- *
- * Each tire is identified by its areaConfig.areaId config.
- *
- * For example:
- * .areaConfigs = {
- * VehicleAreaConfig {
- * .areaId = VehicleAreaWheel::LEFT_FRONT,
- * .minFloatValue = 200.0,
- * .maxFloatValue = 240.0,
- * }
- * },
+ * At boot, minFloatValue is equal to minSupportedValue, maxFloatValue is equal to
+ * maxSupportedValue.
*
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
@@ -766,12 +780,15 @@
* of the vehicle as described through the ImpactSensorLocation enum. As a bit flag property,
* this property can be set to multiple ORed together values of the enum when necessary.
*
- * For the global area ID (0), {@code getSupportedValuesList}
- * must return a {@code SupportedValuesListResult} that contains supported values unless all bit
- * flags of ImpactSensorLocation are supported.
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all bit flags of ImpactSensorLocation are supported.
*
- * For backward compatibility, if {@code SupportedValuesListResult} is defined,
- * {@code VehicleAreaConfig#supportedEnumValues} must be set to the same values.
+ * If {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):
+ *
+ * {@code getSupportedValuesList} must return a {@code SupportedValuesListResult} that contains
+ * supported values unless all bit flags of ImpactSensorLocation are supported.
+ *
+ * At boot, supportedEnumValues is equal to the supported values list.
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
@@ -798,6 +815,17 @@
*
* This is the gear selected by the user.
*
+ * Values in the config array must represent the list of supported gears for this vehicle at
+ * boot time. For example, config array for an automatic transmission must contain
+ * {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_DRIVE, GEAR_1, GEAR_2,...} and for manual
+ * transmission the list must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}
+ *
+ * In the case of an automatic transmission vehicle that allows the driver to select specific
+ * gears on demand (i.e. "manual mode"), GEAR_SELECTION's value must be set to the specific gear
+ * selected by the driver instead of simply GEAR_DRIVE.
+ *
+ * If {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):
+ *
* {@code VehicleAreaConfig.HasSupportedValueInfo.hasSupportedValuesList} for the global area ID
* (0) must be {@code true}.
*
@@ -810,11 +838,10 @@
* GEAR_REVERSE, GEAR_1, GEAR_2,...}.
*
* In the case of an automatic transmission vehicle that allows the driver to select specific
- * gears on demand (i.e. "manual mode"), GEAR_SELECTION's value must be set to the specific gear
- * selected by the driver instead of simply GEAR_DRIVE.
+ * gears on demand (i.e. "manual mode"), the GEAR_SELECTION property value must be set to the
+ * specific gear selected by the driver instead of simply GEAR_DRIVE.
*
- * For backward compatibility, config array for this property must be a list of values
- * same as the supported values at boot-time.
+ * At boot, the config array's values are equal to the supported values list.
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
@@ -831,6 +858,15 @@
* the current gear will be one of GEAR_1, GEAR_2 etc, which reflects
* the actual gear the transmission is currently running in.
*
+ * Values in the config array must represent the list of supported gears
+ * for this vehicle at boot time. For example, config array for an automatic transmission
+ * must contain {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_PARK, GEAR_1, GEAR_2,...}
+ * and for manual transmission the list must contain
+ * {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}. This list need not be the
+ * same as that of the supported gears reported in GEAR_SELECTION.
+ *
+ * If {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):
+ *
* {@code VehicleAreaConfig.HasSupportedValueInfo.hasSupportedValuesList} for the global area ID
* (0) must be {@code true}.
*
@@ -844,8 +880,7 @@
* {GEAR_NEUTRAL, GEAR_REVERSE, GEAR_1, GEAR_2,...}. This list need not be the
* same as that of the supported gears reported in GEAR_SELECTION.
*
- * For backward compatibility, config array for this property must be a list of values
- * same as the supported values at boot-time.
+ * At boot, the config array's values are equal to the supported values list.
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
@@ -889,6 +924,18 @@
/**
* Regenerative braking level of a electronic vehicle
*
+ * The minInt32Value and maxInt32Value in VehicleAreaConfig must be defined. All values between
+ * minInt32Value and maxInt32Value must be supported.
+ *
+ * The minInt32Value indicates the setting for no regenerative braking, must be 0.
+ *
+ * The maxInt32Value indicates the setting for the maximum amount of energy regenerated from
+ * braking.
+ *
+ * All values between min and max supported value must be supported.
+ *
+ * If {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):
+ *
* {@code HasSupportedValueInfo.hasMinSupportedValue} and
* {@code HasSupportedValueInfo.hasMaxSupportedValue} must be {@code true} for global area ID(0)
*
@@ -898,10 +945,9 @@
* amount of energy regenerated from braking. The minSupportedValue indicates the setting for no
* regenerative braking.
*
- * All values between min and max supported value must be supported.
+ * At boot, minInt32Value is equal to minSupportedValue, maxInt32Value is equal to
+ * maxSupportedValue.
*
- * For backward compatibility, minInt32Value and maxInt32Value in {@code VehicleAreaConfig}
- * must be set to the same as minSupportedValue and maxSupportedValue at boot time.
*
* This property is a more granular form of EV_REGENERATIVE_BRAKING_STATE. It allows the user to
* set a more specific level of regenerative braking if the states in EvRegenerativeBrakingState
@@ -1004,12 +1050,17 @@
/**
* Represents property for the current stopping mode of the vehicle.
*
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues must be defined unless
+ * all enum values of EvStoppingMode are supported.
+ *
+ * If {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):
+ *
* For the global area ID (0), {@code getSupportedValuesList}
* must return a {@code SupportedValuesListResult} that contains supported values unless all
* enum values of EvStoppingMode are supported.
*
- * For backward compatibility, if {@code SupportedValuesListResult} is defined,
- * {@code VehicleAreaConfig#supportedEnumValues} must be set to the same values.
+ * At boot, supportedEnumValues is equal to the supported values list.
+ *
*
* The EvStoppingMode enum may be extended to include more states in the future.
*
@@ -1053,13 +1104,18 @@
* ElectronicStabilityControlState or ErrorState. It must not surface errors through StatusCode
* and must use the supported error states instead.
*
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of both ElectronicStabilityControlState (including OTHER, which is not
+ * recommended) and ErrorState are supported.
+ *
+ * If {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):
+ *
* For the global area ID (0), {@code getSupportedValuesList}
* must return a {@code SupportedValuesListResult} that contains supported values unless all
* states of both ElectronicStabilityControlState (including OTHER, which is not
* recommended) and ErrorState are supported.
*
- * For backward compatibility, if {@code SupportedValuesListResult} is defined,
- * {@code VehicleAreaConfig#supportedEnumValues} must be set to the same values.
+ * At boot, supportedEnumValues is equal to the supported values list.
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
@@ -1840,6 +1896,14 @@
*
* Indicates type of units the car is using to display speed to user. Eg. m/s, km/h, or mph.
*
+ * VehiclePropConfig.configArray is used to indicate the supported speed display units.
+ * Pressure units are defined in VehicleUnit.
+ * For example: configArray[0] = METER_PER_SEC
+ * configArray[1] = MILES_PER_HOUR
+ * configArray[2] = KILOMETERS_PER_HOUR
+ *
+ * If {@code HasSupportedValueInfo} is not {@code null} for the global area ID (0):
+ *
* {@code VehicleAreaConfig.HasSupportedValueInfo.hasSupportedValuesList} for the global area ID
* (0) must be {@code true}.
*
@@ -1847,11 +1911,8 @@
* {@code SupportedValuesListResult} that contains non-null {@code supportedValuesList},
* e.g. [METER_PER_SEC, MILES_PER_HOUR, KILOMETERS_PER_HOUR].
*
- * For backward compatibility, config array for this property must contain the same values as
- * supported values at boot time.
- * For example: configArray[0] = METER_PER_SEC
- * configArray[1] = MILES_PER_HOUR
- * configArray[2] = KILOMETERS_PER_HOUR
+ * At boot, the values in the config array are equal to the supported values list.
+ *
*
* If updating VEHICLE_SPEED_DISPLAY_UNITS affects the values of other *_DISPLAY_UNITS
* properties, then their values must be updated and communicated to the AAOS framework as well.
diff --git a/bluetooth/1.0/vts/functional/Android.bp b/bluetooth/1.0/vts/functional/Android.bp
index 7d76b89..e68df09 100644
--- a/bluetooth/1.0/vts/functional/Android.bp
+++ b/bluetooth/1.0/vts/functional/Android.bp
@@ -30,7 +30,6 @@
srcs: ["VtsHalBluetoothV1_0TargetTest.cpp"],
static_libs: [
"android.hardware.bluetooth@1.0",
- "libbluetooth-types",
],
test_config: "VtsHalBluetoothV1_0TargetTest.xml",
test_suites: [
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
index 82dda61..d0edfad 100644
--- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
+++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
@@ -20,7 +20,6 @@
#include <android/hardware/bluetooth/1.0/IBluetoothHci.h>
#include <android/hardware/bluetooth/1.0/IBluetoothHciCallbacks.h>
#include <android/hardware/bluetooth/1.0/types.h>
-#include <hardware/bluetooth.h>
#include <utils/Log.h>
#include <VtsHalHidlTargetCallbackBase.h>
diff --git a/bluetooth/1.1/vts/functional/Android.bp b/bluetooth/1.1/vts/functional/Android.bp
index 6b3a3e7..27d50f5 100644
--- a/bluetooth/1.1/vts/functional/Android.bp
+++ b/bluetooth/1.1/vts/functional/Android.bp
@@ -31,7 +31,6 @@
static_libs: [
"android.hardware.bluetooth@1.1",
"android.hardware.bluetooth@1.0",
- "libbluetooth-types",
],
test_config: "VtsHalBluetoothV1_1TargetTest.xml",
test_suites: ["general-tests", "vts"],
diff --git a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
index 687765f..37b41c6 100644
--- a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
+++ b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
@@ -20,7 +20,6 @@
#include <android/hardware/bluetooth/1.0/types.h>
#include <android/hardware/bluetooth/1.1/IBluetoothHci.h>
#include <android/hardware/bluetooth/1.1/IBluetoothHciCallbacks.h>
-#include <hardware/bluetooth.h>
#include <utils/Log.h>
#include <VtsHalHidlTargetCallbackBase.h>
diff --git a/bluetooth/finder/aidl/vts/Android.bp b/bluetooth/finder/aidl/vts/Android.bp
index 49d2d45..29a0c0f 100644
--- a/bluetooth/finder/aidl/vts/Android.bp
+++ b/bluetooth/finder/aidl/vts/Android.bp
@@ -32,7 +32,6 @@
],
static_libs: [
"android.hardware.bluetooth.finder-V1-ndk",
- "libbluetooth-types",
],
test_config: "VtsHalBluetoothFinderTargetTest.xml",
test_suites: [
diff --git a/bluetooth/ranging/aidl/vts/Android.bp b/bluetooth/ranging/aidl/vts/Android.bp
index bcae5d0..7f6ceff 100644
--- a/bluetooth/ranging/aidl/vts/Android.bp
+++ b/bluetooth/ranging/aidl/vts/Android.bp
@@ -18,7 +18,6 @@
],
static_libs: [
"android.hardware.bluetooth.ranging-V2-ndk",
- "libbluetooth-types",
],
test_config: "VtsHalBluetoothRangingTargetTest.xml",
test_suites: [
diff --git a/bluetooth/socket/aidl/vts/Android.bp b/bluetooth/socket/aidl/vts/Android.bp
index 174dd4b..c1ba562 100644
--- a/bluetooth/socket/aidl/vts/Android.bp
+++ b/bluetooth/socket/aidl/vts/Android.bp
@@ -19,7 +19,6 @@
static_libs: [
"android.hardware.bluetooth.socket-V1-ndk",
"android.hardware.contexthub-V4-ndk",
- "libbluetooth-types",
],
test_suites: [
"general-tests",
diff --git a/camera/provider/aidl/vts/device_cb.cpp b/camera/provider/aidl/vts/device_cb.cpp
index bfd1cd1..940b4af 100644
--- a/camera/provider/aidl/vts/device_cb.cpp
+++ b/camera/provider/aidl/vts/device_cb.cpp
@@ -421,12 +421,19 @@
}
for (const auto& buffer : results.outputBuffers) {
+ std::unique_lock<std::mutex> l(mLock);
CameraAidlTest::InFlightRequest::StreamBufferAndTimestamp streamBufferAndTimestamp;
- auto outstandingBuffers = mUseHalBufManager ? mOutstandingBufferIds :
+ auto& outstandingBuffers = mUseHalBufManager ? mOutstandingBufferIds :
request->mOutstandingBufferIds;
auto bufferId = mUseHalBufManager ? buffer.bufferId : results.frameNumber;
- auto outputBuffer = outstandingBuffers.empty() ? ::android::makeFromAidl(buffer.buffer) :
- outstandingBuffers[buffer.streamId][bufferId];
+ const native_handle_t *outputBuffer = nullptr;
+ if (outstandingBuffers.empty()) {
+ outputBuffer = ::android::makeFromAidl(buffer.buffer);
+ } else if (outstandingBuffers[buffer.streamId].contains(bufferId)) {
+ outputBuffer = outstandingBuffers[buffer.streamId][bufferId];
+ } else {
+ ALOGV("%s: Invalid bufferId: %" PRId64, __FUNCTION__, bufferId);
+ }
streamBufferAndTimestamp.buffer = {buffer.streamId,
bufferId,
outputBuffer,
diff --git a/gnss/aidl/default/GnssDebug.cpp b/gnss/aidl/default/GnssDebug.cpp
index 5ae6edd..185bfe4 100644
--- a/gnss/aidl/default/GnssDebug.cpp
+++ b/gnss/aidl/default/GnssDebug.cpp
@@ -126,9 +126,46 @@
.ephemerisAgeSeconds = 12,
.serverPredictionIsAvailable = true,
.serverPredictionAgeSeconds = 30};
+ SatelliteData satelliteData10 = {
+ .svid = 2,
+ .constellation = GnssConstellationType::GALILEO,
+ .ephemerisType = SatelliteEphemerisType::EPHEMERIS,
+ .ephemerisSource = SatellitePvt::SatelliteEphemerisSource::SERVER_LONG_TERM,
+ .ephemerisHealth = SatelliteEphemerisHealth::GOOD,
+ .ephemerisAgeSeconds = 12,
+ .serverPredictionIsAvailable = true,
+ .serverPredictionAgeSeconds = 30};
+ SatelliteData satelliteData11 = {
+ .svid = 4,
+ .constellation = GnssConstellationType::GALILEO,
+ .ephemerisType = SatelliteEphemerisType::EPHEMERIS,
+ .ephemerisSource = SatellitePvt::SatelliteEphemerisSource::SERVER_LONG_TERM,
+ .ephemerisHealth = SatelliteEphemerisHealth::GOOD,
+ .ephemerisAgeSeconds = 12,
+ .serverPredictionIsAvailable = true,
+ .serverPredictionAgeSeconds = 30};
+ SatelliteData satelliteData12 = {
+ .svid = 10,
+ .constellation = GnssConstellationType::GALILEO,
+ .ephemerisType = SatelliteEphemerisType::EPHEMERIS,
+ .ephemerisSource = SatellitePvt::SatelliteEphemerisSource::SERVER_LONG_TERM,
+ .ephemerisHealth = SatelliteEphemerisHealth::GOOD,
+ .ephemerisAgeSeconds = 12,
+ .serverPredictionIsAvailable = true,
+ .serverPredictionAgeSeconds = 30};
+ SatelliteData satelliteData13 = {
+ .svid = 29,
+ .constellation = GnssConstellationType::GALILEO,
+ .ephemerisType = SatelliteEphemerisType::EPHEMERIS,
+ .ephemerisSource = SatellitePvt::SatelliteEphemerisSource::SERVER_LONG_TERM,
+ .ephemerisHealth = SatelliteEphemerisHealth::GOOD,
+ .ephemerisAgeSeconds = 12,
+ .serverPredictionIsAvailable = true,
+ .serverPredictionAgeSeconds = 30};
std::vector<SatelliteData> satelliteDataArrayDebug = {
- satelliteData1, satelliteData2, satelliteData3, satelliteData4, satelliteData5,
- satelliteData6, satelliteData7, satelliteData8, satelliteData9};
+ satelliteData1, satelliteData2, satelliteData3, satelliteData4, satelliteData5,
+ satelliteData6, satelliteData7, satelliteData8, satelliteData9, satelliteData10,
+ satelliteData11, satelliteData12, satelliteData13};
debugData->position = positionDebug;
debugData->time = timeDebug;
debugData->satelliteDataArray = satelliteDataArrayDebug;
diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp
index 0dd8b32..f7deb29 100644
--- a/gnss/aidl/vts/gnss_hal_test.cpp
+++ b/gnss/aidl/vts/gnss_hal_test.cpp
@@ -276,35 +276,43 @@
}
/*
- * FindStrongFrequentBlockableSource:
+ * FindStrongFrequentSource:
*
- * Search through a GnssSvStatus list for the strongest blockable satellite observed enough times
+ * Search through a GnssSvStatus list for the strongest satellite observed enough times per
+ * constellation
*
- * returns the strongest source,
- * or a source with constellation == UNKNOWN if none are found sufficient times
+ * returns the strongest sources for each constellation,
+ * or an empty vector if none are found sufficient times
*/
-BlocklistedSource GnssHalTest::FindStrongFrequentBlockableSource(
+std::vector<BlocklistedSource> GnssHalTest::FindStrongFrequentSources(
const std::list<hidl_vec<IGnssCallback_2_1::GnssSvInfo>> sv_info_list,
const int min_observations) {
- return FindStrongFrequentBlockableSource(convertToAidl(sv_info_list), min_observations);
+ return FindStrongFrequentSources(convertToAidl(sv_info_list), min_observations);
}
-BlocklistedSource GnssHalTest::FindStrongFrequentBlockableSource(
+bool GnssHalTest::isBlockableConstellation(const GnssConstellationType constellation,
+ const bool isCnBuild) {
+ if (constellation == GnssConstellationType::GPS) {
+ return false;
+ }
+ if (isCnBuild && (constellation == GnssConstellationType::BEIDOU)) {
+ // Do not blocklist BDS on CN builds
+ return false;
+ }
+ return true;
+}
+
+std::vector<BlocklistedSource> GnssHalTest::FindStrongFrequentSources(
const std::list<std::vector<IGnssCallback::GnssSvInfo>> sv_info_list,
const int min_observations) {
- std::map<ComparableBlocklistedSource, SignalCounts> mapSignals;
+ ALOGD("Find strongest sv from %d sv_info_list with %d min_observations.",
+ (int)sv_info_list.size(), min_observations);
- bool isCnBuild = Utils::isCnBuild();
- ALOGD("isCnBuild: %s", isCnBuild ? "true" : "false");
+ std::map<ComparableBlocklistedSource, SignalCounts> mapSignals;
for (const auto& sv_info_vec : sv_info_list) {
for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) {
const auto& gnss_sv = sv_info_vec[iSv];
- if ((gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX) &&
- (gnss_sv.constellation != GnssConstellationType::GPS)) {
- if (isCnBuild && (gnss_sv.constellation == GnssConstellationType::BEIDOU)) {
- // Do not blocklist BDS on CN builds
- continue;
- }
+ if (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX) {
ComparableBlocklistedSource source;
source.id.svid = gnss_sv.svid;
source.id.constellation = gnss_sv.constellation;
@@ -326,27 +334,76 @@
}
}
- float max_cn0_dbhz_with_sufficient_count = 0.;
- int total_observation_count = 0;
- int blocklisted_source_count_observation = 0;
+ // the Cn0 of the strongest SV per constellation
+ std::unordered_map<GnssConstellationType, float> max_cn0_map;
+ // # of total observations of all signals per constellation
+ std::unordered_map<GnssConstellationType, int> total_observation_count_map;
+ // # of observations of the strongest sv per constellation
+ std::unordered_map<GnssConstellationType, int> source_observation_count_map;
+ // the source to blocklist per constellation
+ std::unordered_map<GnssConstellationType, ComparableBlocklistedSource> source_map;
+ // # of signals per constellation
+ std::unordered_map<GnssConstellationType, int> signal_count_map;
- ComparableBlocklistedSource source_to_blocklist; // initializes to zero = UNKNOWN constellation
for (auto const& pairSignal : mapSignals) {
- total_observation_count += pairSignal.second.observations;
- if ((pairSignal.second.observations >= min_observations) &&
- (pairSignal.second.max_cn0_dbhz > max_cn0_dbhz_with_sufficient_count)) {
- source_to_blocklist = pairSignal.first;
- blocklisted_source_count_observation = pairSignal.second.observations;
- max_cn0_dbhz_with_sufficient_count = pairSignal.second.max_cn0_dbhz;
+ ComparableBlocklistedSource source = pairSignal.first;
+ total_observation_count_map[source.id.constellation] += pairSignal.second.observations;
+ signal_count_map[source.id.constellation]++;
+ if (pairSignal.second.observations < min_observations) {
+ continue;
+ }
+ if (pairSignal.second.max_cn0_dbhz > max_cn0_map[source.id.constellation]) {
+ source_map[source.id.constellation] = pairSignal.first;
+ source_observation_count_map[source.id.constellation] = pairSignal.second.observations;
+ max_cn0_map[source.id.constellation] = pairSignal.second.max_cn0_dbhz;
}
}
- ALOGD("Among %d observations, chose svid %d, constellation %d, "
- "with %d observations at %.1f max CNo",
- total_observation_count, source_to_blocklist.id.svid,
- (int)source_to_blocklist.id.constellation, blocklisted_source_count_observation,
- max_cn0_dbhz_with_sufficient_count);
- return source_to_blocklist.id;
+ std::vector<BlocklistedSource> sources;
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 4) {
+ /* For AIDL version <= 4 (launched-in-15 or earlier), only blocklist 1 sv */
+ float max_cn0 = 0;
+ ComparableBlocklistedSource source_to_blocklist;
+ for (auto const& pair : source_map) {
+ GnssConstellationType constellation = pair.first;
+ ComparableBlocklistedSource source = pair.second;
+ if (max_cn0_map[constellation] > max_cn0) {
+ max_cn0 = max_cn0_map[constellation];
+ source_to_blocklist = source;
+ }
+ }
+ if (source_to_blocklist.id.constellation != GnssConstellationType::UNKNOWN) {
+ ALOGD("In constellation %d, among %d observed SVs, svid %d is chosen to blocklist. "
+ "It has %d observations with max Cn0: %.1f among %d total observations of this "
+ "constellation.",
+ (int)source_to_blocklist.id.constellation,
+ signal_count_map[source_to_blocklist.id.constellation],
+ source_to_blocklist.id.svid,
+ source_observation_count_map[source_to_blocklist.id.constellation], max_cn0,
+ total_observation_count_map[source_to_blocklist.id.constellation]);
+ sources.push_back(source_to_blocklist.id);
+ }
+ } else {
+ /* For AIDL version >= 5 (launched-in-16 or later), blocklist 1 sv per constellation */
+ for (auto const& pair : source_map) {
+ ComparableBlocklistedSource source = pair.second;
+ if (signal_count_map[source.id.constellation] < 4) {
+ // Skip the constellation with a small number of signals
+ // 4 is arbitrarily chosen to avoid affecting constellations with a limited coverage
+ continue;
+ }
+ ALOGD("In constellation %d, among %d observed SVs, svid %d is chosen to blocklist. "
+ "It has %d observations with max Cn0: %.1f among %d total observations of this "
+ "constellation.",
+ (int)source.id.constellation, signal_count_map[source.id.constellation],
+ source.id.svid, source_observation_count_map[source.id.constellation],
+ max_cn0_map[source.id.constellation],
+ total_observation_count_map[source.id.constellation]);
+ sources.push_back(source.id);
+ }
+ }
+
+ return sources;
}
GnssConstellationType GnssHalTest::startLocationAndGetBlockableConstellation(
diff --git a/gnss/aidl/vts/gnss_hal_test.h b/gnss/aidl/vts/gnss_hal_test.h
index dec5856..c41620a 100644
--- a/gnss/aidl/vts/gnss_hal_test.h
+++ b/gnss/aidl/vts/gnss_hal_test.h
@@ -81,14 +81,17 @@
std::list<std::vector<android::hardware::gnss::IGnssCallback::GnssSvInfo>> convertToAidl(
const std::list<hidl_vec<android::hardware::gnss::V2_1::IGnssCallback::GnssSvInfo>>&
sv_info_list);
- android::hardware::gnss::BlocklistedSource FindStrongFrequentBlockableSource(
+ std::vector<android::hardware::gnss::BlocklistedSource> FindStrongFrequentSources(
const std::list<hidl_vec<android::hardware::gnss::V2_1::IGnssCallback::GnssSvInfo>>
sv_info_list,
const int min_observations);
- android::hardware::gnss::BlocklistedSource FindStrongFrequentBlockableSource(
+ std::vector<android::hardware::gnss::BlocklistedSource> FindStrongFrequentSources(
const std::list<std::vector<android::hardware::gnss::IGnssCallback::GnssSvInfo>>
sv_info_list,
const int min_observations);
+ bool isBlockableConstellation(
+ const android::hardware::gnss::GnssConstellationType constellation,
+ const bool isCnBuild);
void checkGnssMeasurementClockFields(const android::hardware::gnss::GnssData& measurement);
void checkGnssMeasurementFlags(const android::hardware::gnss::GnssMeasurement& measurement);
diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp
index a2e81d1..781476fd 100644
--- a/gnss/aidl/vts/gnss_hal_test_cases.cpp
+++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp
@@ -615,7 +615,7 @@
* BlocklistIndividualSatellites:
*
* 1) Turns on location, waits for 3 locations, ensuring they are valid, and checks corresponding
- * GnssStatus for common satellites (strongest and one other.)
+ * GnssStatus for common satellites (strongest one in each constellation.)
* 2a & b) Turns off location, and blocklists common satellites.
* 3) Restart location, wait for 3 locations, ensuring they are valid, and checks corresponding
* GnssStatus does not use those satellites.
@@ -633,6 +633,7 @@
return;
}
+ const int kWarmUpLocations = 3;
const int kLocationsToAwait = 3;
const int kRetriesToUnBlocklist = 10;
@@ -641,7 +642,7 @@
} else {
aidl_gnss_cb_->location_cbq_.reset();
}
- StartAndCheckLocations(kLocationsToAwait);
+ StartAndCheckLocations(kLocationsToAwait + kWarmUpLocations);
int location_called_count = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->location_cbq_.calledCount()
: aidl_gnss_cb_->location_cbq_.calledCount();
@@ -650,37 +651,50 @@
int sv_info_list_cbq_size = (aidl_gnss_hal_->getInterfaceVersion() <= 1)
? gnss_cb_->sv_info_list_cbq_.size()
: aidl_gnss_cb_->sv_info_list_cbq_.size();
- EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait);
+ EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait + kWarmUpLocations);
ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations (%d received)",
- sv_info_list_cbq_size, kLocationsToAwait, location_called_count);
+ sv_info_list_cbq_size, kLocationsToAwait + kWarmUpLocations, location_called_count);
/*
- * Identify strongest SV seen at least kLocationsToAwait -1 times
- * Why -1? To avoid test flakiness in case of (plausible) slight flakiness in strongest signal
- * observability (one epoch RF null)
+ * Identify strongest SV per constellation seen seen at least kLocationsToAwait -1 times.
+ *
+ * Why not (kLocationsToAwait + kWarmUpLocations)? To avoid test flakiness in case of
+ * (plausible) slight flakiness in strongest signal observability (one epoch RF null)
*/
const int kGnssSvInfoListTimeout = 2;
- BlocklistedSource source_to_blocklist;
+ std::vector<BlocklistedSource> sources_to_blocklist;
if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
+ // Discard kWarmUpLocations sv_info_vec
+ std::list<hidl_vec<IGnssCallback_2_1::GnssSvInfo>> tmp;
+ int count =
+ gnss_cb_->sv_info_list_cbq_.retrieve(tmp, kWarmUpLocations, kGnssSvInfoListTimeout);
+ ASSERT_EQ(count, kWarmUpLocations);
+
+ // Retrieve (sv_info_list_cbq_size - kWarmUpLocations) sv_info_vec
std::list<hidl_vec<IGnssCallback_2_1::GnssSvInfo>> sv_info_vec_list;
- int count = gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec_list, sv_info_list_cbq_size,
- kGnssSvInfoListTimeout);
- ASSERT_EQ(count, sv_info_list_cbq_size);
- source_to_blocklist =
- FindStrongFrequentBlockableSource(sv_info_vec_list, kLocationsToAwait - 1);
+ count = gnss_cb_->sv_info_list_cbq_.retrieve(
+ sv_info_vec_list, sv_info_list_cbq_size - kWarmUpLocations, kGnssSvInfoListTimeout);
+ ASSERT_EQ(count, sv_info_list_cbq_size - kWarmUpLocations);
+ sources_to_blocklist = FindStrongFrequentSources(sv_info_vec_list, kLocationsToAwait - 1);
} else {
+ // Discard kWarmUpLocations sv_info_vec
+ std::list<std::vector<IGnssCallback::GnssSvInfo>> tmp;
+ int count = aidl_gnss_cb_->sv_info_list_cbq_.retrieve(tmp, kWarmUpLocations,
+ kGnssSvInfoListTimeout);
+ ASSERT_EQ(count, kWarmUpLocations);
+
+ // Retrieve (sv_info_list_cbq_size - kWarmUpLocations) sv_info_vec
std::list<std::vector<IGnssCallback::GnssSvInfo>> sv_info_vec_list;
- int count = aidl_gnss_cb_->sv_info_list_cbq_.retrieve(
- sv_info_vec_list, sv_info_list_cbq_size, kGnssSvInfoListTimeout);
- ASSERT_EQ(count, sv_info_list_cbq_size);
- source_to_blocklist =
- FindStrongFrequentBlockableSource(sv_info_vec_list, kLocationsToAwait - 1);
+ count = aidl_gnss_cb_->sv_info_list_cbq_.retrieve(
+ sv_info_vec_list, sv_info_list_cbq_size - kWarmUpLocations, kGnssSvInfoListTimeout);
+ ASSERT_EQ(count, sv_info_list_cbq_size - kWarmUpLocations);
+ sources_to_blocklist = FindStrongFrequentSources(sv_info_vec_list, kLocationsToAwait - 1);
}
- if (source_to_blocklist.constellation == GnssConstellationType::UNKNOWN) {
- // Cannot find a blockable satellite. Let the test pass.
- ALOGD("Cannot find a blockable satellite. Letting the test pass.");
+ if (sources_to_blocklist.empty()) {
+ // Cannot find a satellite to blocklist. Let the test pass.
+ ALOGD("Cannot find a satellite to blocklist. Letting the test pass.");
return;
}
@@ -693,9 +707,7 @@
ASSERT_NE(gnss_configuration_hal, nullptr);
std::vector<BlocklistedSource> sources;
- sources.resize(1);
- sources[0] = source_to_blocklist;
-
+ sources = sources_to_blocklist;
status = gnss_configuration_hal->setBlocklist(sources);
ASSERT_TRUE(status.isOk());
@@ -726,26 +738,47 @@
EXPECT_GE(sv_info_list_cbq_size + 1, kLocationsToAwait);
ALOGD("Observed %d GnssSvInfo, while awaiting %d Locations (%d received)",
sv_info_list_cbq_size, kLocationsToAwait, location_called_count);
+ bool isCnBuild = Utils::isCnBuild();
for (int i = 0; i < sv_info_list_cbq_size; ++i) {
if (aidl_gnss_hal_->getInterfaceVersion() <= 1) {
hidl_vec<IGnssCallback_2_1::GnssSvInfo> sv_info_vec;
gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout);
for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) {
auto& gnss_sv = sv_info_vec[iSv];
- EXPECT_FALSE(
- (gnss_sv.v2_0.v1_0.svid == source_to_blocklist.svid) &&
- (static_cast<GnssConstellationType>(gnss_sv.v2_0.constellation) ==
- source_to_blocklist.constellation) &&
- (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX));
+ if (!(gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)) {
+ continue;
+ }
+ for (auto const& source : sources_to_blocklist) {
+ if (isBlockableConstellation(source.constellation, isCnBuild)) {
+ EXPECT_FALSE((gnss_sv.v2_0.v1_0.svid == source.svid) &&
+ (static_cast<GnssConstellationType>(
+ gnss_sv.v2_0.constellation) == source.constellation));
+ } else if ((gnss_sv.v2_0.v1_0.svid == source.svid) &&
+ (static_cast<GnssConstellationType>(gnss_sv.v2_0.constellation) ==
+ source.constellation)) {
+ ALOGW("Found constellation %d, svid %d blocklisted but still used-in-fix.",
+ source.constellation, source.svid);
+ }
+ }
}
} else {
std::vector<IGnssCallback::GnssSvInfo> sv_info_vec;
aidl_gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout);
for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) {
auto& gnss_sv = sv_info_vec[iSv];
- EXPECT_FALSE((gnss_sv.svid == source_to_blocklist.svid) &&
- (gnss_sv.constellation == source_to_blocklist.constellation) &&
- (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX));
+ if (!(gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX)) {
+ continue;
+ }
+ for (auto const& source : sources_to_blocklist) {
+ if (isBlockableConstellation(source.constellation, isCnBuild)) {
+ EXPECT_FALSE((gnss_sv.svid == source.svid) &&
+ (gnss_sv.constellation == source.constellation));
+ } else if ((gnss_sv.svid == source.svid) &&
+ (gnss_sv.constellation == source.constellation)) {
+ ALOGW("Found constellation %d, svid %d blocklisted but still used-in-fix.",
+ gnss_sv.constellation, gnss_sv.svid);
+ }
+ }
}
}
}
@@ -795,12 +828,15 @@
gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout);
for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) {
auto& gnss_sv = sv_info_vec[iSv];
- if ((gnss_sv.v2_0.v1_0.svid == source_to_blocklist.svid) &&
- (static_cast<GnssConstellationType>(gnss_sv.v2_0.constellation) ==
- source_to_blocklist.constellation) &&
- (gnss_sv.v2_0.v1_0.svFlag & IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)) {
- strongest_sv_is_reobserved = true;
- break;
+ for (auto const& source : sources_to_blocklist) {
+ if ((gnss_sv.v2_0.v1_0.svid == source.svid) &&
+ (static_cast<GnssConstellationType>(gnss_sv.v2_0.constellation) ==
+ source.constellation) &&
+ (gnss_sv.v2_0.v1_0.svFlag &
+ IGnssCallback_1_0::GnssSvFlags::USED_IN_FIX)) {
+ strongest_sv_is_reobserved = true;
+ break;
+ }
}
}
} else {
@@ -808,11 +844,13 @@
aidl_gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec, kGnssSvInfoListTimeout);
for (uint32_t iSv = 0; iSv < sv_info_vec.size(); iSv++) {
auto& gnss_sv = sv_info_vec[iSv];
- if ((gnss_sv.svid == source_to_blocklist.svid) &&
- (gnss_sv.constellation == source_to_blocklist.constellation) &&
- (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX)) {
- strongest_sv_is_reobserved = true;
- break;
+ for (auto const& source : sources_to_blocklist) {
+ if ((gnss_sv.svid == source.svid) &&
+ (gnss_sv.constellation == source.constellation) &&
+ (gnss_sv.svFlag & (int)IGnssCallback::GnssSvFlags::USED_IN_FIX)) {
+ strongest_sv_is_reobserved = true;
+ break;
+ }
}
}
}
diff --git a/gnss/common/utils/default/Utils.cpp b/gnss/common/utils/default/Utils.cpp
index 8303d93..740bc59 100644
--- a/gnss/common/utils/default/Utils.cpp
+++ b/gnss/common/utils/default/Utils.cpp
@@ -338,16 +338,25 @@
std::vector<GnssSvInfo> Utils::getMockSvInfoList() {
std::vector<GnssSvInfo> gnssSvInfoList = {
+ // svid in [1, 32] for GPS
getMockSvInfo(3, GnssConstellationType::GPS, 32.5, 27.5, 59.1, 166.5, kGpsL1FreqHz),
getMockSvInfo(5, GnssConstellationType::GPS, 27.0, 22.0, 29.0, 56.5, kGpsL1FreqHz),
getMockSvInfo(17, GnssConstellationType::GPS, 30.5, 25.5, 71.0, 77.0, kGpsL5FreqHz),
getMockSvInfo(26, GnssConstellationType::GPS, 24.1, 19.1, 28.0, 253.0, kGpsL5FreqHz),
+ // svid in [1, 36] for GAL
+ getMockSvInfo(2, GnssConstellationType::GALILEO, 33.5, 27.5, 59.1, 166.5, kGalE1FreqHz),
+ getMockSvInfo(4, GnssConstellationType::GALILEO, 28.0, 22.0, 29.0, 56.5, kGalE1FreqHz),
+ getMockSvInfo(10, GnssConstellationType::GALILEO, 35.5, 25.5, 71.0, 77.0, kGalE1FreqHz),
+ getMockSvInfo(29, GnssConstellationType::GALILEO, 34.1, 19.1, 28.0, 253.0,
+ kGalE1FreqHz),
+ // "1 <= svid <= 25 || 93 <= svid <= 106" for GLO
getMockSvInfo(5, GnssConstellationType::GLONASS, 20.5, 15.5, 11.5, 116.0, kGloG1FreqHz),
getMockSvInfo(17, GnssConstellationType::GLONASS, 21.5, 16.5, 28.5, 186.0,
kGloG1FreqHz),
getMockSvInfo(18, GnssConstellationType::GLONASS, 28.3, 25.3, 38.8, 69.0, kGloG1FreqHz),
getMockSvInfo(10, GnssConstellationType::GLONASS, 25.0, 20.0, 66.0, 247.0,
kGloG1FreqHz),
+ // "1 <= X <= 14" for IRNSS
getMockSvInfo(3, GnssConstellationType::IRNSS, 22.0, 19.7, 35.0, 112.0, kIrnssL5FreqHz),
};
return gnssSvInfoList;
diff --git a/gnss/common/utils/default/include/Constants.h b/gnss/common/utils/default/include/Constants.h
index 489413e..e6605c4 100644
--- a/gnss/common/utils/default/include/Constants.h
+++ b/gnss/common/utils/default/include/Constants.h
@@ -31,6 +31,7 @@
const int64_t kMockTimestamp = 1519930775453L;
const float kGpsL1FreqHz = 1575.42 * 1e6;
const float kGpsL5FreqHz = 1176.45 * 1e6;
+const float kGalE1FreqHz = 1575.42 * 1e6;
const float kGloG1FreqHz = 1602.0 * 1e6;
const float kIrnssL5FreqHz = 1176.45 * 1e6;
diff --git a/security/keymint/support/include/remote_prov/remote_prov_utils.h b/security/keymint/support/include/remote_prov/remote_prov_utils.h
index cfc31b3..4e0ce29 100644
--- a/security/keymint/support/include/remote_prov/remote_prov_utils.h
+++ b/security/keymint/support/include/remote_prov/remote_prov_utils.h
@@ -227,6 +227,10 @@
*/
ErrMsgOr<bool> verifyComponentNameInKeyMintDiceChain(const std::vector<uint8_t>& csr);
+/** Checks whether the DICE chain in the CSR has a certificate with a non-normal mode. */
+ErrMsgOr<bool> hasNonNormalModeInDiceChain(const std::vector<uint8_t>& csr,
+ std::string_view instanceName);
+
/** Verify the DICE chain. */
ErrMsgOr<std::vector<BccEntryData>> validateBcc(const cppbor::Array* bcc,
hwtrust::DiceChain::Kind kind, bool allowAnyMode,
diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp
index 0f7cda6..eaeec32 100644
--- a/security/keymint/support/remote_prov_utils.cpp
+++ b/security/keymint/support/remote_prov_utils.cpp
@@ -970,4 +970,30 @@
return *satisfied;
}
+ErrMsgOr<bool> hasNonNormalModeInDiceChain(const std::vector<uint8_t>& encodedCsr,
+ std::string_view instanceName) {
+ auto diceChainKind = getDiceChainKind();
+ if (!diceChainKind) {
+ return diceChainKind.message();
+ }
+
+ auto csr = hwtrust::Csr::validate(encodedCsr, *diceChainKind, false /*isFactory*/,
+ true /*allowAnyMode*/, deviceSuffix(instanceName));
+ if (!csr.ok()) {
+ return csr.error().message();
+ }
+
+ auto diceChain = csr->getDiceChain();
+ if (!diceChain.ok()) {
+ return diceChain.error().message();
+ }
+
+ auto hasNonNormalModeInDiceChain = diceChain->hasNonNormalMode();
+ if (!hasNonNormalModeInDiceChain.ok()) {
+ return hasNonNormalModeInDiceChain.error().message();
+ }
+
+ return *hasNonNormalModeInDiceChain;
+}
+
} // namespace aidl::android::hardware::security::keymint::remote_prov
diff --git a/security/keymint/support/remote_prov_utils_test.cpp b/security/keymint/support/remote_prov_utils_test.cpp
index 8e3600c..d86a678 100644
--- a/security/keymint/support/remote_prov_utils_test.cpp
+++ b/security/keymint/support/remote_prov_utils_test.cpp
@@ -484,6 +484,81 @@
0x30, 0x35, 0x2e, 0x34, 0x32, 0x3a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x6c, 0x65,
0x61, 0x73, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x73};
+inline std::vector<uint8_t> kCsrWithDebugMode{
+ 0x85, 0x01, 0xa0, 0x82, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x03,
+ 0x09, 0xad, 0x0d, 0x07, 0xec, 0x59, 0xfc, 0x14, 0x31, 0x21, 0x1f, 0xbc, 0x8e, 0x44, 0xe7,
+ 0x0f, 0xa9, 0xb7, 0x5a, 0x57, 0x38, 0x5f, 0x76, 0x8a, 0xa3, 0x38, 0x2c, 0xf0, 0x1b, 0x37,
+ 0x15, 0x22, 0x58, 0x20, 0x82, 0xae, 0x09, 0x76, 0x9c, 0x1d, 0x18, 0x39, 0x5d, 0x09, 0xf8,
+ 0x19, 0x86, 0x70, 0x60, 0x12, 0x1e, 0x06, 0xb3, 0x68, 0x4a, 0x27, 0x2c, 0x79, 0xd3, 0x83,
+ 0xb8, 0x54, 0x5b, 0x9f, 0xc0, 0x9f, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x01, 0x04,
+ 0xa9, 0x01, 0x66, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44, 0x50, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47,
+ 0x44, 0x52, 0x58, 0x20, 0xb8, 0x96, 0x54, 0xe2, 0x2c, 0xa4, 0xd2, 0x4a, 0x9c, 0x0e, 0x45,
+ 0x11, 0xc8, 0xf2, 0x63, 0xf0, 0x66, 0x0d, 0x2e, 0x20, 0x48, 0x96, 0x90, 0x14, 0xf4, 0x54,
+ 0x63, 0xc4, 0xf4, 0x39, 0x30, 0x38, 0x3a, 0x00, 0x47, 0x44, 0x53, 0x55, 0xa1, 0x3a, 0x00,
+ 0x01, 0x11, 0x71, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3a, 0x00, 0x47, 0x44, 0x54, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47,
+ 0x44, 0x56, 0x41, 0x02, 0x3a, 0x00, 0x47, 0x44, 0x57, 0x58, 0x4d, 0xa5, 0x01, 0x02, 0x03,
+ 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x5f, 0xcf, 0x63, 0xcc, 0x24, 0x16, 0x66, 0x11, 0x6c,
+ 0xaf, 0xed, 0xf4, 0x02, 0x8f, 0xc9, 0x14, 0xc7, 0x32, 0xa5, 0xdb, 0x41, 0x53, 0x54, 0x34,
+ 0xcf, 0xcd, 0x6b, 0x4c, 0xb2, 0x22, 0x89, 0x96, 0x22, 0x58, 0x20, 0x4c, 0xed, 0xe3, 0x92,
+ 0x94, 0x8f, 0x04, 0xd6, 0x04, 0x3a, 0x6c, 0x15, 0x5f, 0xbb, 0x52, 0x4a, 0x7d, 0x94, 0xcf,
+ 0x31, 0x49, 0x31, 0x28, 0x66, 0x38, 0xe2, 0x40, 0x3e, 0xd0, 0xc1, 0x2b, 0xf4, 0x3a, 0x00,
+ 0x47, 0x44, 0x58, 0x41, 0x20, 0x58, 0x40, 0xb6, 0x0b, 0xa7, 0x9c, 0x02, 0x6d, 0x64, 0x98,
+ 0x9d, 0x73, 0x1b, 0x74, 0x21, 0x32, 0xf6, 0xb6, 0x1e, 0x6d, 0x07, 0x56, 0x0f, 0x5f, 0x14,
+ 0x60, 0xf9, 0x68, 0xb5, 0xee, 0xa5, 0xf9, 0x9b, 0xa9, 0x88, 0x4c, 0x55, 0x75, 0x26, 0xa7,
+ 0x84, 0xee, 0x07, 0x8a, 0xdc, 0xeb, 0x6d, 0xfe, 0x53, 0xe4, 0x38, 0xa8, 0x11, 0x1f, 0x57,
+ 0xbe, 0x77, 0x51, 0xc7, 0xbe, 0x4b, 0xd5, 0x2f, 0x9c, 0x2a, 0xcd, 0x84, 0x43, 0xa1, 0x01,
+ 0x26, 0xa0, 0x59, 0x02, 0x0f, 0x82, 0x58, 0x20, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+ 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x59, 0x01, 0xe9, 0x84, 0x03,
+ 0x67, 0x6b, 0x65, 0x79, 0x6d, 0x69, 0x6e, 0x74, 0xae, 0x65, 0x62, 0x72, 0x61, 0x6e, 0x64,
+ 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x65, 0x66, 0x75, 0x73, 0x65, 0x64, 0x01, 0x65,
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x66, 0x64, 0x65, 0x76,
+ 0x69, 0x63, 0x65, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x67, 0x70, 0x72, 0x6f, 0x64,
+ 0x75, 0x63, 0x74, 0x65, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x68, 0x76, 0x62, 0x5f, 0x73, 0x74,
+ 0x61, 0x74, 0x65, 0x65, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x6a, 0x6f, 0x73, 0x5f, 0x76, 0x65,
+ 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x31, 0x32, 0x6c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61,
+ 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x6d, 0x76,
+ 0x62, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x4f, 0x11, 0x22,
+ 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x6e, 0x73,
+ 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x63, 0x74,
+ 0x65, 0x65, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c,
+ 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x62, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x6c,
+ 0x6f, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x6c, 0x6f, 0x63,
+ 0x6b, 0x65, 0x64, 0x72, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x61, 0x74, 0x63,
+ 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x61, 0x72, 0x76, 0x65,
+ 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65,
+ 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x63, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21,
+ 0x58, 0x20, 0x78, 0xa9, 0x66, 0xc0, 0xc1, 0x92, 0xc9, 0x0d, 0x74, 0xbf, 0x81, 0x99, 0xe6,
+ 0x7c, 0x61, 0xb2, 0xc3, 0x41, 0x27, 0x4e, 0x92, 0xd8, 0xd8, 0xf8, 0x34, 0x43, 0x81, 0xe1,
+ 0x9c, 0x5f, 0xed, 0xbb, 0x22, 0x58, 0x20, 0x80, 0x05, 0x96, 0xe5, 0x65, 0x7e, 0xa8, 0x5b,
+ 0x58, 0xf7, 0x2c, 0xb8, 0x28, 0x95, 0x34, 0x7a, 0x88, 0xd5, 0xe2, 0x1c, 0x20, 0x01, 0xd7,
+ 0x60, 0xfe, 0xec, 0xf1, 0x3f, 0x69, 0xfc, 0xc0, 0xa4, 0x23, 0x58, 0x21, 0x00, 0x99, 0xad,
+ 0x34, 0x13, 0xf0, 0x7f, 0xaa, 0xf7, 0xda, 0xe9, 0x95, 0xfe, 0x2a, 0x36, 0xf5, 0xac, 0xbb,
+ 0xad, 0x39, 0x8f, 0x3f, 0x86, 0x10, 0x39, 0x2c, 0xa9, 0x4c, 0xb9, 0xbb, 0x79, 0x10, 0x45,
+ 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xd2, 0x94, 0xcb, 0x74, 0x5f,
+ 0x9c, 0xc2, 0x1e, 0x47, 0x28, 0x69, 0x85, 0x6e, 0xf2, 0x34, 0x0a, 0x62, 0x90, 0xc3, 0xb0,
+ 0xc9, 0x3a, 0xb2, 0x32, 0xdc, 0x99, 0x19, 0x9b, 0x36, 0xde, 0x78, 0xed, 0x22, 0x58, 0x20,
+ 0xd9, 0x81, 0x04, 0x83, 0xbb, 0x85, 0x3e, 0x3b, 0x46, 0xe8, 0xe1, 0xa3, 0x8a, 0x04, 0xb9,
+ 0x3f, 0x74, 0x4e, 0x5c, 0x96, 0x21, 0x5c, 0x79, 0x0b, 0x8e, 0x4e, 0x7d, 0x61, 0x1b, 0x69,
+ 0xb2, 0x46, 0x23, 0x58, 0x20, 0x2f, 0x79, 0xf7, 0xbb, 0xbb, 0x7e, 0xee, 0x15, 0x61, 0xa2,
+ 0x78, 0x5f, 0x9c, 0x8c, 0xaf, 0x52, 0xcb, 0xbe, 0x24, 0x31, 0xa8, 0x95, 0x86, 0x8d, 0xed,
+ 0x98, 0x80, 0x71, 0x53, 0x91, 0xb3, 0x87, 0x58, 0x40, 0x19, 0xc9, 0xc4, 0x4e, 0x8b, 0xae,
+ 0x26, 0x7f, 0xdd, 0x9c, 0xac, 0xe2, 0xbf, 0xe2, 0xfb, 0x3c, 0x3f, 0xd6, 0x6f, 0x9a, 0x97,
+ 0xc3, 0x2a, 0x60, 0xfe, 0x0e, 0x9f, 0x11, 0xc9, 0x04, 0xa7, 0xdf, 0xe1, 0x21, 0x1e, 0xc1,
+ 0x10, 0x10, 0x64, 0xf7, 0xeb, 0xcc, 0x3a, 0x4c, 0xa6, 0xdf, 0xd8, 0xf5, 0xcc, 0x0d, 0x34,
+ 0xa4, 0x32, 0xf4, 0x0a, 0xd7, 0x83, 0x1e, 0x30, 0x0d, 0x68, 0x6a, 0xb4, 0xc1, 0xa1, 0x6b,
+ 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x78, 0x3b, 0x62, 0x72,
+ 0x61, 0x6e, 0x64, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x31, 0x2f, 0x64,
+ 0x65, 0x76, 0x69, 0x63, 0x65, 0x31, 0x3a, 0x31, 0x31, 0x2f, 0x69, 0x64, 0x2f, 0x32, 0x30,
+ 0x32, 0x31, 0x30, 0x38, 0x30, 0x35, 0x2e, 0x34, 0x32, 0x3a, 0x75, 0x73, 0x65, 0x72, 0x2f,
+ 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x73};
+
inline const std::vector<uint8_t> kCsrWithSharedUdsRoot1{
0x85, 0x01, 0xa0, 0x82, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x96,
0xf9, 0xf7, 0x16, 0xa7, 0xe2, 0x20, 0xe3, 0x6e, 0x19, 0x8e, 0xc0, 0xc4, 0x82, 0xc5, 0xca,
@@ -1016,6 +1091,17 @@
ASSERT_FALSE(*result2) << "Leaf Certificate in CSR contains 'keymint' in component name";
}
+TEST(RemoteProvUtilsTest, checkModeOnCertificatesInDiceChain) {
+ auto hasNonNormalMode = hasNonNormalModeInDiceChain(kCsrWithDebugMode, DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(hasNonNormalMode) << hasNonNormalMode.message();
+ ASSERT_TRUE(*hasNonNormalMode);
+
+ auto hasNonNormalModeInDiceChain2 =
+ hasNonNormalModeInDiceChain(kCsrWithUdsCerts, DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(hasNonNormalModeInDiceChain2) << hasNonNormalModeInDiceChain2.message();
+ ASSERT_FALSE(*hasNonNormalModeInDiceChain2);
+}
+
TEST(RemoteProvUtilsTest, parseFullyQualifiedInstanceNames) {
ASSERT_EQ(deviceSuffix(RKPVM_INSTANCE_NAME), "avf");
ASSERT_EQ(deviceSuffix(DEFAULT_INSTANCE_NAME), "default");
diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index 11abd45..f40a752 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -849,6 +849,37 @@
};
/**
+ * Check that ro.boot.vbmeta.device_state is not "locked" or ro.boot.verifiedbootstate
+ * is not "green" if and only if the mode on at least one certificate in the DICE chain
+ * is non-normal.
+ */
+TEST_P(CertificateRequestV2Test, unlockedBootloaderStatesImpliesNonnormalDiceChain) {
+ auto challenge = randomBytes(MAX_CHALLENGE_SIZE);
+ bytevec csr;
+ auto status =
+ provisionable_->generateCertificateRequestV2({} /* keysToSign */, challenge, &csr);
+ ASSERT_TRUE(status.isOk()) << status.getDescription();
+
+ auto isProper = isCsrWithProperDiceChain(csr, GetParam());
+ ASSERT_TRUE(isProper) << isProper.message();
+ if (!*isProper) {
+ GTEST_SKIP() << "Skipping test: Only a proper DICE chain has a mode set.";
+ }
+
+ auto nonNormalMode = hasNonNormalModeInDiceChain(csr, GetParam());
+ ASSERT_TRUE(nonNormalMode) << nonNormalMode.message();
+
+ auto deviceState = ::android::base::GetProperty("ro.boot.vbmeta.device_state", "");
+ auto verifiedBootState = ::android::base::GetProperty("ro.boot.verifiedbootstate", "");
+
+ ASSERT_EQ(deviceState != "locked" || verifiedBootState != "green", *nonNormalMode)
+ << "ro.boot.vbmeta.device_state = '" << deviceState
+ << "' and ro.boot.verifiedbootstate = '" << verifiedBootState << "', but it is "
+ << *nonNormalMode
+ << " that the DICE chain has a certificate with a non-normal mode set.";
+}
+
+/**
* Generate an empty certificate request with all possible length of challenge, and decrypt and
* verify the structure and content.
*/