Merge "Tetheroffload tests static link to HAL def libs." into oc-mr1-dev
diff --git a/automotive/vehicle/2.1/types.hal b/automotive/vehicle/2.1/types.hal
index 2e361a3..569e1a5 100644
--- a/automotive/vehicle/2.1/types.hal
+++ b/automotive/vehicle/2.1/types.hal
@@ -249,7 +249,10 @@
| VehicleArea:GLOBAL),
};
-/** The status of the vehicle's fuel system. */
+/**
+ * The status of the vehicle's fuel system.
+ * These values come from the SAE J1979 standard.
+ */
enum Obd2FuelSystemStatus : int32_t {
OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1,
CLOSED_LOOP = 2,
@@ -264,7 +267,10 @@
COMPRESSION = 1,
};
-/** These ignition monitors are common to both SPARK and COMPRESSION. */
+/**
+ * Ignition monitors common to both SPARK and COMPRESSION.
+ * These values come from the SAE J1979 standard.
+ */
enum Obd2CommonIgnitionMonitors : int32_t {
COMPONENTS_AVAILABLE = 0x1 << 0,
COMPONENTS_INCOMPLETE = 0x1 << 1,
@@ -276,7 +282,10 @@
MISFIRE_INCOMPLETE = 0x1 << 5,
};
-/** Ignition monitors available for SPARK vehicles. */
+/**
+ * Ignition monitors available for SPARK vehicles.
+ * These values come from the SAE J1979 standard.
+ */
enum Obd2SparkIgnitionMonitors : Obd2CommonIgnitionMonitors {
EGR_AVAILABLE = 0x1 << 6,
EGR_INCOMPLETE = 0x1 << 7,
@@ -303,7 +312,10 @@
CATALYST_INCOMPLETE = 0x1 << 21,
};
-/** Ignition monitors only available for COMPRESSION vehicles. */
+/**
+ * Ignition monitors only available for COMPRESSION vehicles.
+ * These values come from the SAE J1979 standard.
+ */
enum Obd2CompressionIgnitionMonitors : Obd2CommonIgnitionMonitors {
EGR_OR_VVT_AVAILABLE = 0x1 << 6,
EGR_OR_VVT_INCOMPLETE = 0x1 << 7,
@@ -324,7 +336,10 @@
NMHC_CATALYST_INCOMPLETE = 0x1 << 17,
};
-/** The status of the vehicle's secondary air system. */
+/**
+ * The status of the vehicle's secondary air system.
+ * These values come from the SAE J1979 standard.
+ */
enum Obd2SecondaryAirStatus : int32_t {
UPSTREAM = 1,
DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2,
@@ -332,7 +347,10 @@
PUMP_ON_FOR_DIAGNOSTICS = 8,
};
-/** The fuel type(s) supported by a vehicle. */
+/**
+ * The fuel type(s) supported by a vehicle.
+ * These values come from the SAE J1979 standard.
+ */
enum Obd2FuelType : int32_t {
NOT_AVAILABLE = 0,
GASOLINE = 1,
@@ -366,14 +384,16 @@
* Some of the properties are represented as an integer mapping to another enum. In those cases
* expect a comment by the property definition describing the enum to look at for the mapping.
* Any value greater than the last reserved index is available to vendors to map their extensions.
+ * While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next
+ * to each one to aid implementors.
*/
enum DiagnosticIntegerSensorIndex : int32_t {
/** refer to FuelSystemStatus for a description of this value. */
- FUEL_SYSTEM_STATUS = 0,
- MALFUNCTION_INDICATOR_LIGHT_ON = 1,
+ FUEL_SYSTEM_STATUS = 0, /* PID 0x03 */
+ MALFUNCTION_INDICATOR_LIGHT_ON = 1, /* PID 0x01 */
/** refer to IgnitionMonitorKind for a description of this value. */
- IGNITION_MONITORS_SUPPORTED = 2,
+ IGNITION_MONITORS_SUPPORTED = 2, /* PID 0x01 */
/**
* The value of this sensor is a bitmask that specifies whether ignition-specific
@@ -381,39 +401,39 @@
* bits in this value are given by, respectively, SparkIgnitionMonitors and
* CompressionIgnitionMonitors depending on the value of IGNITION_MONITORS_SUPPORTED.
*/
- IGNITION_SPECIFIC_MONITORS = 3,
- INTAKE_AIR_TEMPERATURE = 4,
+ IGNITION_SPECIFIC_MONITORS = 3, /* PID 0x01 */
+ INTAKE_AIR_TEMPERATURE = 4, /* PID 0x0F */
/** refer to SecondaryAirStatus for a description of this value. */
- COMMANDED_SECONDARY_AIR_STATUS = 5,
- NUM_OXYGEN_SENSORS_PRESENT = 6,
- RUNTIME_SINCE_ENGINE_START = 7,
- DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8,
- WARMUPS_SINCE_CODES_CLEARED = 9,
- DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10,
- ABSOLUTE_BAROMETRIC_PRESSURE = 11,
- CONTROL_MODULE_VOLTAGE = 12,
- AMBIENT_AIR_TEMPERATURE = 13,
- TIME_WITH_MALFUNCTION_LIGHT_ON = 14,
- TIME_SINCE_TROUBLE_CODES_CLEARED = 15,
- MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16,
- MAX_OXYGEN_SENSOR_VOLTAGE = 17,
- MAX_OXYGEN_SENSOR_CURRENT = 18,
- MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19,
- MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20,
+ COMMANDED_SECONDARY_AIR_STATUS = 5, /* PID 0x12 */
+ NUM_OXYGEN_SENSORS_PRESENT = 6, /* PID 0x13 */
+ RUNTIME_SINCE_ENGINE_START = 7, /* PID 0x1F */
+ DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8, /* PID 0x21 */
+ WARMUPS_SINCE_CODES_CLEARED = 9, /* PID 0x30 */
+ DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10, /* PID 0x31 */
+ ABSOLUTE_BAROMETRIC_PRESSURE = 11, /* PID 0x33 */
+ CONTROL_MODULE_VOLTAGE = 12, /* PID 0x42 */
+ AMBIENT_AIR_TEMPERATURE = 13, /* PID 0x46 */
+ TIME_WITH_MALFUNCTION_LIGHT_ON = 14, /* PID 0x4D */
+ TIME_SINCE_TROUBLE_CODES_CLEARED = 15, /* PID 0x4E */
+ MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16, /* PID 0x4F */
+ MAX_OXYGEN_SENSOR_VOLTAGE = 17, /* PID 0x4F */
+ MAX_OXYGEN_SENSOR_CURRENT = 18, /* PID 0x4F */
+ MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19, /* PID 0x4F */
+ MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20, /* PID 0x50 */
/** refer to FuelType for a description of this value. */
- FUEL_TYPE = 21,
- FUEL_RAIL_ABSOLUTE_PRESSURE = 22,
- ENGINE_OIL_TEMPERATURE = 23,
- DRIVER_DEMAND_PERCENT_TORQUE = 24,
- ENGINE_ACTUAL_PERCENT_TORQUE = 25,
- ENGINE_REFERENCE_PERCENT_TORQUE = 26,
- ENGINE_PERCENT_TORQUE_DATA_IDLE = 27,
- ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28,
- ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29,
- ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30,
- ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31,
+ FUEL_TYPE = 21, /* PID 0x51 */
+ FUEL_RAIL_ABSOLUTE_PRESSURE = 22, /* PID 0x59 */
+ ENGINE_OIL_TEMPERATURE = 23, /* PID 0x5C */
+ DRIVER_DEMAND_PERCENT_TORQUE = 24, /* PID 0x61 */
+ ENGINE_ACTUAL_PERCENT_TORQUE = 25, /* PID 0x62 */
+ ENGINE_REFERENCE_PERCENT_TORQUE = 26, /* PID 0x63 */
+ ENGINE_PERCENT_TORQUE_DATA_IDLE = 27, /* PID 0x64 */
+ ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28, /* PID 0x64 */
+ ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29, /* PID 0x64 */
+ ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30, /* PID 0x64 */
+ ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31, /* PID 0x64 */
LAST_SYSTEM_INDEX = ENGINE_PERCENT_TORQUE_DATA_POINT4,
};
@@ -421,79 +441,81 @@
* This enum provides the canonical mapping for sensor properties that have a floating-point value.
* The ordering of the values is taken from the OBD2 specification.
* Any value greater than the last reserved index is available to vendors to map their extensions.
+ * While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next
+ * to each one to aid implementors.
*/
enum DiagnosticFloatSensorIndex : int32_t {
- CALCULATED_ENGINE_LOAD = 0,
- ENGINE_COOLANT_TEMPERATURE = 1,
- SHORT_TERM_FUEL_TRIM_BANK1 = 2,
- LONG_TERM_FUEL_TRIM_BANK1 = 3,
- SHORT_TERM_FUEL_TRIM_BANK2 = 4,
- LONG_TERM_FUEL_TRIM_BANK2 = 5,
- FUEL_PRESSURE = 6,
- INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7,
- ENGINE_RPM = 8,
- VEHICLE_SPEED = 9,
- TIMING_ADVANCE = 10,
- MAF_AIR_FLOW_RATE = 11,
- THROTTLE_POSITION = 12,
- OXYGEN_SENSOR1_VOLTAGE = 13,
- OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14,
- OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15,
- OXYGEN_SENSOR2_VOLTAGE = 16,
- OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17,
- OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18,
- OXYGEN_SENSOR3_VOLTAGE = 19,
- OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20,
- OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21,
- OXYGEN_SENSOR4_VOLTAGE = 22,
- OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23,
- OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24,
- OXYGEN_SENSOR5_VOLTAGE = 25,
- OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26,
- OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27,
- OXYGEN_SENSOR6_VOLTAGE = 28,
- OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29,
- OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30,
- OXYGEN_SENSOR7_VOLTAGE = 31,
- OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32,
- OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33,
- OXYGEN_SENSOR8_VOLTAGE = 34,
- OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35,
- OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36,
- FUEL_RAIL_PRESSURE = 37,
- FUEL_RAIL_GAUGE_PRESSURE = 38,
- COMMANDED_EXHAUST_GAS_RECIRCULATION = 39,
- EXHAUST_GAS_RECIRCULATION_ERROR = 40,
- COMMANDED_EVAPORATIVE_PURGE = 41,
- FUEL_TANK_LEVEL_INPUT = 42,
- EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43,
- CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44,
- CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45,
- CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46,
- CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47,
- ABSOLUTE_LOAD_VALUE = 48,
- FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49,
- RELATIVE_THROTTLE_POSITION = 50,
- ABSOLUTE_THROTTLE_POSITION_B = 51,
- ABSOLUTE_THROTTLE_POSITION_C = 52,
- ACCELERATOR_PEDAL_POSITION_D = 53,
- ACCELERATOR_PEDAL_POSITION_E = 54,
- ACCELERATOR_PEDAL_POSITION_F = 55,
- COMMANDED_THROTTLE_ACTUATOR = 56,
- ETHANOL_FUEL_PERCENTAGE = 57,
- ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58,
- SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59,
- SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60,
- SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61,
- SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62,
- LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63,
- LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64,
- LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65,
- LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66,
- RELATIVE_ACCELERATOR_PEDAL_POSITION = 67,
- HYBRID_BATTERY_PACK_REMAINING_LIFE = 68,
- FUEL_INJECTION_TIMING = 69,
- ENGINE_FUEL_RATE = 70,
+ CALCULATED_ENGINE_LOAD = 0, /* PID 0x04 */
+ ENGINE_COOLANT_TEMPERATURE = 1, /* PID 0x05 */
+ SHORT_TERM_FUEL_TRIM_BANK1 = 2, /* PID 0x06 */
+ LONG_TERM_FUEL_TRIM_BANK1 = 3, /* PID 0x07 */
+ SHORT_TERM_FUEL_TRIM_BANK2 = 4, /* PID 0x08 */
+ LONG_TERM_FUEL_TRIM_BANK2 = 5, /* PID 0x09 */
+ FUEL_PRESSURE = 6, /* PID 0x0A */
+ INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7, /* PID 0x0B */
+ ENGINE_RPM = 8, /* PID 0x0C */
+ VEHICLE_SPEED = 9, /* PID 0x0D */
+ TIMING_ADVANCE = 10, /* PID 0x0E */
+ MAF_AIR_FLOW_RATE = 11, /* PID 0x10 */
+ THROTTLE_POSITION = 12, /* PID 0x11 */
+ OXYGEN_SENSOR1_VOLTAGE = 13, /* PID 0x14 */
+ OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14, /* PID 0x14 */
+ OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15, /* PID 0x24 */
+ OXYGEN_SENSOR2_VOLTAGE = 16, /* PID 0x15 */
+ OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17, /* PID 0x15 */
+ OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18, /* PID 0x25 */
+ OXYGEN_SENSOR3_VOLTAGE = 19, /* PID 0x16 */
+ OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20, /* PID 0x16 */
+ OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21, /* PID 0x26 */
+ OXYGEN_SENSOR4_VOLTAGE = 22, /* PID 0x17 */
+ OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23, /* PID 0x17 */
+ OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24, /* PID 0x27 */
+ OXYGEN_SENSOR5_VOLTAGE = 25, /* PID 0x18 */
+ OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26, /* PID 0x18 */
+ OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27, /* PID 0x28 */
+ OXYGEN_SENSOR6_VOLTAGE = 28, /* PID 0x19 */
+ OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29, /* PID 0x19 */
+ OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30, /* PID 0x29 */
+ OXYGEN_SENSOR7_VOLTAGE = 31, /* PID 0x1A */
+ OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32, /* PID 0x1A */
+ OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33, /* PID 0x2A */
+ OXYGEN_SENSOR8_VOLTAGE = 34, /* PID 0x1B */
+ OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35, /* PID 0x1B */
+ OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36, /* PID 0x2B */
+ FUEL_RAIL_PRESSURE = 37, /* PID 0x22 */
+ FUEL_RAIL_GAUGE_PRESSURE = 38, /* PID 0x23 */
+ COMMANDED_EXHAUST_GAS_RECIRCULATION = 39, /* PID 0x2C */
+ EXHAUST_GAS_RECIRCULATION_ERROR = 40, /* PID 0x2D */
+ COMMANDED_EVAPORATIVE_PURGE = 41, /* PID 0x2E */
+ FUEL_TANK_LEVEL_INPUT = 42, /* PID 0x2F */
+ EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43, /* PID 0x32 */
+ CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44, /* PID 0x3C */
+ CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45, /* PID 0x3D */
+ CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46, /* PID 0x3E */
+ CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47, /* PID 0x3F */
+ ABSOLUTE_LOAD_VALUE = 48, /* PID 0x43 */
+ FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49, /* PID 0x44 */
+ RELATIVE_THROTTLE_POSITION = 50, /* PID 0x45 */
+ ABSOLUTE_THROTTLE_POSITION_B = 51, /* PID 0x47 */
+ ABSOLUTE_THROTTLE_POSITION_C = 52, /* PID 0x48 */
+ ACCELERATOR_PEDAL_POSITION_D = 53, /* PID 0x49 */
+ ACCELERATOR_PEDAL_POSITION_E = 54, /* PID 0x4A */
+ ACCELERATOR_PEDAL_POSITION_F = 55, /* PID 0x4B */
+ COMMANDED_THROTTLE_ACTUATOR = 56, /* PID 0x4C */
+ ETHANOL_FUEL_PERCENTAGE = 57,/* PID 0x52 */
+ ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58, /* PID 0x53 */
+ SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59, /* PID 0x55 */
+ SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60, /* PID 0x57 */
+ SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61,/* PID 0x55 */
+ SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62, /* PID 0x57 */
+ LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, /* PID 0x56 */
+ LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, /* PID 0x58 */
+ LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65, /* PID 0x56 */
+ LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66, /* PID 0x58 */
+ RELATIVE_ACCELERATOR_PEDAL_POSITION = 67, /* PID 0x5A */
+ HYBRID_BATTERY_PACK_REMAINING_LIFE = 68, /* PID 0x5B */
+ FUEL_INJECTION_TIMING = 69, /* PID 0x5D */
+ ENGINE_FUEL_RATE = 70, /* PID 0x5E */
LAST_SYSTEM_INDEX = ENGINE_FUEL_RATE,
};
diff --git a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
index fa0f030..fd048db 100644
--- a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
+++ b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
@@ -229,7 +229,18 @@
bool getProperties();
bool openTuner();
bool checkAntenna();
- BandConfig& getBand(unsigned idx);
+
+ /**
+ * Retrieves AM/FM band configuration from module properties.
+ *
+ * The configuration may not exist: if radio type is other than AM/FM
+ * or provided index is out of bounds.
+ * In such case, empty configuration is returned.
+ *
+ * @param idx Band index to retrieve.
+ * @return Band configuration reference.
+ */
+ const BandConfig& getBand(unsigned idx);
static const nsecs_t kConnectCallbacktimeoutNs = seconds_to_nanoseconds(1);
static const nsecs_t kConfigCallbacktimeoutNs = seconds_to_nanoseconds(10);
@@ -349,7 +360,7 @@
return ((halResult == Result::OK) && (halConfig.antennaConnected == true));
}
-BandConfig& BroadcastRadioHidlTest::getBand(unsigned idx) {
+const BandConfig& BroadcastRadioHidlTest::getBand(unsigned idx) {
static BandConfig dummyBandConfig = {};
if (radioClass == Class::AM_FM) {
EXPECT_GT(mHalProperties.bands.size(), idx);
@@ -419,8 +430,12 @@
auto openCb = [&](Result result, const sp<ITuner>&) { halResult = result; };
auto hidlReturn = mRadio->openTuner(getBand(0), true, mTunerCallback, openCb);
EXPECT_TRUE(hidlReturn.isOk());
- if (halResult == Result::INVALID_STATE) {
- EXPECT_TRUE(waitForCallback(kConfigCallbacktimeoutNs));
+ if (halResult == Result::OK) {
+ if (radioClass == Class::AM_FM) {
+ EXPECT_TRUE(waitForCallback(kConfigCallbacktimeoutNs));
+ }
+ } else {
+ EXPECT_EQ(Result::INVALID_STATE, halResult);
}
}
@@ -432,6 +447,9 @@
* - the methods return 0 (no error)
* - the configuration callback is received within kConfigCallbacktimeoutNs ns
* - the configuration read back from HAl has the same class Id
+ *
+ * Skipped for other radio classes than AM/FM, because setConfiguration
+ * applies only for these bands.
*/
TEST_P(BroadcastRadioHidlTest, SetAndGetConfiguration) {
if (radioClass != Class::AM_FM) skipped = true;
@@ -467,6 +485,9 @@
* Verifies that:
* - the methods returns INVALID_ARGUMENTS on invalid arguments
* - the method recovers and succeeds after passing correct arguments
+ *
+ * Skipped for other radio classes than AM/FM, because setConfiguration
+ * applies only for these bands.
*/
TEST_P(BroadcastRadioHidlTest, SetConfigurationFails) {
if (radioClass != Class::AM_FM) skipped = true;
@@ -531,6 +552,9 @@
* - the method returns 0 (no error)
* - the tuned callback is received within kTuneCallbacktimeoutNs ns
* - skipping sub-channel or not does not fail the call
+ *
+ * Skipped for other radio classes than AM/FM, because step is not possible
+ * on DAB nor satellite.
*/
TEST_P(BroadcastRadioHidlTest, Step) {
if (radioClass != Class::AM_FM) skipped = true;
@@ -559,6 +583,9 @@
* - the HAL implements the methods
* - the methods return 0 (no error)
* - the tuned callback is received within kTuneCallbacktimeoutNs ns after tune()
+ *
+ * Skipped for other radio classes than AM/FM, because tune to frequency
+ * is not possible on DAB nor satellite.
*/
TEST_P(BroadcastRadioHidlTest, TuneAndGetProgramInformationAndCancel) {
if (radioClass != Class::AM_FM) skipped = true;
@@ -617,6 +644,9 @@
* Verifies that:
* - the method returns INVALID_ARGUMENTS when applicable
* - the method recovers and succeeds after passing correct arguments
+ *
+ * Skipped for other radio classes than AM/FM, because tune to frequency
+ * is not possible on DAB nor satellite.
*/
TEST_P(BroadcastRadioHidlTest, TuneFailsOutOfBounds) {
if (radioClass != Class::AM_FM) skipped = true;
diff --git a/broadcastradio/1.1/default/BroadcastRadio.cpp b/broadcastradio/1.1/default/BroadcastRadio.cpp
index ce7a10f..38b4b99 100644
--- a/broadcastradio/1.1/default/BroadcastRadio.cpp
+++ b/broadcastradio/1.1/default/BroadcastRadio.cpp
@@ -45,16 +45,28 @@
"Digital radio mock",
{ // amFmBands
AmFmBandConfig({
+ Band::AM,
+ 153, // lowerLimit
+ 26100, // upperLimit
+ {5, 9, 10}, // spacings
+ }),
+ AmFmBandConfig({
+ Band::FM,
+ 65800, // lowerLimit
+ 108000, // upperLimit
+ {10, 100, 200}, // spacings
+ }),
+ AmFmBandConfig({
Band::AM_HD,
- 540, // lowerLimit
- 1610, // upperLimit
- 10, // spacing
+ 153, // lowerLimit
+ 26100, // upperLimit
+ {5, 9, 10}, // spacings
}),
AmFmBandConfig({
Band::FM_HD,
87900, // lowerLimit
107900, // upperLimit
- 200, // spacing
+ {200}, // spacings
}),
},
})},
@@ -114,14 +126,14 @@
dst.antennaConnected = true;
dst.lowerLimit = src.lowerLimit;
dst.upperLimit = src.upperLimit;
- dst.spacings = vector<uint32_t>({src.spacing});
+ dst.spacings = src.spacings;
- if (src.type == Band::AM) {
+ if (utils::isAm(src.type)) {
dst.ext.am.stereo = true;
- } else if (src.type == Band::FM) {
- dst.ext.fm.deemphasis = Deemphasis::D75;
+ } else if (utils::isFm(src.type)) {
+ dst.ext.fm.deemphasis = static_cast<Deemphasis>(Deemphasis::D50 | Deemphasis::D75);
dst.ext.fm.stereo = true;
- dst.ext.fm.rds = Rds::US;
+ dst.ext.fm.rds = static_cast<Rds>(Rds::WORLD | Rds::US);
dst.ext.fm.ta = true;
dst.ext.fm.af = true;
dst.ext.fm.ea = true;
diff --git a/broadcastradio/1.1/default/BroadcastRadio.h b/broadcastradio/1.1/default/BroadcastRadio.h
index 71e3be8..a96a2ab 100644
--- a/broadcastradio/1.1/default/BroadcastRadio.h
+++ b/broadcastradio/1.1/default/BroadcastRadio.h
@@ -31,7 +31,7 @@
V1_0::Band type;
uint32_t lowerLimit; // kHz
uint32_t upperLimit; // kHz
- uint32_t spacing; // kHz
+ std::vector<uint32_t> spacings; // kHz
};
struct ModuleConfig {
diff --git a/broadcastradio/1.1/default/Tuner.cpp b/broadcastradio/1.1/default/Tuner.cpp
index 87964d3..9a34cb1 100644
--- a/broadcastradio/1.1/default/Tuner.cpp
+++ b/broadcastradio/1.1/default/Tuner.cpp
@@ -83,7 +83,7 @@
mAmfmConfig.antennaConnected = true;
mCurrentProgram = utils::make_selector(mAmfmConfig.type, mAmfmConfig.lowerLimit);
- if (mAmfmConfig.type == Band::FM_HD || mAmfmConfig.type == Band::FM) {
+ if (utils::isFm(mAmfmConfig.type)) {
mVirtualRadio = std::ref(getFmRadio());
} else {
mVirtualRadio = std::ref(getAmRadio());
diff --git a/broadcastradio/1.1/utils/Utils.cpp b/broadcastradio/1.1/utils/Utils.cpp
index 8ccd98e..4dd6b13 100644
--- a/broadcastradio/1.1/utils/Utils.cpp
+++ b/broadcastradio/1.1/utils/Utils.cpp
@@ -115,6 +115,14 @@
}
}
+bool isAm(const Band band) {
+ return band == Band::AM || band == Band::AM_HD;
+}
+
+bool isFm(const Band band) {
+ return band == Band::FM || band == Band::FM_HD;
+}
+
bool hasId(const ProgramSelector& sel, const IdentifierType type) {
auto itype = static_cast<uint32_t>(type);
if (sel.primaryId.type == itype) return true;
@@ -149,17 +157,12 @@
// we can't use ProgramType::AM_HD or FM_HD, because we don't know HD station ID
ProgramType type;
- switch (band) {
- case Band::AM:
- case Band::AM_HD:
- type = ProgramType::AM;
- break;
- case Band::FM:
- case Band::FM_HD:
- type = ProgramType::FM;
- break;
- default:
- LOG_ALWAYS_FATAL("Unsupported band: %s", toString(band).c_str());
+ if (isAm(band)) {
+ type = ProgramType::AM;
+ } else if (isFm(band)) {
+ type = ProgramType::FM;
+ } else {
+ LOG_ALWAYS_FATAL("Unsupported band: %s", toString(band).c_str());
}
sel.programType = static_cast<uint32_t>(type);
@@ -215,9 +218,9 @@
if (l.lowerLimit != r.lowerLimit) return false;
if (l.upperLimit != r.upperLimit) return false;
if (l.spacings != r.spacings) return false;
- if (l.type == Band::AM || l.type == Band::AM_HD) {
+ if (V1_1::utils::isAm(l.type)) {
return l.ext.am == r.ext.am;
- } else if (l.type == Band::FM || l.type == Band::FM_HD) {
+ } else if (V1_1::utils::isFm(l.type)) {
return l.ext.fm == r.ext.fm;
} else {
ALOGW("Unsupported band config type: %s", toString(l.type).c_str());
diff --git a/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h b/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
index 4d69c0a..24c60ee 100644
--- a/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
+++ b/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
@@ -48,6 +48,9 @@
ProgramType getType(const ProgramSelector& sel);
bool isAmFm(const ProgramType type);
+bool isAm(const V1_0::Band band);
+bool isFm(const V1_0::Band band);
+
bool hasId(const ProgramSelector& sel, const IdentifierType type);
/**
diff --git a/configstore/1.1/default/Android.mk b/configstore/1.1/default/Android.mk
index ac3d8b0..58b67c1 100644
--- a/configstore/1.1/default/Android.mk
+++ b/configstore/1.1/default/Android.mk
@@ -3,6 +3,7 @@
################################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.configstore@1.1-service
+LOCAL_REQUIRED_MODULES_arm64 := configstore@1.1.policy
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE_RELATIVE_PATH := hw
@@ -17,7 +18,18 @@
libhidlbase \
libhidltransport \
libbase \
+ libhwminijail \
liblog \
libutils \
include $(BUILD_EXECUTABLE)
+
+# seccomp filter for configstore
+ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), arm64))
+include $(CLEAR_VARS)
+LOCAL_MODULE := configstore@1.1.policy
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/seccomp_policy
+LOCAL_SRC_FILES := seccomp_policy/configstore@1.1-$(TARGET_ARCH).policy
+include $(BUILD_PREBUILT)
+endif
diff --git a/configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy b/configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy
new file mode 100644
index 0000000..8c901eb
--- /dev/null
+++ b/configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy
@@ -0,0 +1,40 @@
+# Copyright (C) 2017 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.
+
+futex: 1
+# ioctl: arg1 == BINDER_WRITE_READ
+ioctl: arg1 == 0xc0306201
+ioctl: 1
+# prctl: arg0 == PR_SET_NAME || arg0 == PR_SET_VMA || arg0 == PR_SET_TIMERSLACK
+prctl: arg0 == 15 || arg0 == 0x53564d41 || arg0 == 29
+openat: 1
+mmap: 1
+mprotect: 1
+close: 1
+getuid: 1
+read: 1
+faccessat: 1
+write: 1
+fstat: 1
+clone: 1
+munmap: 1
+lseek: 1
+sigaltstack: 1
+writev: 1
+setpriority: 1
+restart_syscall: 1
+exit: 1
+exit_group: 1
+rt_sigreturn: 1
+getrlimit: 1
diff --git a/configstore/1.1/default/service.cpp b/configstore/1.1/default/service.cpp
index 52db025..535e0cd 100644
--- a/configstore/1.1/default/service.cpp
+++ b/configstore/1.1/default/service.cpp
@@ -18,6 +18,7 @@
#include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
#include <hidl/HidlTransportSupport.h>
+#include <hwminijail/HardwareMinijail.h>
#include "SurfaceFlingerConfigs.h"
@@ -25,6 +26,7 @@
using android::hardware::joinRpcThreadpool;
using android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
using android::hardware::configstore::V1_1::implementation::SurfaceFlingerConfigs;
+using android::hardware::SetupMinijail;
using android::sp;
using android::status_t;
using android::OK;
@@ -32,6 +34,8 @@
int main() {
configureRpcThreadpool(10, true);
+ SetupMinijail("/vendor/etc/seccomp_policy/configstore@1.1.policy");
+
sp<ISurfaceFlingerConfigs> surfaceFlingerConfigs = new SurfaceFlingerConfigs;
status_t status = surfaceFlingerConfigs->registerAsService();
LOG_ALWAYS_FATAL_IF(status != OK, "Could not register ISurfaceFlingerConfigs");
diff --git a/keymaster/3.0/vts/functional/Android.bp b/keymaster/3.0/vts/functional/Android.bp
new file mode 100644
index 0000000..7d96704
--- /dev/null
+++ b/keymaster/3.0/vts/functional/Android.bp
@@ -0,0 +1,32 @@
+//
+// Copyright (C) 2017 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.
+//
+
+cc_test {
+ name: "VtsHalKeymasterV3_0TargetTest",
+ defaults: ["VtsHalTargetTestDefaults"],
+ srcs: [
+ "authorization_set.cpp",
+ "attestation_record.cpp",
+ "key_param_output.cpp",
+ "keymaster_hidl_hal_test.cpp",
+ "keystore_tags_utils.cpp",
+ ],
+ static_libs: [
+ "android.hardware.keymaster@3.0",
+ "libcrypto",
+ "libsoftkeymasterdevice",
+ ],
+}
diff --git a/keymaster/3.0/vts/functional/Android.mk b/keymaster/3.0/vts/functional/Android.mk
deleted file mode 100644
index 4098664..0000000
--- a/keymaster/3.0/vts/functional/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := VtsHalKeymasterV3_0TargetTest
-LOCAL_SRC_FILES := \
- authorization_set.cpp \
- attestation_record.cpp \
- key_param_output.cpp \
- keymaster_hidl_hal_test.cpp \
- keystore_tags_utils.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- android.hardware.keymaster@3.0 \
- libcrypto \
- libhidlbase \
- liblog \
- libsoftkeymasterdevice \
- libutils \
-
-LOCAL_STATIC_LIBRARIES := \
- VtsHalHidlTargetTestBase \
-
-LOCAL_CFLAGS := -Wall -Werror
-
-include $(BUILD_NATIVE_TEST)
diff --git a/keymaster/Android.bp b/keymaster/Android.bp
index 09b8cb2..90a0195 100644
--- a/keymaster/Android.bp
+++ b/keymaster/Android.bp
@@ -1,4 +1,5 @@
// This is an autogenerated file, do not edit.
subdirs = [
"3.0",
+ "3.0/vts/functional",
]
diff --git a/minijail/Android.mk b/minijail/Android.mk
new file mode 100644
index 0000000..272bb0e
--- /dev/null
+++ b/minijail/Android.mk
@@ -0,0 +1,14 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libhwminijail
+LOCAL_PROPRIETARY_MODULE := true
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SRC_FILES := HardwareMinijail.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+ libbase \
+ libminijail_vendor
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/minijail/HardwareMinijail.cpp b/minijail/HardwareMinijail.cpp
new file mode 100644
index 0000000..e6b1144
--- /dev/null
+++ b/minijail/HardwareMinijail.cpp
@@ -0,0 +1,45 @@
+//
+// Copyright (C) 2017 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.
+//
+
+#include <android-base/logging.h>
+#include <libminijail.h>
+
+#include <hwminijail/HardwareMinijail.h>
+
+namespace android {
+namespace hardware {
+
+void SetupMinijail(const std::string& seccomp_policy_path) {
+ if (access(seccomp_policy_path.c_str(), R_OK) == -1) {
+ LOG(WARNING) << "Could not find seccomp policy file at: " << seccomp_policy_path;
+ return;
+ }
+
+ struct minijail* jail = minijail_new();
+ if (jail == NULL) {
+ LOG(FATAL) << "Failed to create minijail.";
+ }
+
+ minijail_no_new_privs(jail);
+ minijail_log_seccomp_filter_failures(jail);
+ minijail_use_seccomp_filter(jail);
+ minijail_parse_seccomp_filters(jail, seccomp_policy_path.c_str());
+ minijail_enter(jail);
+ minijail_destroy(jail);
+}
+
+} // namespace hardware
+} // namespace android
diff --git a/minijail/include/hwminijail/HardwareMinijail.h b/minijail/include/hwminijail/HardwareMinijail.h
new file mode 100644
index 0000000..8fcf007
--- /dev/null
+++ b/minijail/include/hwminijail/HardwareMinijail.h
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 2017 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.
+//
+
+#ifndef ANDROID_HARDWARE_CONFIGSTORE_MINIJAIL_H
+#define ANDROID_HARDWARE_CONFIGSTORE_MINIJAIL_H
+
+#include <string>
+
+namespace android {
+namespace hardware {
+
+void SetupMinijail(const std::string& seccomp_policy_path);
+
+} // namespace hardware
+} // namespace android
+
+#endif // ANDROID_HARDWARE_CONFIGSTORE_UTILS_H
diff --git a/neuralnetworks/1.0/vts/functional/Android.bp b/neuralnetworks/1.0/vts/functional/Android.bp
index 96eb4cb..d76b2c3 100644
--- a/neuralnetworks/1.0/vts/functional/Android.bp
+++ b/neuralnetworks/1.0/vts/functional/Android.bp
@@ -17,21 +17,11 @@
cc_test {
name: "VtsHalNeuralnetworksV1_0TargetTest",
srcs: ["VtsHalNeuralnetworksV1_0TargetTest.cpp"],
- defaults: ["hidl_defaults"],
- shared_libs: [
- "libbase",
- "libhidlbase",
- "libhidlmemory",
- "libhidltransport",
- "liblog",
- "libutils",
+ defaults: ["VtsHalTargetTestDefaults"],
+ static_libs: [
"android.hardware.neuralnetworks@1.0",
"android.hidl.allocator@1.0",
"android.hidl.memory@1.0",
- ],
- static_libs: ["VtsHalHidlTargetTestBase"],
- cflags: [
- "-O0",
- "-g",
+ "libhidlmemory",
],
}