Merge "Improvements to the documentation for the OBD2 properties" into oc-mr1-dev
diff --git a/audio/2.0/config/audio_policy_configuration.xsd b/audio/2.0/config/audio_policy_configuration.xsd
index 48b9a9b..c94da80 100644
--- a/audio/2.0/config/audio_policy_configuration.xsd
+++ b/audio/2.0/config/audio_policy_configuration.xsd
@@ -188,6 +188,7 @@
<xs:complexType>
<xs:sequence>
<xs:element name="profile" type="profile" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="gains" type="gains" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="name" type="xs:token" use="required"/>
<xs:attribute name="role" type="role" use="required"/>
@@ -199,6 +200,10 @@
<xs:field xpath="samplingRate"/>
<xs:field xpath="channelMasks"/>
</xs:unique>
+ <xs:unique name="mixPortGainUniqueness">
+ <xs:selector xpath="gains/gain"/>
+ <xs:field xpath="@name"/>
+ </xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
@@ -365,16 +370,42 @@
<xs:attribute name="samplingRates" type="samplingRates" use="required"/>
<xs:attribute name="channelMasks" type="channelMask" use="required"/>
</xs:complexType>
+ <xs:simpleType name="gainMode">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="AUDIO_GAIN_MODE_JOINT"/>
+ <xs:enumeration value="AUDIO_GAIN_MODE_CHANNELS"/>
+ <xs:enumeration value="AUDIO_GAIN_MODE_RAMP"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:complexType name="gains">
+ <xs:sequence>
+ <xs:element name="gain" minOccurs="0" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:token" use="required"/>
+ <xs:attribute name="mode" type="gainMode" use="required"/>
+ <xs:attribute name="channel_mask" type="channelMask" use="optional"/>
+ <xs:attribute name="minValueMB" type="xs:int" use="optional"/>
+ <xs:attribute name="maxValueMB" type="xs:int" use="optional"/>
+ <xs:attribute name="defaultValueMB" type="xs:int" use="optional"/>
+ <xs:attribute name="stepValueMB" type="xs:int" use="optional"/>
+ <xs:attribute name="minRampMs" type="xs:int" use="optional"/>
+ <xs:attribute name="maxRampMs" type="xs:int" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
<xs:complexType name="devicePorts">
<xs:sequence>
<xs:element name="devicePort" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="profile" type="profile" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="gains" type="gains" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="tagName" type="xs:token" use="required"/>
<xs:attribute name="type" type="audioDevice" use="required"/>
<xs:attribute name="role" type="role" use="required"/>
+ <xs:attribute name="address" type="xs:string" use="optional"/>
</xs:complexType>
<xs:unique name="devicePortProfileUniqueness">
<xs:selector xpath="profile"/>
@@ -382,6 +413,10 @@
<xs:field xpath="samplingRate"/>
<xs:field xpath="channelMasks"/>
</xs:unique>
+ <xs:unique name="devicePortGainUniqueness">
+ <xs:selector xpath="gains/gain"/>
+ <xs:field xpath="@name"/>
+ </xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
diff --git a/automotive/vehicle/2.1/Android.mk b/automotive/vehicle/2.1/Android.mk
index 095a1c7..3001da0 100644
--- a/automotive/vehicle/2.1/Android.mk
+++ b/automotive/vehicle/2.1/Android.mk
@@ -18,9 +18,9 @@
#
-# Build types.hal (CommonIgnitionMonitors)
+# Build types.hal (DiagnosticFloatSensorIndex)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/CommonIgnitionMonitors.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticFloatSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -30,16 +30,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.CommonIgnitionMonitors
+ android.hardware.automotive.vehicle@2.1::types.DiagnosticFloatSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (CompressionIgnitionMonitors)
+# Build types.hal (DiagnosticIntegerSensorIndex)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/CompressionIgnitionMonitors.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticIntegerSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -49,16 +49,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.CompressionIgnitionMonitors
+ android.hardware.automotive.vehicle@2.1::types.DiagnosticIntegerSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (FuelSystemStatus)
+# Build types.hal (Obd2CommonIgnitionMonitors)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/FuelSystemStatus.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CommonIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -68,16 +68,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.FuelSystemStatus
+ android.hardware.automotive.vehicle@2.1::types.Obd2CommonIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (FuelType)
+# Build types.hal (Obd2CompressionIgnitionMonitors)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/FuelType.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CompressionIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -87,16 +87,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.FuelType
+ android.hardware.automotive.vehicle@2.1::types.Obd2CompressionIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (IgnitionMonitorKind)
+# Build types.hal (Obd2FuelSystemStatus)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IgnitionMonitorKind.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelSystemStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -106,16 +106,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.IgnitionMonitorKind
+ android.hardware.automotive.vehicle@2.1::types.Obd2FuelSystemStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (Obd2FloatSensorIndex)
+# Build types.hal (Obd2FuelType)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FloatSensorIndex.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -125,16 +125,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.Obd2FloatSensorIndex
+ android.hardware.automotive.vehicle@2.1::types.Obd2FuelType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (Obd2IntegerSensorIndex)
+# Build types.hal (Obd2IgnitionMonitorKind)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IntegerSensorIndex.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IgnitionMonitorKind.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -144,16 +144,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.Obd2IntegerSensorIndex
+ android.hardware.automotive.vehicle@2.1::types.Obd2IgnitionMonitorKind
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (SecondaryAirStatus)
+# Build types.hal (Obd2SecondaryAirStatus)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/SecondaryAirStatus.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SecondaryAirStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -163,16 +163,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.SecondaryAirStatus
+ android.hardware.automotive.vehicle@2.1::types.Obd2SecondaryAirStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (SparkIgnitionMonitors)
+# Build types.hal (Obd2SparkIgnitionMonitors)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/SparkIgnitionMonitors.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SparkIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -182,7 +182,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.SparkIgnitionMonitors
+ android.hardware.automotive.vehicle@2.1::types.Obd2SparkIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -208,6 +208,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (VmsAvailabilityStateIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsAvailabilityStateIntegerValuesIndex.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.automotive.vehicle@2.1::types.VmsAvailabilityStateIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (VmsBaseMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsBaseMessageIntegerValuesIndex.java
@@ -227,25 +246,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (VmsDataMessageIntegerValuesIndex)
-#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsDataMessageIntegerValuesIndex.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.VmsDataMessageIntegerValuesIndex
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (VmsMessageType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageType.java
@@ -265,6 +265,44 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (VmsMessageWithLayerAndPublisherIdIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.automotive.vehicle@2.1::types.VmsMessageWithLayerAndPublisherIdIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (VmsMessageWithLayerIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageWithLayerIntegerValuesIndex.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.automotive.vehicle@2.1::types.VmsMessageWithLayerIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (VmsOfferingMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsOfferingMessageIntegerValuesIndex.java
@@ -284,9 +322,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (VmsSimpleMessageIntegerValuesIndex)
+# Build types.hal (VmsSubscriptionsStateIntegerValuesIndex)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSimpleMessageIntegerValuesIndex.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSubscriptionsStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -296,26 +334,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.VmsSimpleMessageIntegerValuesIndex
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (VmsSubscriptionResponseFormat)
-#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSubscriptionResponseFormat.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.VmsSubscriptionResponseFormat
+ android.hardware.automotive.vehicle@2.1::types.VmsSubscriptionsStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -358,9 +377,9 @@
#
-# Build types.hal (CommonIgnitionMonitors)
+# Build types.hal (DiagnosticFloatSensorIndex)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/CommonIgnitionMonitors.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticFloatSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -370,16 +389,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.CommonIgnitionMonitors
+ android.hardware.automotive.vehicle@2.1::types.DiagnosticFloatSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (CompressionIgnitionMonitors)
+# Build types.hal (DiagnosticIntegerSensorIndex)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/CompressionIgnitionMonitors.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticIntegerSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -389,16 +408,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.CompressionIgnitionMonitors
+ android.hardware.automotive.vehicle@2.1::types.DiagnosticIntegerSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (FuelSystemStatus)
+# Build types.hal (Obd2CommonIgnitionMonitors)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/FuelSystemStatus.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CommonIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -408,16 +427,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.FuelSystemStatus
+ android.hardware.automotive.vehicle@2.1::types.Obd2CommonIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (FuelType)
+# Build types.hal (Obd2CompressionIgnitionMonitors)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/FuelType.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CompressionIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -427,16 +446,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.FuelType
+ android.hardware.automotive.vehicle@2.1::types.Obd2CompressionIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (IgnitionMonitorKind)
+# Build types.hal (Obd2FuelSystemStatus)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IgnitionMonitorKind.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelSystemStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -446,16 +465,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.IgnitionMonitorKind
+ android.hardware.automotive.vehicle@2.1::types.Obd2FuelSystemStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (Obd2FloatSensorIndex)
+# Build types.hal (Obd2FuelType)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FloatSensorIndex.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -465,16 +484,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.Obd2FloatSensorIndex
+ android.hardware.automotive.vehicle@2.1::types.Obd2FuelType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (Obd2IntegerSensorIndex)
+# Build types.hal (Obd2IgnitionMonitorKind)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IntegerSensorIndex.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IgnitionMonitorKind.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -484,16 +503,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.Obd2IntegerSensorIndex
+ android.hardware.automotive.vehicle@2.1::types.Obd2IgnitionMonitorKind
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (SecondaryAirStatus)
+# Build types.hal (Obd2SecondaryAirStatus)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/SecondaryAirStatus.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SecondaryAirStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -503,16 +522,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.SecondaryAirStatus
+ android.hardware.automotive.vehicle@2.1::types.Obd2SecondaryAirStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (SparkIgnitionMonitors)
+# Build types.hal (Obd2SparkIgnitionMonitors)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/SparkIgnitionMonitors.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SparkIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -522,7 +541,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.SparkIgnitionMonitors
+ android.hardware.automotive.vehicle@2.1::types.Obd2SparkIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -548,6 +567,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (VmsAvailabilityStateIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsAvailabilityStateIntegerValuesIndex.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.automotive.vehicle@2.1::types.VmsAvailabilityStateIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (VmsBaseMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsBaseMessageIntegerValuesIndex.java
@@ -567,25 +605,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (VmsDataMessageIntegerValuesIndex)
-#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsDataMessageIntegerValuesIndex.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.VmsDataMessageIntegerValuesIndex
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (VmsMessageType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageType.java
@@ -605,6 +624,44 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (VmsMessageWithLayerAndPublisherIdIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.automotive.vehicle@2.1::types.VmsMessageWithLayerAndPublisherIdIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (VmsMessageWithLayerIntegerValuesIndex)
+#
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageWithLayerIntegerValuesIndex.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.automotive.vehicle@2.1::types.VmsMessageWithLayerIntegerValuesIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (VmsOfferingMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsOfferingMessageIntegerValuesIndex.java
@@ -624,9 +681,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (VmsSimpleMessageIntegerValuesIndex)
+# Build types.hal (VmsSubscriptionsStateIntegerValuesIndex)
#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSimpleMessageIntegerValuesIndex.java
+GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSubscriptionsStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -636,26 +693,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.VmsSimpleMessageIntegerValuesIndex
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (VmsSubscriptionResponseFormat)
-#
-GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSubscriptionResponseFormat.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava \
- -randroid.hardware:hardware/interfaces \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.automotive.vehicle@2.1::types.VmsSubscriptionResponseFormat
+ android.hardware.automotive.vehicle@2.1::types.VmsSubscriptionsStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
diff --git a/automotive/vehicle/2.1/default/common/include/vhal_v2_1/Obd2SensorStore.h b/automotive/vehicle/2.1/default/common/include/vhal_v2_1/Obd2SensorStore.h
index 6c44626..8000695 100644
--- a/automotive/vehicle/2.1/default/common/include/vhal_v2_1/Obd2SensorStore.h
+++ b/automotive/vehicle/2.1/default/common/include/vhal_v2_1/Obd2SensorStore.h
@@ -38,12 +38,12 @@
size_t numVendorFloatSensors);
// Stores an integer-valued sensor.
- V2_0::StatusCode setIntegerSensor(Obd2IntegerSensorIndex index, int32_t value);
+ V2_0::StatusCode setIntegerSensor(DiagnosticIntegerSensorIndex index, int32_t value);
// Stores an integer-valued sensor.
V2_0::StatusCode setIntegerSensor(size_t index, int32_t value);
// Stores a float-valued sensor.
- V2_0::StatusCode setFloatSensor(Obd2FloatSensorIndex index, float value);
+ V2_0::StatusCode setFloatSensor(DiagnosticFloatSensorIndex index, float value);
// Stores a float-valued sensor.
V2_0::StatusCode setFloatSensor(size_t index, float value);
diff --git a/automotive/vehicle/2.1/default/common/src/Obd2SensorStore.cpp b/automotive/vehicle/2.1/default/common/src/Obd2SensorStore.cpp
index f4c63a9..8705e00 100644
--- a/automotive/vehicle/2.1/default/common/src/Obd2SensorStore.cpp
+++ b/automotive/vehicle/2.1/default/common/src/Obd2SensorStore.cpp
@@ -56,9 +56,12 @@
Obd2SensorStore::Obd2SensorStore(size_t numVendorIntegerSensors,
size_t numVendorFloatSensors) {
+ using V2_0::toInt;
// because the last index is valid *inclusive*
- const size_t numSystemIntegerSensors = V2_0::toInt(Obd2IntegerSensorIndex::LAST_SYSTEM_INDEX)+1;
- const size_t numSystemFloatSensors = V2_0::toInt(Obd2FloatSensorIndex::LAST_SYSTEM_INDEX)+1;
+ const size_t numSystemIntegerSensors =
+ toInt(DiagnosticIntegerSensorIndex::LAST_SYSTEM_INDEX)+1;
+ const size_t numSystemFloatSensors =
+ toInt(DiagnosticFloatSensorIndex::LAST_SYSTEM_INDEX)+1;
mIntegerSensors = std::vector<int32_t>(
numSystemIntegerSensors+numVendorIntegerSensors, 0);
mFloatSensors = std::vector<float>(
@@ -66,11 +69,11 @@
mSensorsBitmask.resize(mIntegerSensors.size()+mFloatSensors.size());
}
-V2_0::StatusCode Obd2SensorStore::setIntegerSensor(Obd2IntegerSensorIndex index,
+V2_0::StatusCode Obd2SensorStore::setIntegerSensor(DiagnosticIntegerSensorIndex index,
int32_t value) {
return setIntegerSensor(V2_0::toInt(index), value);
}
-V2_0::StatusCode Obd2SensorStore::setFloatSensor(Obd2FloatSensorIndex index,
+V2_0::StatusCode Obd2SensorStore::setFloatSensor(DiagnosticFloatSensorIndex index,
float value) {
return setFloatSensor(V2_0::toInt(index), value);
}
diff --git a/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp b/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp
index 4faccbd..568d623 100644
--- a/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp
+++ b/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp
@@ -37,85 +37,86 @@
static std::unique_ptr<Obd2SensorStore> fillDefaultObd2Frame(
size_t numVendorIntegerSensors,
size_t numVendorFloatSensors) {
+ using V2_0::toInt;
std::unique_ptr<Obd2SensorStore> sensorStore(new Obd2SensorStore(
numVendorIntegerSensors, numVendorFloatSensors));
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::FUEL_SYSTEM_STATUS,
- V2_0::toInt(FuelSystemStatus::CLOSED_LOOP));
+ DiagnosticIntegerSensorIndex::FUEL_SYSTEM_STATUS,
+ toInt(Obd2FuelSystemStatus::CLOSED_LOOP));
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0);
+ DiagnosticIntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::IGNITION_MONITORS_SUPPORTED,
- V2_0::toInt(IgnitionMonitorKind::SPARK));
- sensorStore->setIntegerSensor(Obd2IntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
- CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
- CommonIgnitionMonitors::MISFIRE_AVAILABLE |
- SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
- SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE);
+ DiagnosticIntegerSensorIndex::IGNITION_MONITORS_SUPPORTED,
+ toInt(Obd2IgnitionMonitorKind::SPARK));
+ sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
+ Obd2CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
+ Obd2CommonIgnitionMonitors::MISFIRE_AVAILABLE |
+ Obd2SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
+ Obd2SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35);
+ DiagnosticIntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS,
- V2_0::toInt(SecondaryAirStatus::FROM_OUTSIDE_OR_OFF));
+ DiagnosticIntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS,
+ toInt(Obd2SecondaryAirStatus::FROM_OUTSIDE_OR_OFF));
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1);
+ DiagnosticIntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500);
+ DiagnosticIntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0);
+ DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51);
+ DiagnosticIntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365);
+ DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30);
+ DiagnosticIntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12);
+ DiagnosticIntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18);
+ DiagnosticIntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1);
+ DiagnosticIntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1);
sensorStore->setIntegerSensor(
- Obd2IntegerSensorIndex::FUEL_TYPE, V2_0::toInt(FuelType::GASOLINE));
+ DiagnosticIntegerSensorIndex::FUEL_TYPE, V2_0::toInt(Obd2FuelType::GASOLINE));
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153);
+ DiagnosticFloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16);
+ DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16);
+ DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16);
+ DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16);
+ DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5);
+ DiagnosticFloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::ENGINE_RPM, 1250.);
+ DiagnosticFloatSensorIndex::ENGINE_RPM, 1250.);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::VEHICLE_SPEED, 40.);
+ DiagnosticFloatSensorIndex::VEHICLE_SPEED, 40.);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::TIMING_ADVANCE, 2.5);
+ DiagnosticFloatSensorIndex::TIMING_ADVANCE, 2.5);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::THROTTLE_POSITION, 19.75);
+ DiagnosticFloatSensorIndex::THROTTLE_POSITION, 19.75);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265);
+ DiagnosticFloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824);
+ DiagnosticFloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, -0.373);
+ DiagnosticFloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, -0.373);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, 190.);
+ DiagnosticFloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, 190.);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.);
+ DiagnosticFloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306);
+ DiagnosticFloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188);
+ DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094);
+ DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094);
sensorStore->setFloatSensor(
- Obd2FloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024);
+ DiagnosticFloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024);
return sensorStore;
}
diff --git a/automotive/vehicle/2.1/types.hal b/automotive/vehicle/2.1/types.hal
index aa62aa6..53feb23 100644
--- a/automotive/vehicle/2.1/types.hal
+++ b/automotive/vehicle/2.1/types.hal
@@ -119,6 +119,8 @@
* bytes is a serialized VMS message as defined in the vms protocol
* which is opaque to the framework;
*
+ * IVehicle#get must always return StatusCode::NOT_AVAILABLE.
+ *
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
@@ -253,28 +255,23 @@
| VehicleArea:GLOBAL),
};
-/** The status of a fuel system as described by the OBD2 specification. */
-enum FuelSystemStatus : int32_t {
+/** The status of the vehicle's fuel system. */
+enum Obd2FuelSystemStatus : int32_t {
OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1,
-
CLOSED_LOOP = 2,
-
OPEN_ENGINE_LOAD_OR_DECELERATION = 4,
-
OPEN_SYSTEM_FAILURE = 8,
-
CLOSED_LOOP_BUT_FEEDBACK_FAULT = 16,
};
/** Defines which ignition monitors are available to be read. */
-enum IgnitionMonitorKind : int32_t {
+enum Obd2IgnitionMonitorKind : int32_t {
SPARK = 0,
-
COMPRESSION = 1,
};
/** These ignition monitors are common to both SPARK and COMPRESSION. */
-enum CommonIgnitionMonitors : int32_t {
+enum Obd2CommonIgnitionMonitors : int32_t {
COMPONENTS_AVAILABLE = 0x1 << 0,
COMPONENTS_INCOMPLETE = 0x1 << 1,
@@ -286,7 +283,7 @@
};
/** Ignition monitors available for SPARK vehicles. */
-enum SparkIgnitionMonitors : CommonIgnitionMonitors {
+enum Obd2SparkIgnitionMonitors : Obd2CommonIgnitionMonitors {
EGR_AVAILABLE = 0x1 << 6,
EGR_INCOMPLETE = 0x1 << 7,
@@ -313,7 +310,7 @@
};
/** Ignition monitors only available for COMPRESSION vehicles. */
-enum CompressionIgnitionMonitors : CommonIgnitionMonitors {
+enum Obd2CompressionIgnitionMonitors : Obd2CommonIgnitionMonitors {
EGR_OR_VVT_AVAILABLE = 0x1 << 6,
EGR_OR_VVT_INCOMPLETE = 0x1 << 7,
@@ -333,63 +330,39 @@
NMHC_CATALYST_INCOMPLETE = 0x1 << 17,
};
-enum SecondaryAirStatus : int32_t {
+/** The status of the vehicle's secondary air system. */
+enum Obd2SecondaryAirStatus : int32_t {
UPSTREAM = 1,
-
DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2,
-
FROM_OUTSIDE_OR_OFF = 4,
-
PUMP_ON_FOR_DIAGNOSTICS = 8,
};
-enum FuelType : int32_t {
+/** The fuel type(s) supported by a vehicle. */
+enum Obd2FuelType : int32_t {
NOT_AVAILABLE = 0,
-
GASOLINE = 1,
-
METHANOL = 2,
-
ETHANOL = 3,
-
DIESEL = 4,
-
LPG = 5,
-
CNG = 6,
-
PROPANE = 7,
-
ELECTRIC = 8,
-
BIFUEL_RUNNING_GASOLINE = 9,
-
BIFUEL_RUNNING_METHANOL = 10,
-
BIFUEL_RUNNING_ETHANOL = 11,
-
BIFUEL_RUNNING_LPG = 12,
-
BIFUEL_RUNNING_CNG = 13,
-
BIFUEL_RUNNING_PROPANE = 14,
-
BIFUEL_RUNNING_ELECTRIC = 15,
-
BIFUEL_RUNNING_ELECTRIC_AND_COMBUSTION = 16,
-
HYBRID_GASOLINE = 17,
-
HYBRID_ETHANOL = 18,
-
HYBRID_DIESEL = 19,
-
HYBRID_ELECTRIC = 20,
-
HYBRID_RUNNING_ELECTRIC_AND_COMBUSTION = 21,
-
HYBRID_REGENERATIVE = 22,
-
BIFUEL_RUNNING_DIESEL = 23,
};
@@ -400,10 +373,9 @@
* 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.
*/
-enum Obd2IntegerSensorIndex : int32_t {
+enum DiagnosticIntegerSensorIndex : int32_t {
/** refer to FuelSystemStatus for a description of this value. */
FUEL_SYSTEM_STATUS = 0,
-
MALFUNCTION_INDICATOR_LIGHT_ON = 1,
/** refer to IgnitionMonitorKind for a description of this value. */
@@ -416,65 +388,38 @@
* CompressionIgnitionMonitors depending on the value of IGNITION_MONITORS_SUPPORTED.
*/
IGNITION_SPECIFIC_MONITORS = 3,
-
INTAKE_AIR_TEMPERATURE = 4,
/** 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,
/** 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,
-
LAST_SYSTEM_INDEX = ENGINE_PERCENT_TORQUE_DATA_POINT4,
};
@@ -483,249 +428,272 @@
* 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.
*/
-enum Obd2FloatSensorIndex : int32_t {
+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,
-
LAST_SYSTEM_INDEX = ENGINE_FUEL_RATE,
};
/**
- * This enum lists the types of supported VMS messages.
+ * This enum lists the types of supported VMS messages. It is used as the first
+ * integer in the vehicle property integers array and determines how the rest of
+ * the message is decoded.
*/
enum VmsMessageType : int32_t {
- /** A client subscribes to a layer. */
+ /**
+ * A request from the subscribers to the VMS service to subscribe to a layer.
+ *
+ * This message type uses enum VmsMessageWithLayerIntegerValuesIndex.
+ */
SUBSCRIBE = 1,
- /** A client unsubscribes from a layer. */
- UNSUBSCRIBE = 2,
+ /**
+ * A request from the subscribers to the VMS service to subscribe to a layer from a specific publisher.
+ *
+ * This message type uses enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.
+ */
+ SUBSCRIBE_TO_PUBLISHER = 2,
- /** A client publishes a data packet. */
- DATA = 3,
+ /**
+ * A request from the subscribers to the VMS service to unsubscribes from a layer.
+ *
+ * This message type uses enum VmsMessageWithLayerIntegerValuesIndex.
+ */
+ UNSUBSCRIBE = 3,
- /** A client declaring layers offering. */
- OFFERING = 4,
+ /**
+ * A request from the subscribers to the VMS service to unsubscribes from a layer from a specific publisher.
+ *
+ * This message type uses enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.
+ */
+ UNSUBSCRIBE_TO_PUBLISHER = 4,
- /** Requesting the list of available layers. */
- AVAILABILITY_REQUEST = 5,
+ /**
+ * Information from the publishers to the VMS service about the layers which the client can publish.
+ *
+ * This message type uses enum VmsOfferingMessageIntegerValuesIndex.
+ */
+ OFFERING = 5,
- /** Returning the list of available layers. */
- AVAILABILITY_RESPONSE = 6,
+ /**
+ * A request from the subscribers to the VMS service to get the available layers.
+ *
+ * This message type uses enum VmsBaseMessageIntegerValuesIndex.
+ */
+ AVAILABILITY_REQUEST = 6,
- /** Sending to the HAL the current list of the available layers. */
- AVAILABILITY_CHANGE = 7,
+ /**
+ * A request from the publishers to the VMS service to get the layers with subscribers.
+ *
+ * This message type uses enum VmsBaseMessageIntegerValuesIndex.
+ */
+ SUBSCRIPTIONS_REQUEST = 7,
- /** Requesting layers that have subscribers. */
- SUBSCRIPTIONS_REQUEST = 8,
+ /**
+ * A response from the VMS service to the subscribers to a VmsMessageType.AVAILABILITY_REQUEST
+ *
+ * This message type uses enum VmsAvailabilityStateIntegerValuesIndex.
+ */
+ AVAILABILITY_RESPONSE = 8,
- /** Returning layers that have subscribers. */
- SUBSCRIPTIONS_RESPONSE = 9,
+ /**
+ * A notification from the VMS service to the subscribers on a change in the available layers.
+ *
+ * This message type uses enum VmsAvailabilityStateIntegerValuesIndex.
+ */
+ AVAILABILITY_CHANGE = 9,
- /** Sending to the HAL the current list of the subscribed layers. */
- SUBSCRIPTIONS_CHANGE = 10,
+ /**
+ * A response from the VMS service to the publishers to a VmsMessageType.SUBSCRIPTIONS_REQUEST
+ *
+ * This message type uses enum VmsSubscriptionsStateIntegerValuesIndex.
+ */
+ SUBSCRIPTIONS_RESPONSE = 10,
+
+ /**
+ * A notification from the VMS service to the publishers on a change in the layers with subscribers.
+ *
+ * This message type uses enum VmsSubscriptionsStateIntegerValuesIndex.
+ */
+ SUBSCRIPTIONS_CHANGE = 11,
+
+ /**
+ * A message from the VMS service to the subscribers or from the publishers to the VMS service
+ * with a serialized VMS data packet as defined in the VMS protocol.
+ *
+ * This message type uses enum VmsBaseMessageIntegerValuesIndex.
+ */
+ DATA = 12,
};
/**
- * This enum provides the canonical mapping for VMS properties that have an
- * integer value.
+ * Every VMS message starts with the type of the message from the VmsMessageType enum.
+ * Messages with no parameters such as VmsMessageType.AVAILABILITY_REQUEST,
+ * VmsMessageType.SUBSCRIPTIONS_REQUEST and VmsMessageType.DATA are also based on this enum.
*/
enum VmsBaseMessageIntegerValuesIndex : int32_t {
/* The message type as enumerated by VmsMessageType enum. */
- VMS_MESSAGE_TYPE = 0,
+ MESSAGE_TYPE = 0,
};
/*
- * This enum provides the canonical mapping for VMS SUBMIT and UNSUBMIT
- * messages integer value properties.
+ * A VMS message with a layer is sent as part of a VmsMessageType.SUBSCRIBE or
+ * VmsMessageType.UNSUBSCRIBE messages.
+ *
+ * The layer type is defined in the VMS protocol, and the subtype and version are
+ * controlled by the implementer of the publisher.
*/
-enum VmsSimpleMessageIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
- /* The layer ID as defined in the vms protocol. */
- VMS_LAYER_ID = 1,
+enum VmsMessageWithLayerIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
+ LAYER_TYPE = 1,
- /* The version of the VMS layer. */
- VMS_LAYER_VERSION = 2,
+ LAYER_SUBTYPE = 2,
- /* The layer type as defined in the vms protocol */
- VMS_LAYER_SUB_TYPE = 3,
+ LAYER_VERSION = 3,
};
/*
- * This enum provides the canonical mapping for VMS DATA
- * message integer value properties.
+ * A VMS message with a layer and publisher ID is sent as part of a
+ * VmsMessageType.SUBSCRIBE_TO_PUBLISHER and VmsMessageType.UNSUBSCRIBE_TO_PUBLISHER messages.
*/
-enum VmsDataMessageIntegerValuesIndex : VmsSimpleMessageIntegerValuesIndex {
- /* A publisher ID of the client that published this message. */
- VMS_PUBLISHER_ID = 4,
+enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex : VmsMessageWithLayerIntegerValuesIndex {
+ PUBLISHER_ID = 4,
};
/*
- * This enum provides the canonical mapping for VMS offering messages integer
- * value properties
+ * An offering can be sent by publishers as part of VmsMessageType.OFFERING in order to
+ * advertise which layers they can publish and under which constraints: e.g., I can publish Layer X
+ * if someone else will publish Layer Y.
+ * The offering contains the publisher ID which was assigned to the publisher by the VMS service.
+ * A single offering is represented as:
+ * - Layer type
+ * - Layer subtype
+ * - Layer version
+ * - Number of dependencies (N)
+ * - N x (Layer type, Layer subtype, Layer version)
*/
enum VmsOfferingMessageIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
- /* The ID assigend to the publisher by the VMS core. */
PUBLISHER_ID = 1,
- /* The number of VMS layer dependencies. */
- VMS_NUMBER_OF_LAYERS_DEPENDENCIES = 2,
+ NUMBER_OF_OFFERS = 2,
- /* The first index that contain dependencies */
- FIRST_DEPENDENCIES_INDEX = 3,
+ OFFERING_START = 3,
};
/**
- * A VMS subscription request only contains its message type. The format of a VMS subscription
- * response is described below.
+ * A subscriptions state is sent to the publishers in response to a change in the subscriptions
+ * as part of a VmsMessageType.SUBSCRIPTIONS_CHANGE, or in response to a
+ * VmsMessageType.SUBSCRIPTIONS_REQUEST message as part of VmsMessageType.SUBSCRIPTIONS_RESPONSE.
+ * The VMS service issues monotonically increasing sequence numbers, and in case a subscriber receives
+ * a smaller sequnce number it should ignore the message.
+ * The subscriptions are sent as a list of layers followed by a list of associated layers:
+ * {Sequence number, N, M, N x layer, M x associated layer}
+ * A subscribed layer is represented as three integers:
+ * - Layer type
+ * - Layer subtype
+ * - Layer version
+ * A subscribed associated layer is a layer with a list of publisher IDs. It is represented as:
+ * - Layer type
+ * - Layer subtype
+ * - Layer version
+ * - Number of publisher IDs (N)
+ * - N x publisher ID
*/
-enum VmsSubscriptionResponseFormat : VmsBaseMessageIntegerValuesIndex {
- /**
- * Recipients should ignore any packet with a sequence number that is less than the highest
- * sequence number they have seen thus far.
- */
+enum VmsSubscriptionsStateIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
SEQUENCE_NUMBER = 1,
- /** The number of VMS layers. Each layer has two integers: type and version. */
NUMBER_OF_LAYERS = 2,
- /** The first index that contains a layer. */
- FIRST_LAYER = 3,
+ NUMBER_OF_ASSOCIATED_LAYERS = 3,
+
+ SUBSCRIPTIONS_START = 4,
+};
+
+/**
+ * An availability state is sent to the subscribers in response to a change in the available
+ * layers as part of a VmsMessageType.AVAILABILITY_CHANGE message, or in response to a
+ * VmsMessageType.AVAILABILITY_REQUEST message as part of a VmsMessageType.AVAILABILITY_RESPONSE.
+ * The VMS service issues monotonically increasing sequence numbers, and in case a subscriber receives
+ * a smaller sequnce number, it should ignore the message.
+ * An available associated layer is a layer with a list of publisher IDs:
+ * - Layer type
+ * - Layer subtype
+ * - Layer version
+ * - Number of publisher IDs (N)
+ * - N x publisher ID
+*/
+enum VmsAvailabilityStateIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
+ SEQUENCE_NUMBER = 1,
+
+ NUMBER_OF_ASSOCIATED_LAYERS = 2,
+
+ LAYERS_START = 3,
};
diff --git a/broadcastradio/1.0/types.hal b/broadcastradio/1.0/types.hal
index e9ac4b7..8c3ec11 100644
--- a/broadcastradio/1.0/types.hal
+++ b/broadcastradio/1.0/types.hal
@@ -212,12 +212,23 @@
uint32_t channel; /** current channel. (e.g kHz for band type AM_FM) */
uint32_t subChannel; /** current sub channel. (FM_HD) */
- /** Tuned to a program (not a noise). It's the same condition that would stop scan operation. */
+ /**
+ * Tuned to a program (not a noise). It's the same condition that would
+ * stop scan operation.
+ */
bool tuned;
bool stereo; /** program is stereo or not */
bool digital; /** digital program or not (e.g HD Radio program) */
- uint32_t signalStrength; /** signal strength from 0 to 100 */
- vec<MetaData> metadata; /** non empty if meta data are present (e.g PTY, song title ...) */
+
+ /**
+ * Signal quality measured in 0% to 100% range.
+ *
+ * Despite the name, this is not a signal strength.
+ * The purpose of this field is primarily informative.
+ */
+ uint32_t signalStrength;
+
+ vec<MetaData> metadata; /** Metadata: PTY, song title etc. */
};
diff --git a/broadcastradio/1.1/ITuner.hal b/broadcastradio/1.1/ITuner.hal
index a5c569a..cc2e58d 100644
--- a/broadcastradio/1.1/ITuner.hal
+++ b/broadcastradio/1.1/ITuner.hal
@@ -84,6 +84,13 @@
* subsequent calls to startBackgroundScan, issuing a single
* backgroundScanComplete callback.
*
+ * If a device supports continuous background scanning, it may succeed
+ * (return OK and call backgroundScanComplete) without any additional
+ * operation performed.
+ *
+ * Foreground scanning may be implemented in the front end app with
+ * @1.0::ITuner scan operation.
+ *
* @return result OK if the scan was properly scheduled (this does not mean
* it successfully finished).
* UNAVAILABLE if the background scan is unavailable,
diff --git a/broadcastradio/1.1/default/BroadcastRadio.cpp b/broadcastradio/1.1/default/BroadcastRadio.cpp
index 7916407..17ec780 100644
--- a/broadcastradio/1.1/default/BroadcastRadio.cpp
+++ b/broadcastradio/1.1/default/BroadcastRadio.cpp
@@ -143,7 +143,7 @@
mTuner = nullptr;
}
- sp<Tuner> newTuner = new Tuner(callback);
+ sp<Tuner> newTuner = new Tuner(mClassId, callback);
mTuner = newTuner;
if (mClassId == Class::AM_FM) {
auto ret = newTuner->setConfiguration(config);
diff --git a/broadcastradio/1.1/default/Tuner.cpp b/broadcastradio/1.1/default/Tuner.cpp
index 0a45208..f48a8db 100644
--- a/broadcastradio/1.1/default/Tuner.cpp
+++ b/broadcastradio/1.1/default/Tuner.cpp
@@ -20,7 +20,7 @@
#include "BroadcastRadio.h"
#include "Tuner.h"
-#include <Utils.h>
+#include <broadcastradio-utils/Utils.h>
#include <log/log.h>
namespace android {
@@ -33,7 +33,9 @@
using V1_0::Band;
using V1_0::BandConfig;
+using V1_0::Class;
using V1_0::Direction;
+using utils::HalRevision;
using std::chrono::milliseconds;
using std::lock_guard;
@@ -49,13 +51,12 @@
milliseconds tune = 150ms;
} gDefaultDelay;
-Tuner::Tuner(const sp<V1_0::ITunerCallback>& callback)
- : mCallback(callback),
+Tuner::Tuner(V1_0::Class classId, const sp<V1_0::ITunerCallback>& callback)
+ : mClassId(classId),
+ mCallback(callback),
mCallback1_1(ITunerCallback::castFrom(callback).withDefault(nullptr)),
- mVirtualFm(make_fm_radio()) {
- // TODO (b/36864090): inject this data in a more elegant way
- setCompatibilityLevel(mCallback1_1 == nullptr ? 1 : 2);
-}
+ mVirtualRadio(getRadio(classId)),
+ mIsAnalogForced(false) {}
void Tuner::forceClose() {
lock_guard<mutex> lk(mMut);
@@ -65,6 +66,12 @@
Return<Result> Tuner::setConfiguration(const BandConfig& config) {
ALOGV("%s", __func__);
+ lock_guard<mutex> lk(mMut);
+ if (mIsClosed) return Result::NOT_INITIALIZED;
+ if (mClassId != Class::AM_FM) {
+ ALOGE("Can't set AM/FM configuration on SAT/DT radio tuner");
+ return Result::INVALID_STATE;
+ }
if (config.lowerLimit >= config.upperLimit) return Result::INVALID_ARGUMENTS;
@@ -76,6 +83,12 @@
mAmfmConfig.antennaConnected = true;
mCurrentProgram = utils::make_selector(mAmfmConfig.type, mAmfmConfig.lowerLimit);
+ if (mAmfmConfig.type == Band::FM_HD || mAmfmConfig.type == Band::FM) {
+ mVirtualRadio = std::ref(getFmRadio());
+ } else {
+ mVirtualRadio = std::ref(getAmRadio());
+ }
+
mIsAmfmConfigSet = true;
mCallback->configChange(Result::OK, mAmfmConfig);
};
@@ -86,14 +99,14 @@
Return<void> Tuner::getConfiguration(getConfiguration_cb _hidl_cb) {
ALOGV("%s", __func__);
-
lock_guard<mutex> lk(mMut);
- if (mIsAmfmConfigSet) {
+
+ if (!mIsClosed && mIsAmfmConfigSet) {
_hidl_cb(Result::OK, mAmfmConfig);
} else {
_hidl_cb(Result::NOT_INITIALIZED, {});
}
- return Void();
+ return {};
}
// makes ProgramInfo that points to no program
@@ -108,21 +121,19 @@
return info11;
}
-bool Tuner::isFmLocked() {
- if (!utils::isAmFm(utils::getType(mCurrentProgram))) return false;
- return mAmfmConfig.type == Band::FM_HD || mAmfmConfig.type == Band::FM;
+HalRevision Tuner::getHalRev() const {
+ if (mCallback1_1 != nullptr) {
+ return HalRevision::V1_1;
+ } else {
+ return HalRevision::V1_0;
+ }
}
void Tuner::tuneInternalLocked(const ProgramSelector& sel) {
- VirtualRadio* virtualRadio = nullptr;
- if (isFmLocked()) {
- virtualRadio = &mVirtualFm;
- }
-
VirtualProgram virtualProgram;
- if (virtualRadio != nullptr && virtualRadio->getProgram(sel, virtualProgram)) {
+ if (mVirtualRadio.get().getProgram(sel, virtualProgram)) {
mCurrentProgram = virtualProgram.selector;
- mCurrentProgramInfo = static_cast<ProgramInfo>(virtualProgram);
+ mCurrentProgramInfo = virtualProgram.getProgramInfo(getHalRev());
} else {
mCurrentProgram = sel;
mCurrentProgramInfo = makeDummyProgramInfo(sel);
@@ -139,11 +150,9 @@
Return<Result> Tuner::scan(Direction direction, bool skipSubChannel __unused) {
ALOGV("%s", __func__);
lock_guard<mutex> lk(mMut);
- vector<VirtualProgram> list;
+ if (mIsClosed) return Result::NOT_INITIALIZED;
- if (isFmLocked()) {
- list = mVirtualFm.getProgramList();
- }
+ auto list = mVirtualRadio.get().getProgramList();
if (list.empty()) {
mIsTuneCompleted = false;
@@ -195,9 +204,10 @@
Return<Result> Tuner::step(Direction direction, bool skipSubChannel) {
ALOGV("%s", __func__);
- ALOGW_IF(!skipSubChannel, "can't step to next frequency without ignoring subChannel");
-
lock_guard<mutex> lk(mMut);
+ if (mIsClosed) return Result::NOT_INITIALIZED;
+
+ ALOGW_IF(!skipSubChannel, "can't step to next frequency without ignoring subChannel");
if (!utils::isAmFm(utils::getType(mCurrentProgram))) {
ALOGE("Can't step in anything else than AM/FM");
@@ -243,8 +253,8 @@
Return<Result> Tuner::tune_1_1(const ProgramSelector& sel) {
ALOGV("%s(%s)", __func__, toString(sel).c_str());
-
lock_guard<mutex> lk(mMut);
+ if (mIsClosed) return Result::NOT_INITIALIZED;
if (utils::isAmFm(utils::getType(mCurrentProgram))) {
ALOGW_IF(!mIsAmfmConfigSet, "AM/FM config not set");
@@ -268,12 +278,18 @@
Return<Result> Tuner::cancel() {
ALOGV("%s", __func__);
+ lock_guard<mutex> lk(mMut);
+ if (mIsClosed) return Result::NOT_INITIALIZED;
+
mThread.cancelAll();
return Result::OK;
}
Return<Result> Tuner::cancelAnnouncement() {
ALOGV("%s", __func__);
+ lock_guard<mutex> lk(mMut);
+ if (mIsClosed) return Result::NOT_INITIALIZED;
+
return Result::OK;
}
@@ -286,49 +302,59 @@
Return<void> Tuner::getProgramInformation_1_1(getProgramInformation_1_1_cb _hidl_cb) {
ALOGV("%s", __func__);
-
lock_guard<mutex> lk(mMut);
- if (mIsTuneCompleted) {
+
+ if (mIsClosed) {
+ _hidl_cb(Result::NOT_INITIALIZED, {});
+ } else if (mIsTuneCompleted) {
_hidl_cb(Result::OK, mCurrentProgramInfo);
} else {
_hidl_cb(Result::NOT_INITIALIZED, makeDummyProgramInfo(mCurrentProgram));
}
- return Void();
+ return {};
}
Return<ProgramListResult> Tuner::startBackgroundScan() {
ALOGV("%s", __func__);
+ lock_guard<mutex> lk(mMut);
+ if (mIsClosed) return ProgramListResult::NOT_INITIALIZED;
+
return ProgramListResult::UNAVAILABLE;
}
-Return<void> Tuner::getProgramList(const hidl_string& filter __unused, getProgramList_cb _hidl_cb) {
- ALOGV("%s", __func__);
+Return<void> Tuner::getProgramList(const hidl_string& filter, getProgramList_cb _hidl_cb) {
+ ALOGV("%s(%s)", __func__, filter.c_str());
lock_guard<mutex> lk(mMut);
-
- auto& virtualRadio = mVirtualFm;
- if (!isFmLocked()) {
- ALOGI("bands other than FM are not supported yet");
- _hidl_cb(ProgramListResult::OK, {});
- return Void();
+ if (mIsClosed) {
+ _hidl_cb(ProgramListResult::NOT_INITIALIZED, {});
+ return {};
}
- auto list = virtualRadio.getProgramList();
+ auto list = mVirtualRadio.get().getProgramList();
ALOGD("returning a list of %zu programs", list.size());
- _hidl_cb(ProgramListResult::OK, vector<ProgramInfo>(list.begin(), list.end()));
- return Void();
+ _hidl_cb(ProgramListResult::OK, getProgramInfoVector(list, getHalRev()));
+ return {};
}
Return<void> Tuner::isAnalogForced(isAnalogForced_cb _hidl_cb) {
ALOGV("%s", __func__);
- // TODO(b/36864090): implement
- _hidl_cb(Result::INVALID_STATE, false);
- return Void();
+ lock_guard<mutex> lk(mMut);
+
+ if (mIsClosed) {
+ _hidl_cb(Result::NOT_INITIALIZED, false);
+ } else {
+ _hidl_cb(Result::OK, mIsAnalogForced);
+ }
+ return {};
}
-Return<Result> Tuner::setAnalogForced(bool isForced __unused) {
+Return<Result> Tuner::setAnalogForced(bool isForced) {
ALOGV("%s", __func__);
- // TODO(b/36864090): implement
- return Result::INVALID_STATE;
+ lock_guard<mutex> lk(mMut);
+ if (mIsClosed) return Result::NOT_INITIALIZED;
+
+ mIsAnalogForced = isForced;
+ return Result::OK;
}
} // namespace implementation
diff --git a/broadcastradio/1.1/default/Tuner.h b/broadcastradio/1.1/default/Tuner.h
index 2ab4f40..c4efe6e 100644
--- a/broadcastradio/1.1/default/Tuner.h
+++ b/broadcastradio/1.1/default/Tuner.h
@@ -18,9 +18,9 @@
#include "VirtualRadio.h"
-#include <WorkerThread.h>
#include <android/hardware/broadcastradio/1.1/ITuner.h>
#include <android/hardware/broadcastradio/1.1/ITunerCallback.h>
+#include <broadcastradio-utils/WorkerThread.h>
namespace android {
namespace hardware {
@@ -29,7 +29,7 @@
namespace implementation {
struct Tuner : public ITuner {
- Tuner(const sp<V1_0::ITunerCallback>& callback);
+ Tuner(V1_0::Class classId, const sp<V1_0::ITunerCallback>& callback);
void forceClose();
@@ -53,21 +53,22 @@
private:
std::mutex mMut;
WorkerThread mThread;
- bool mIsClosed = false; // TODO(b/36864090): use it
+ bool mIsClosed = false;
+ V1_0::Class mClassId;
const sp<V1_0::ITunerCallback> mCallback;
const sp<V1_1::ITunerCallback> mCallback1_1;
- VirtualRadio mVirtualFm;
-
+ std::reference_wrapper<VirtualRadio> mVirtualRadio;
bool mIsAmfmConfigSet = false;
V1_0::BandConfig mAmfmConfig;
bool mIsTuneCompleted = false;
ProgramSelector mCurrentProgram = {};
ProgramInfo mCurrentProgramInfo = {};
+ std::atomic<bool> mIsAnalogForced;
+ utils::HalRevision getHalRev() const;
void tuneInternalLocked(const ProgramSelector& sel);
- bool isFmLocked(); // TODO(b/36864090): make it generic, not FM only
};
} // namespace implementation
diff --git a/broadcastradio/1.1/default/VirtualProgram.cpp b/broadcastradio/1.1/default/VirtualProgram.cpp
index 1f3b693..1c2285d 100644
--- a/broadcastradio/1.1/default/VirtualProgram.cpp
+++ b/broadcastradio/1.1/default/VirtualProgram.cpp
@@ -15,7 +15,7 @@
*/
#include "VirtualProgram.h"
-#include <Utils.h>
+#include <broadcastradio-utils/Utils.h>
#include "resources.h"
@@ -25,28 +25,24 @@
namespace V1_1 {
namespace implementation {
+using std::vector;
+
using V1_0::MetaData;
using V1_0::MetadataKey;
using V1_0::MetadataType;
+using utils::HalRevision;
-// TODO (b/36864090): inject this data in a more elegant way
-static int gHalVersion = 2; // 1 = 1.0, 2 = 1.1
-
-void setCompatibilityLevel(int halversion) {
- gHalVersion = halversion;
-}
-
-static MetaData createDemoBitmap(MetadataKey key) {
+static MetaData createDemoBitmap(MetadataKey key, HalRevision halRev) {
MetaData bmp = {MetadataType::INT, key, resources::demoPngId, {}, {}, {}};
- if (gHalVersion < 2) {
+ if (halRev < HalRevision::V1_1) {
bmp.type = MetadataType::RAW;
bmp.intValue = 0;
- bmp.rawValue = std::vector<uint8_t>(resources::demoPng, std::end(resources::demoPng));
+ bmp.rawValue = hidl_vec<uint8_t>(resources::demoPng, std::end(resources::demoPng));
}
return bmp;
}
-VirtualProgram::operator ProgramInfo() const {
+ProgramInfo VirtualProgram::getProgramInfo(HalRevision halRev) const {
ProgramInfo info11 = {};
auto& info10 = info11.base;
@@ -61,8 +57,8 @@
{MetadataType::TEXT, MetadataKey::RDS_PS, {}, {}, programName, {}},
{MetadataType::TEXT, MetadataKey::TITLE, {}, {}, songTitle, {}},
{MetadataType::TEXT, MetadataKey::ARTIST, {}, {}, songArtist, {}},
- createDemoBitmap(MetadataKey::ICON),
- createDemoBitmap(MetadataKey::ART),
+ createDemoBitmap(MetadataKey::ICON, halRev),
+ createDemoBitmap(MetadataKey::ART, halRev),
});
return info11;
@@ -89,6 +85,15 @@
return false;
}
+vector<ProgramInfo> getProgramInfoVector(const vector<VirtualProgram>& vec, HalRevision halRev) {
+ vector<ProgramInfo> out;
+ out.reserve(vec.size());
+ for (auto&& program : vec) {
+ out.push_back(program.getProgramInfo(halRev));
+ }
+ return out;
+}
+
} // namespace implementation
} // namespace V1_1
} // namespace broadcastradio
diff --git a/broadcastradio/1.1/default/VirtualProgram.h b/broadcastradio/1.1/default/VirtualProgram.h
index 2ee21a7..a14830d 100644
--- a/broadcastradio/1.1/default/VirtualProgram.h
+++ b/broadcastradio/1.1/default/VirtualProgram.h
@@ -17,7 +17,7 @@
#define ANDROID_HARDWARE_BROADCASTRADIO_V1_1_VIRTUALPROGRAM_H
#include <android/hardware/broadcastradio/1.1/types.h>
-#include <cstdint>
+#include <broadcastradio-utils/Utils.h>
namespace android {
namespace hardware {
@@ -25,9 +25,12 @@
namespace V1_1 {
namespace implementation {
-// TODO (b/36864090): inject this data in a more elegant way
-void setCompatibilityLevel(int halversion);
-
+/**
+ * A radio program mock.
+ *
+ * This represents broadcast waves flying over the air,
+ * not an entry for a captured station in the radio tuner memory.
+ */
struct VirtualProgram {
ProgramSelector selector;
@@ -35,10 +38,14 @@
std::string songArtist = "";
std::string songTitle = "";
- explicit operator ProgramInfo() const;
+ ProgramInfo getProgramInfo(utils::HalRevision halRev) const;
+
friend bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs);
};
+std::vector<ProgramInfo> getProgramInfoVector(const std::vector<VirtualProgram>& vec,
+ utils::HalRevision halRev);
+
} // namespace implementation
} // namespace V1_1
} // namespace broadcastradio
diff --git a/broadcastradio/1.1/default/VirtualRadio.cpp b/broadcastradio/1.1/default/VirtualRadio.cpp
index 89b2b0a..36d47a9 100644
--- a/broadcastradio/1.1/default/VirtualRadio.cpp
+++ b/broadcastradio/1.1/default/VirtualRadio.cpp
@@ -13,9 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#define LOG_TAG "BroadcastRadioDefault.VirtualRadio"
+//#define LOG_NDEBUG 0
+
#include "VirtualRadio.h"
-#include <Utils.h>
+#include <broadcastradio-utils/Utils.h>
+#include <log/log.h>
namespace android {
namespace hardware {
@@ -24,6 +28,7 @@
namespace implementation {
using V1_0::Band;
+using V1_0::Class;
using std::lock_guard;
using std::move;
@@ -32,7 +37,7 @@
using utils::make_selector;
-const vector<VirtualProgram> gInitialFmPrograms{
+static const vector<VirtualProgram> gInitialFmPrograms{
{make_selector(Band::FM, 94900), "Wild 94.9", "Drake ft. Rihanna", "Too Good"},
{make_selector(Band::FM, 96500), "KOIT", "Celine Dion", "All By Myself"},
{make_selector(Band::FM, 97300), "Alice@97.3", "Drops of Jupiter", "Train"},
@@ -42,7 +47,8 @@
{make_selector(Band::FM, 106100), "106 KMEL", "Drake", "Marvins Room"},
};
-VirtualRadio::VirtualRadio(VirtualRadio&& o) : mPrograms(move(o.mPrograms)) {}
+static VirtualRadio gEmptyRadio({});
+static VirtualRadio gFmRadio(gInitialFmPrograms);
VirtualRadio::VirtualRadio(const vector<VirtualProgram> initialList) : mPrograms(initialList) {}
@@ -62,8 +68,34 @@
return false;
}
-VirtualRadio make_fm_radio() {
- return VirtualRadio(gInitialFmPrograms);
+VirtualRadio& getRadio(V1_0::Class classId) {
+ switch (classId) {
+ case Class::AM_FM:
+ return getFmRadio();
+ case Class::SAT:
+ return getSatRadio();
+ case Class::DT:
+ return getDigitalRadio();
+ default:
+ ALOGE("Invalid class ID");
+ return gEmptyRadio;
+ }
+}
+
+VirtualRadio& getAmRadio() {
+ return gEmptyRadio;
+}
+
+VirtualRadio& getFmRadio() {
+ return gFmRadio;
+}
+
+VirtualRadio& getSatRadio() {
+ return gEmptyRadio;
+}
+
+VirtualRadio& getDigitalRadio() {
+ return gEmptyRadio;
}
} // namespace implementation
diff --git a/broadcastradio/1.1/default/VirtualRadio.h b/broadcastradio/1.1/default/VirtualRadio.h
index 4cdc72f..3c7ae5c 100644
--- a/broadcastradio/1.1/default/VirtualRadio.h
+++ b/broadcastradio/1.1/default/VirtualRadio.h
@@ -27,9 +27,16 @@
namespace V1_1 {
namespace implementation {
+/**
+ * A radio frequency space mock.
+ *
+ * This represents all broadcast waves in the air for a given radio technology,
+ * not a captured station list in the radio tuner memory.
+ *
+ * It's meant to abstract out radio content from default tuner implementation.
+ */
class VirtualRadio {
public:
- VirtualRadio(VirtualRadio&& o);
VirtualRadio(const std::vector<VirtualProgram> initialList);
std::vector<VirtualProgram> getProgramList();
@@ -40,7 +47,29 @@
std::vector<VirtualProgram> mPrograms;
};
-VirtualRadio make_fm_radio();
+/**
+ * Get virtual radio space for a given radio class.
+ *
+ * As a space, each virtual radio always exists. For example, DAB frequencies
+ * exists in US, but contains no programs.
+ *
+ * The lifetime of the virtual radio space is virtually infinite, but for the
+ * needs of default implementation, it's bound with the lifetime of default
+ * implementation process.
+ *
+ * Internally, it's a static object, so trying to access the reference during
+ * default implementation library unloading may result in segmentation fault.
+ * It's unlikely for testing purposes.
+ *
+ * @param classId A class of radio technology.
+ * @return A reference to virtual radio space for a given technology.
+ */
+VirtualRadio& getRadio(V1_0::Class classId);
+
+VirtualRadio& getAmRadio();
+VirtualRadio& getFmRadio();
+VirtualRadio& getSatRadio();
+VirtualRadio& getDigitalRadio();
} // namespace implementation
} // namespace V1_1
diff --git a/broadcastradio/1.1/tests/WorkerThread_test.cpp b/broadcastradio/1.1/tests/WorkerThread_test.cpp
index a0e0ebb..ed36de3 100644
--- a/broadcastradio/1.1/tests/WorkerThread_test.cpp
+++ b/broadcastradio/1.1/tests/WorkerThread_test.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include <WorkerThread.h>
+#include <broadcastradio-utils/WorkerThread.h>
#include <gtest/gtest.h>
namespace {
diff --git a/broadcastradio/1.1/utils/Android.bp b/broadcastradio/1.1/utils/Android.bp
index 73c6680..e80d133 100644
--- a/broadcastradio/1.1/utils/Android.bp
+++ b/broadcastradio/1.1/utils/Android.bp
@@ -27,7 +27,7 @@
"Utils.cpp",
"WorkerThread.cpp",
],
- export_include_dirs: ["."],
+ export_include_dirs: ["include"],
shared_libs: [
"android.hardware.broadcastradio@1.1",
],
diff --git a/broadcastradio/1.1/utils/Utils.cpp b/broadcastradio/1.1/utils/Utils.cpp
index f8a4479..50a407c 100644
--- a/broadcastradio/1.1/utils/Utils.cpp
+++ b/broadcastradio/1.1/utils/Utils.cpp
@@ -16,7 +16,7 @@
#define LOG_TAG "BroadcastRadioDefault.utils"
//#define LOG_NDEBUG 0
-#include "Utils.h"
+#include <broadcastradio-utils/Utils.h>
#include <log/log.h>
@@ -53,7 +53,9 @@
static bool haveEqualIds(const ProgramSelector& a, const ProgramSelector& b,
const IdentifierType type) {
if (!bothHaveId(a, b, type)) return false;
- // TODO(b/36864090): we should check all Ids of a given type (ie. other AF), not just one
+ /* We should check all Ids of a given type (ie. other AF),
+ * but it doesn't matter for default implementation.
+ */
auto aId = getId(a, type);
auto bId = getId(b, type);
return aId == bId;
@@ -208,6 +210,26 @@
} // namespace utils
} // namespace V1_1
+
+namespace V1_0 {
+
+bool operator==(const BandConfig& l, const BandConfig& r) {
+ if (l.type != r.type) return false;
+ if (l.antennaConnected != r.antennaConnected) return false;
+ 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) {
+ return l.ext.am == r.ext.am;
+ } else if (l.type == Band::FM || l.type == Band::FM_HD) {
+ return l.ext.fm == r.ext.fm;
+ } else {
+ ALOGW("Unsupported band config type: %s", toString(l.type).c_str());
+ return false;
+ }
+}
+
+} // namespace V1_0
} // namespace broadcastradio
} // namespace hardware
} // namespace android
diff --git a/broadcastradio/1.1/utils/WorkerThread.cpp b/broadcastradio/1.1/utils/WorkerThread.cpp
index a3ceaa1..bfcbb39 100644
--- a/broadcastradio/1.1/utils/WorkerThread.cpp
+++ b/broadcastradio/1.1/utils/WorkerThread.cpp
@@ -17,7 +17,7 @@
#define LOG_TAG "WorkerThread"
//#define LOG_NDEBUG 0
-#include "WorkerThread.h"
+#include <broadcastradio-utils/WorkerThread.h>
#include <log/log.h>
diff --git a/broadcastradio/1.1/utils/Utils.h b/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
similarity index 90%
rename from broadcastradio/1.1/utils/Utils.h
rename to broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
index cd86ffa..4d69c0a 100644
--- a/broadcastradio/1.1/utils/Utils.h
+++ b/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
@@ -27,6 +27,12 @@
namespace V1_1 {
namespace utils {
+// TODO(b/64115813): move it out from frameworks/base/services/core/jni/BroadcastRadio/types.h
+enum class HalRevision : uint32_t {
+ V1_0 = 1,
+ V1_1,
+};
+
/**
* Checks, if {@code pointer} tunes to {@channel}.
*
@@ -66,6 +72,13 @@
} // namespace utils
} // namespace V1_1
+
+namespace V1_0 {
+
+bool operator==(const BandConfig& l, const BandConfig& r);
+
+} // namespace V1_0
+
} // namespace broadcastradio
} // namespace hardware
} // namespace android
diff --git a/broadcastradio/1.1/utils/WorkerThread.h b/broadcastradio/1.1/utils/include/broadcastradio-utils/WorkerThread.h
similarity index 100%
rename from broadcastradio/1.1/utils/WorkerThread.h
rename to broadcastradio/1.1/utils/include/broadcastradio-utils/WorkerThread.h
diff --git a/broadcastradio/1.1/vts/functional/Android.bp b/broadcastradio/1.1/vts/functional/Android.bp
index c136019..6e5c84c 100644
--- a/broadcastradio/1.1/vts/functional/Android.bp
+++ b/broadcastradio/1.1/vts/functional/Android.bp
@@ -31,7 +31,8 @@
],
static_libs: [
"VtsHalHidlTargetTestBase",
- "broadcastradio-vts-call-barrier",
+ "android.hardware.broadcastradio@1.1-utils-lib",
+ "android.hardware.broadcastradio@1.1-vts-utils-lib",
"libgmock",
],
cflags: [
@@ -40,16 +41,3 @@
"-g",
],
}
-
-cc_library_static {
- name: "broadcastradio-vts-call-barrier",
- srcs: [
- "call-barrier.cpp",
- ],
- export_include_dirs: ["."],
- cflags: [
- "-Wall",
- "-Wextra",
- "-Werror",
- ],
-}
diff --git a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
index d20452b..bd2e0a7 100644
--- a/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
+++ b/broadcastradio/1.1/vts/functional/VtsHalBroadcastradioV1_1TargetTest.cpp
@@ -17,8 +17,15 @@
#define LOG_TAG "broadcastradio.vts"
#include <VtsHalHidlTargetTestBase.h>
+#include <android/hardware/broadcastradio/1.1/IBroadcastRadio.h>
+#include <android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h>
+#include <android/hardware/broadcastradio/1.1/ITuner.h>
+#include <android/hardware/broadcastradio/1.1/ITunerCallback.h>
+#include <android/hardware/broadcastradio/1.1/types.h>
#include <android-base/logging.h>
-#include <call-barrier.h>
+#include <broadcastradio-utils/Utils.h>
+#include <broadcastradio-vts-utils/call-barrier.h>
+#include <broadcastradio-vts-utils/mock-timeout.h>
#include <cutils/native_handle.h>
#include <cutils/properties.h>
#include <gmock/gmock.h>
@@ -27,14 +34,6 @@
#include <chrono>
-#include <android/hardware/broadcastradio/1.1/IBroadcastRadio.h>
-#include <android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h>
-#include <android/hardware/broadcastradio/1.1/ITuner.h>
-#include <android/hardware/broadcastradio/1.1/ITunerCallback.h>
-#include <android/hardware/broadcastradio/1.1/types.h>
-
-#include "mock-timeout.h"
-
namespace android {
namespace hardware {
namespace broadcastradio {
@@ -57,6 +56,9 @@
using V1_0::MetadataKey;
using V1_0::MetadataType;
+using std::chrono::steady_clock;
+using std::this_thread::sleep_for;
+
static constexpr auto kConfigTimeout = 10s;
static constexpr auto kConnectModuleTimeout = 1s;
static constexpr auto kTuneTimeout = 30s;
@@ -91,10 +93,8 @@
virtual void SetUp() override;
virtual void TearDown() override;
- // TODO(b/36864490): check all bands for good test conditions (ie. FM is more likely to have
- // any stations on the list, so don't pick AM blindly).
- bool openTuner(unsigned band);
- const BandConfig& getBand(unsigned idx);
+ bool openTuner();
+ bool nextBand();
bool getProgramList(std::function<void(const hidl_vec<ProgramInfo>& list)> cb);
Class radioClass;
@@ -105,9 +105,33 @@
sp<TunerCallbackMock> mCallback = new TunerCallbackMock();
private:
+ const BandConfig& getBand(unsigned idx);
+
+ unsigned currentBandIndex = 0;
hidl_vec<BandConfig> mBands;
};
+/**
+ * Clears strong pointer and waits until the object gets destroyed.
+ *
+ * @param ptr The pointer to get cleared.
+ * @param timeout Time to wait for other references.
+ */
+template <typename T>
+static void clearAndWait(sp<T>& ptr, std::chrono::milliseconds timeout) {
+ wp<T> wptr = ptr;
+ ptr.clear();
+ auto limit = steady_clock::now() + timeout;
+ while (wptr.promote() != nullptr) {
+ constexpr auto step = 10ms;
+ if (steady_clock::now() + step > limit) {
+ FAIL() << "Pointer was not released within timeout";
+ break;
+ }
+ sleep_for(step);
+ }
+}
+
void BroadcastRadioHalTest::SetUp() {
radioClass = GetParam();
@@ -153,10 +177,10 @@
void BroadcastRadioHalTest::TearDown() {
mTuner.clear();
mRadioModule.clear();
- // TODO(b/36864490): wait (with timeout) until mCallback has only one reference
+ clearAndWait(mCallback, 1s);
}
-bool BroadcastRadioHalTest::openTuner(unsigned band) {
+bool BroadcastRadioHalTest::openTuner() {
EXPECT_EQ(nullptr, mTuner.get());
if (radioClass == Class::AM_FM) {
@@ -169,7 +193,8 @@
if (result != Result::OK) return;
mTuner = ITuner::castFrom(tuner);
};
- auto hidlResult = mRadioModule->openTuner(getBand(band), true, mCallback, openCb);
+ currentBandIndex = 0;
+ auto hidlResult = mRadioModule->openTuner(getBand(0), true, mCallback, openCb);
EXPECT_TRUE(hidlResult.isOk());
EXPECT_EQ(Result::OK, halResult);
@@ -210,6 +235,21 @@
return band;
}
+bool BroadcastRadioHalTest::nextBand() {
+ if (currentBandIndex + 1 >= mBands.size()) return false;
+ currentBandIndex++;
+
+ BandConfig bandCb;
+ EXPECT_TIMEOUT_CALL(*mCallback, configChange, Result::OK, _)
+ .WillOnce(DoAll(SaveArg<1>(&bandCb), testing::Return(ByMove(Void()))));
+ auto hidlResult = mTuner->setConfiguration(getBand(currentBandIndex));
+ EXPECT_EQ(Result::OK, hidlResult);
+ EXPECT_TIMEOUT_CALL_WAIT(*mCallback, configChange, kConfigTimeout);
+ EXPECT_EQ(getBand(currentBandIndex), bandCb);
+
+ return true;
+}
+
bool BroadcastRadioHalTest::getProgramList(
std::function<void(const hidl_vec<ProgramInfo>& list)> cb) {
ProgramListResult getListResult = ProgramListResult::NOT_INITIALIZED;
@@ -244,11 +284,7 @@
EXPECT_EQ(ProgramListResult::OK, getListResult);
}
- if (isListEmpty) {
- printSkipped("Program list is empty.");
- return false;
- }
- return true;
+ return !isListEmpty;
}
/**
@@ -263,13 +299,13 @@
*/
TEST_P(BroadcastRadioHalTest, OpenTunerTwice) {
if (skipped) return;
- ASSERT_TRUE(openTuner(0));
- Result halResult = Result::NOT_INITIALIZED;
- auto openCb = [&](Result result, const sp<V1_0::ITuner>&) { halResult = result; };
- auto hidlResult = mRadioModule->openTuner(getBand(0), true, mCallback, openCb);
- ASSERT_TRUE(hidlResult.isOk());
- ASSERT_EQ(Result::OK, halResult);
+ ASSERT_TRUE(openTuner());
+
+ auto secondTuner = mTuner;
+ mTuner.clear();
+
+ ASSERT_TRUE(openTuner());
}
/**
@@ -283,17 +319,25 @@
*/
TEST_P(BroadcastRadioHalTest, TuneFromProgramList) {
if (skipped) return;
- ASSERT_TRUE(openTuner(0));
+ ASSERT_TRUE(openTuner());
ProgramInfo firstProgram;
- auto getCb = [&](const hidl_vec<ProgramInfo>& list) {
- // don't copy the whole list out, it might be heavy
- firstProgram = list[0];
- };
- if (!getProgramList(getCb)) return;
+ bool foundAny = false;
+ do {
+ auto getCb = [&](const hidl_vec<ProgramInfo>& list) {
+ // don't copy the whole list out, it might be heavy
+ firstProgram = list[0];
+ };
+ if (getProgramList(getCb)) foundAny = true;
+ } while (nextBand());
+ if (HasFailure()) return;
+ if (!foundAny) {
+ printSkipped("Program list is empty.");
+ return;
+ }
ProgramSelector selCb;
- EXPECT_CALL(*mCallback, tuneComplete(_, _));
+ EXPECT_CALL(*mCallback, tuneComplete(_, _)).Times(0);
EXPECT_TIMEOUT_CALL(*mCallback, tuneComplete_1_1, Result::OK, _)
.WillOnce(DoAll(SaveArg<1>(&selCb), testing::Return(ByMove(Void()))));
auto tuneResult = mTuner->tune_1_1(firstProgram.selector);
@@ -304,7 +348,7 @@
TEST_P(BroadcastRadioHalTest, CancelAnnouncement) {
if (skipped) return;
- ASSERT_TRUE(openTuner(0));
+ ASSERT_TRUE(openTuner());
auto hidlResult = mTuner->cancelAnnouncement();
EXPECT_EQ(Result::OK, hidlResult);
@@ -336,23 +380,24 @@
*/
TEST_P(BroadcastRadioHalTest, OobImagesOnly) {
if (skipped) return;
- ASSERT_TRUE(openTuner(0));
+ ASSERT_TRUE(openTuner());
std::vector<int> imageIds;
- ProgramInfo firstProgram;
- auto getCb = [&](const hidl_vec<ProgramInfo>& list) {
- for (auto&& program : list) {
- for (auto&& entry : program.base.metadata) {
- EXPECT_NE(MetadataType::RAW, entry.type);
- if (entry.key != MetadataKey::ICON && entry.key != MetadataKey::ART) continue;
- EXPECT_NE(0, entry.intValue);
- EXPECT_EQ(0u, entry.rawValue.size());
- if (entry.intValue != 0) imageIds.push_back(entry.intValue);
+ do {
+ auto getCb = [&](const hidl_vec<ProgramInfo>& list) {
+ for (auto&& program : list) {
+ for (auto&& entry : program.base.metadata) {
+ EXPECT_NE(MetadataType::RAW, entry.type);
+ if (entry.key != MetadataKey::ICON && entry.key != MetadataKey::ART) continue;
+ EXPECT_NE(0, entry.intValue);
+ EXPECT_EQ(0u, entry.rawValue.size());
+ if (entry.intValue != 0) imageIds.push_back(entry.intValue);
+ }
}
- }
- };
- if (!getProgramList(getCb)) return;
+ };
+ getProgramList(getCb);
+ } while (nextBand());
if (imageIds.size() == 0) {
printSkipped("No images found");
@@ -371,6 +416,52 @@
}
}
+/**
+ * Test AnalogForced switch.
+ *
+ * Verifies that:
+ * - setAnalogForced results either with INVALID_STATE, or isAnalogForced replying the same
+ */
+TEST_P(BroadcastRadioHalTest, AnalogForcedSwitch) {
+ if (skipped) return;
+ ASSERT_TRUE(openTuner());
+
+ bool forced;
+ Result halIsResult;
+ auto isCb = [&](Result result, bool isForced) {
+ halIsResult = result;
+ forced = isForced;
+ };
+
+ // set analog mode
+ auto setResult = mTuner->setAnalogForced(true);
+ ASSERT_TRUE(setResult.isOk());
+ if (Result::INVALID_STATE == setResult) {
+ // if setter fails, getter should fail too - it means the switch is not supported at all
+ auto isResult = mTuner->isAnalogForced(isCb);
+ ASSERT_TRUE(isResult.isOk());
+ EXPECT_EQ(Result::INVALID_STATE, halIsResult);
+ return;
+ }
+ ASSERT_EQ(Result::OK, setResult);
+
+ // check, if it's analog
+ auto isResult = mTuner->isAnalogForced(isCb);
+ ASSERT_TRUE(isResult.isOk());
+ EXPECT_EQ(Result::OK, halIsResult);
+ ASSERT_TRUE(forced);
+
+ // set digital mode
+ setResult = mTuner->setAnalogForced(false);
+ ASSERT_EQ(Result::OK, setResult);
+
+ // check, if it's digital
+ isResult = mTuner->isAnalogForced(isCb);
+ ASSERT_TRUE(isResult.isOk());
+ EXPECT_EQ(Result::OK, halIsResult);
+ ASSERT_FALSE(forced);
+}
+
INSTANTIATE_TEST_CASE_P(BroadcastRadioHalTestCases, BroadcastRadioHalTest,
::testing::Values(Class::AM_FM, Class::SAT, Class::DT));
diff --git a/broadcastradio/1.1/vts/utils/Android.bp b/broadcastradio/1.1/vts/utils/Android.bp
new file mode 100644
index 0000000..0c7e2a4
--- /dev/null
+++ b/broadcastradio/1.1/vts/utils/Android.bp
@@ -0,0 +1,28 @@
+//
+// 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_library_static {
+ name: "android.hardware.broadcastradio@1.1-vts-utils-lib",
+ srcs: [
+ "call-barrier.cpp",
+ ],
+ export_include_dirs: ["include"],
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ ],
+}
diff --git a/broadcastradio/1.1/vts/functional/call-barrier.cpp b/broadcastradio/1.1/vts/utils/call-barrier.cpp
similarity index 95%
rename from broadcastradio/1.1/vts/functional/call-barrier.cpp
rename to broadcastradio/1.1/vts/utils/call-barrier.cpp
index fede297..d8c4716 100644
--- a/broadcastradio/1.1/vts/functional/call-barrier.cpp
+++ b/broadcastradio/1.1/vts/utils/call-barrier.cpp
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include "call-barrier.h"
+#include <broadcastradio-vts-utils/call-barrier.h>
namespace android {
namespace hardware {
diff --git a/broadcastradio/1.1/vts/functional/call-barrier.h b/broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/call-barrier.h
similarity index 100%
rename from broadcastradio/1.1/vts/functional/call-barrier.h
rename to broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/call-barrier.h
diff --git a/broadcastradio/1.1/vts/functional/mock-timeout.h b/broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
similarity index 100%
rename from broadcastradio/1.1/vts/functional/mock-timeout.h
rename to broadcastradio/1.1/vts/utils/include/broadcastradio-vts-utils/mock-timeout.h
diff --git a/broadcastradio/Android.bp b/broadcastradio/Android.bp
index a5ad5e7..8c65bf6 100644
--- a/broadcastradio/Android.bp
+++ b/broadcastradio/Android.bp
@@ -8,4 +8,5 @@
"1.1/tests",
"1.1/utils",
"1.1/vts/functional",
+ "1.1/vts/utils",
]
diff --git a/camera/device/1.0/default/OWNERS b/camera/device/1.0/default/OWNERS
new file mode 100644
index 0000000..18acfee
--- /dev/null
+++ b/camera/device/1.0/default/OWNERS
@@ -0,0 +1,6 @@
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
diff --git a/camera/device/3.2/default/CameraDeviceSession.cpp b/camera/device/3.2/default/CameraDeviceSession.cpp
index f33adf8..fcd134f 100644
--- a/camera/device/3.2/default/CameraDeviceSession.cpp
+++ b/camera/device/3.2/default/CameraDeviceSession.cpp
@@ -923,6 +923,7 @@
status = Status::INTERNAL_ERROR;
} else {
convertToHidl(stream_list, &outStreams);
+ mFirstRequest = true;
}
_hidl_cb(status, outStreams);
@@ -1022,7 +1023,13 @@
if (!converted) {
ALOGE("%s: capture request settings metadata is corrupt!", __FUNCTION__);
- return Status::INTERNAL_ERROR;
+ return Status::ILLEGAL_ARGUMENT;
+ }
+
+ if (mFirstRequest && halRequest.settings == nullptr) {
+ ALOGE("%s: capture request settings must not be null for first request!",
+ __FUNCTION__);
+ return Status::ILLEGAL_ARGUMENT;
}
hidl_vec<buffer_handle_t*> allBufPtrs;
@@ -1031,6 +1038,12 @@
request.inputBuffer.bufferId != 0);
size_t numOutputBufs = request.outputBuffers.size();
size_t numBufs = numOutputBufs + (hasInputBuf ? 1 : 0);
+
+ if (numOutputBufs == 0) {
+ ALOGE("%s: capture request must have at least one output buffer!", __FUNCTION__);
+ return Status::ILLEGAL_ARGUMENT;
+ }
+
status = importRequest(request, allBufPtrs, allFences);
if (status != Status::OK) {
return status;
@@ -1102,6 +1115,7 @@
return Status::INTERNAL_ERROR;
}
+ mFirstRequest = false;
return Status::OK;
}
diff --git a/camera/device/3.2/default/CameraDeviceSession.h b/camera/device/3.2/default/CameraDeviceSession.h
index fb3fc02..2fe189f 100644
--- a/camera/device/3.2/default/CameraDeviceSession.h
+++ b/camera/device/3.2/default/CameraDeviceSession.h
@@ -148,6 +148,7 @@
static HandleImporter sHandleImporter;
bool mInitFail;
+ bool mFirstRequest = false;
common::V1_0::helper::CameraMetadata mDeviceInfo;
diff --git a/camera/device/3.2/default/OWNERS b/camera/device/3.2/default/OWNERS
new file mode 100644
index 0000000..18acfee
--- /dev/null
+++ b/camera/device/3.2/default/OWNERS
@@ -0,0 +1,6 @@
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
diff --git a/camera/provider/2.4/default/OWNERS b/camera/provider/2.4/default/OWNERS
new file mode 100644
index 0000000..18acfee
--- /dev/null
+++ b/camera/provider/2.4/default/OWNERS
@@ -0,0 +1,6 @@
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
diff --git a/camera/provider/2.4/vts/OWNERS b/camera/provider/2.4/vts/OWNERS
new file mode 100644
index 0000000..003fe71
--- /dev/null
+++ b/camera/provider/2.4/vts/OWNERS
@@ -0,0 +1,11 @@
+# Camera team
+cychen@google.com
+epeev@google.com
+etalvala@google.com
+shuzhenwang@google.com
+yinchiayeh@google.com
+zhijunhe@google.com
+
+# VTS team
+yim@google.com
+zhuoyao@google.com
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 1eea640..8ff9847 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -132,22 +132,34 @@
const char *kHAL1_0 = "1.0";
bool matchDeviceName(const hidl_string& deviceName,
- const hidl_string &providerType, std::smatch& sm) {
+ const hidl_string &providerType,
+ std::string* deviceVersion,
+ std::string* cameraId) {
::android::String8 pattern;
pattern.appendFormat(kDeviceNameRE, providerType.c_str());
std::regex e(pattern.string());
std::string deviceNameStd(deviceName.c_str());
- return std::regex_match(deviceNameStd, sm, e);
+ std::smatch sm;
+ if (std::regex_match(deviceNameStd, sm, e)) {
+ if (deviceVersion != nullptr) {
+ *deviceVersion = sm[1];
+ }
+ if (cameraId != nullptr) {
+ *cameraId = sm[2];
+ }
+ return true;
+ }
+ return false;
}
int getCameraDeviceVersion(const hidl_string& deviceName,
const hidl_string &providerType) {
- std::smatch sm;
- bool match = matchDeviceName(deviceName, providerType, sm);
+ std::string version;
+ bool match = matchDeviceName(deviceName, providerType, &version, nullptr);
if (!match) {
return -1;
}
- std::string version = sm[1].str();
+
if (version.compare(kHAL3_2) == 0) {
// maybe switched to 3.4 or define the hidl version enumlater
return CAMERA_DEVICE_API_VERSION_3_2;
@@ -1072,6 +1084,9 @@
auto status = mProvider->setCallback(cb);
ASSERT_TRUE(status.isOk());
ASSERT_EQ(Status::OK, status);
+ status = mProvider->setCallback(nullptr);
+ ASSERT_TRUE(status.isOk());
+ ASSERT_EQ(Status::OK, status);
}
// Test if ICameraProvider::getCameraDeviceInterface returns Status::OK and non-null device
@@ -2198,7 +2213,7 @@
static_cast<uint32_t>(it.width),
static_cast<uint32_t>(it.height),
static_cast<PixelFormat>(it.format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER,
0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {stream};
@@ -2242,7 +2257,7 @@
static_cast<uint32_t>(0),
static_cast<uint32_t>(0),
static_cast<PixelFormat>(outputStreams[0].format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER,
0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {stream};
@@ -2257,7 +2272,7 @@
static_cast<uint32_t>(UINT32_MAX),
static_cast<uint32_t>(UINT32_MAX),
static_cast<PixelFormat>(outputStreams[0].format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER,
0,
StreamRotation::ROTATION_0};
streams[0] = stream;
@@ -2273,7 +2288,7 @@
static_cast<uint32_t>(it.width),
static_cast<uint32_t>(it.height),
static_cast<PixelFormat>(UINT32_MAX),
- 0,
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER,
0,
StreamRotation::ROTATION_0};
streams[0] = stream;
@@ -2288,7 +2303,7 @@
static_cast<uint32_t>(it.width),
static_cast<uint32_t>(it.height),
static_cast<PixelFormat>(it.format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER,
0,
static_cast<StreamRotation>(UINT32_MAX)};
streams[0] = stream;
@@ -2368,7 +2383,7 @@
static_cast<uint32_t>(outputIter.width),
static_cast<uint32_t>(outputIter.height),
static_cast<PixelFormat>(outputIter.format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER,
0,
StreamRotation::ROTATION_0};
@@ -2426,7 +2441,7 @@
static_cast<uint32_t>(previewIter.width),
static_cast<uint32_t>(previewIter.height),
static_cast<PixelFormat>(previewIter.format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER,
0,
StreamRotation::ROTATION_0};
Stream blobStream = {streamId++,
@@ -2434,7 +2449,7 @@
static_cast<uint32_t>(blobIter.width),
static_cast<uint32_t>(blobIter.height),
static_cast<PixelFormat>(blobIter.format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_CPU_READ,
0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {previewStream, blobStream};
@@ -2486,7 +2501,7 @@
static_cast<uint32_t>(hfrStream.width),
static_cast<uint32_t>(hfrStream.height),
static_cast<PixelFormat>(hfrStream.format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER,
0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {stream};
@@ -2505,7 +2520,7 @@
static_cast<uint32_t>(0),
static_cast<uint32_t>(0),
static_cast<PixelFormat>(hfrStream.format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER,
0,
StreamRotation::ROTATION_0};
streams[0] = stream;
@@ -2520,7 +2535,7 @@
static_cast<uint32_t>(UINT32_MAX),
static_cast<uint32_t>(UINT32_MAX),
static_cast<PixelFormat>(hfrStream.format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER,
0,
StreamRotation::ROTATION_0};
streams[0] = stream;
@@ -2535,7 +2550,7 @@
static_cast<uint32_t>(hfrStream.width),
static_cast<uint32_t>(hfrStream.height),
static_cast<PixelFormat>(UINT32_MAX),
- 0,
+ GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER,
0,
StreamRotation::ROTATION_0};
streams[0] = stream;
@@ -2588,7 +2603,7 @@
static_cast<uint32_t>(videoIter.width),
static_cast<uint32_t>(videoIter.height),
static_cast<PixelFormat>(videoIter.format),
- 0,
+ GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER,
0,
StreamRotation::ROTATION_0};
Stream blobStream = {streamId++,
@@ -2596,7 +2611,7 @@
static_cast<uint32_t>(blobIter.width),
static_cast<uint32_t>(blobIter.height),
static_cast<PixelFormat>(blobIter.format),
- GRALLOC_USAGE_HW_VIDEO_ENCODER,
+ GRALLOC1_CONSUMER_USAGE_CPU_READ,
0,
StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {videoStream, blobStream};
@@ -2652,7 +2667,6 @@
}
});
ASSERT_TRUE(resultQueueRet.isOk());
- ASSERT_NE(nullptr, resultQueue);
InFlightRequest inflightReq = {1, false, supportsPartialResults, partialResultCount,
resultQueue};
@@ -2718,6 +2732,9 @@
// Empty settings should be supported after the first call
// for repeating requests.
request.settings.setToExternal(nullptr, 0, true);
+ // The buffer has been registered to HAL by bufferId, so per
+ // API contract we should send a null handle for this buffer
+ request.outputBuffers[0].buffer = nullptr;
mInflightMap.clear();
inflightReq = {1, false, supportsPartialResults, partialResultCount, resultQueue};
mInflightMap.add(request.frameNumber, &inflightReq);
@@ -2801,7 +2818,7 @@
numRequestProcessed = n;
});
ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Status::INTERNAL_ERROR, status);
+ ASSERT_EQ(Status::ILLEGAL_ARGUMENT, status);
ASSERT_EQ(numRequestProcessed, 0u);
ret = session->close();
@@ -2855,7 +2872,7 @@
numRequestProcessed = n;
});
ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Status::INTERNAL_ERROR, status);
+ ASSERT_EQ(Status::ILLEGAL_ARGUMENT, status);
ASSERT_EQ(numRequestProcessed, 0u);
ret = session->close();
@@ -2900,7 +2917,6 @@
}
});
ASSERT_TRUE(resultQueueRet.isOk());
- ASSERT_NE(nullptr, resultQueue);
InFlightRequest inflightReq = {1, false, supportsPartialResults, partialResultCount,
resultQueue};
@@ -3275,7 +3291,7 @@
static_cast<uint32_t> (outputPreviewStreams[0].width),
static_cast<uint32_t> (outputPreviewStreams[0].height),
static_cast<PixelFormat> (outputPreviewStreams[0].format),
- 0, 0, StreamRotation::ROTATION_0};
+ GRALLOC1_CONSUMER_USAGE_HWCOMPOSER, 0, StreamRotation::ROTATION_0};
::android::hardware::hidl_vec<Stream> streams = {*previewStream};
StreamConfiguration config = {streams,
StreamConfigurationMode::NORMAL_MODE};
diff --git a/current.txt b/current.txt
index 67f1169..2017df5 100644
--- a/current.txt
+++ b/current.txt
@@ -190,6 +190,7 @@
# ABI preserving changes to HALs released in Android O
150a338ce11fcec70757c9675d83cf6a5d7b40d0c812741b91671fecce59eac9 android.hardware.broadcastradio@1.0::types
+dc7e6d4f537b9943e27edc4f86c5a03bb643b18f18f866f8c3c71c0ac4ea8cbc android.hardware.broadcastradio@1.0::types
760485232f6cce07f8bb05e3475509956996b702f77415ee5bff05e2ec5a5bcc android.hardware.dumpstate@1.0::IDumpstateDevice
e822cb7f4a1bdd45689c5e92ccd19a2201c20b771bd4b2ec1ae627e324591f9d android.hardware.radio@1.0::IRadioResponse
28e929b453df3d9f5060af2764e6cdb123ddb893e3e86923c877f6ff7e5f02c9 android.hardware.wifi@1.0::types
@@ -220,4 +221,4 @@
c3354ab0d381a236c12dc486ad4b6bec28c979d26748b4661f12ede36f392808 android.hardware.wifi.offload@1.0::IOffloadCallback
b18caefefcc765092412285d776234fcf213b73bdf07ae1b67a5f71b2d2464e3 android.hardware.wifi.offload@1.0::types
c26473e2e4a00af43e28a0ddf9002e5062a7d0940429e5efb6e5513a8abcb75c android.hardware.wifi@1.1::IWifi
-bfcf4856c7b6c66ebc56785ed3e5d181b7be859c2add672497a843b024518737 android.hardware.wifi@1.1::IWifiChip
+b056e1defab4071584214584057d0bc73a613081bf1152590549649d4582c13c android.hardware.wifi@1.1::IWifiChip
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
index 35d97ee..df31563 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
@@ -98,7 +98,10 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::INVALID_CALL_ID, radioRsp->rspInfo.error);
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::INVALID_CALL_ID ||
+ radioRsp->rspInfo.error == RadioError::SIM_ABSENT || CheckOEMError() ||
+ radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE);
}
}
@@ -220,6 +223,9 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- // TODO(shuoq): Will add error check when we know the expected error from QC
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE ||
+ radioRsp->rspInfo.error == RadioError::SIM_ABSENT ||
+ radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
}
}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
index 864f844..cc519ca 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
@@ -754,22 +754,24 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE || CheckGeneralError());
- }
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
+ }
- /* Reset back to no carrier restriction */
- memset(&carriers, 0, sizeof(carriers));
- carriers.allowedCarriers.resize(0);
- carriers.excludedCarriers.resize(0);
+ /* Reset back to no carrier restriction */
+ memset(&carriers, 0, sizeof(carriers));
+ carriers.allowedCarriers.resize(0);
+ carriers.excludedCarriers.resize(0);
- radio->setAllowedCarriers(++serial, true, carriers);
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
- EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+ radio->setAllowedCarriers(++serial, true, carriers);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
- if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE || CheckGeneralError());
- }
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE ||
+ radioRsp->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
+ }
}
/*
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
index 5f28155..ed2c6bb 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
@@ -37,6 +37,10 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+
+ /* Vts Testing with Sim Absent only. This needs to be removed later in P when sim present
+ * scenarios will be tested. */
+ EXPECT_EQ(CardState::ABSENT, cardStatus.cardState);
}
void RadioHidlTest::TearDown() {}
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_api.cpp b/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
index 4bf6f87..36fd7c2 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
@@ -15,6 +15,7 @@
*/
#include <radio_hidl_hal_utils_v1_1.h>
+#include <vector>
/*
* Test IRadio.setSimCardPower() for the response returned.
@@ -63,7 +64,8 @@
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT ||
- radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+ radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+ radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
}
}
@@ -84,7 +86,8 @@
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
- radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT);
+ radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT ||
+ radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
}
}
@@ -101,6 +104,142 @@
if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
- radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT);
+ radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT ||
+ radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
}
-}
\ No newline at end of file
+}
+
+/*
+ * Test IRadio.setCarrierInfoForImsiEncryption() for the response returned.
+ */
+TEST_F(RadioHidlTest_v1_1, setCarrierInfoForImsiEncryption) {
+ int serial = GetRandomSerialNumber();
+ ImsiEncryptionInfo imsiInfo;
+ imsiInfo.mcc = "310";
+ imsiInfo.mnc = "004";
+ imsiInfo.carrierKey = (std::vector<uint8_t>){1, 2, 3, 4, 5, 6};
+ imsiInfo.keyIdentifier = "Test";
+ imsiInfo.expirationTime = 20180101;
+
+ radio_v1_1->setCarrierInfoForImsiEncryption(serial, imsiInfo);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
+ radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
+ }
+}
+
+/*
+ * Test IRadio.startKeepalive() for the response returned.
+ */
+TEST_F(RadioHidlTest_v1_1, startKeepalive) {
+ std::vector<KeepaliveRequest> requests = {
+ {
+ // Invalid IPv4 source address
+ KeepaliveType::NATT_IPV4,
+ {192, 168, 0 /*, 100*/},
+ 1234,
+ {8, 8, 4, 4},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid IPv4 destination address
+ KeepaliveType::NATT_IPV4,
+ {192, 168, 0, 100},
+ 1234,
+ {8, 8, 4, 4, 1, 2, 3, 4},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid Keepalive Type
+ static_cast<KeepaliveType>(-1),
+ {192, 168, 0, 100},
+ 1234,
+ {8, 8, 4, 4},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid IPv6 source address
+ KeepaliveType::NATT_IPV6,
+ {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xED,
+ 0xBE, 0xEF, 0xBD},
+ 1234,
+ {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x88, 0x44},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid IPv6 destination address
+ KeepaliveType::NATT_IPV6,
+ {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xED,
+ 0xBE, 0xEF},
+ 1234,
+ {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x88,
+ /*0x44*/},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid Context ID (cid), this should survive the initial
+ // range checking and fail in the modem data layer
+ KeepaliveType::NATT_IPV4,
+ {192, 168, 0, 100},
+ 1234,
+ {8, 8, 4, 4},
+ 4500,
+ 20000,
+ 0xBAD,
+ },
+ {
+ // Invalid Context ID (cid), this should survive the initial
+ // range checking and fail in the modem data layer
+ KeepaliveType::NATT_IPV6,
+ {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xED,
+ 0xBE, 0xEF},
+ 1234,
+ {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x88, 0x44},
+ 4500,
+ 20000,
+ 0xBAD,
+ }};
+
+ for (auto req = requests.begin(); req != requests.end(); req++) {
+ int serial = GetRandomSerialNumber();
+ radio_v1_1->startKeepalive(serial, *req);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
+
+ ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+ radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
+ }
+}
+
+/*
+ * Test IRadio.stopKeepalive() for the response returned.
+ */
+TEST_F(RadioHidlTest_v1_1, stopKeepalive) {
+ int serial = GetRandomSerialNumber();
+
+ radio_v1_1->stopKeepalive(serial, 0xBAD);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
+
+ ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
+ radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
+}
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
index 770b599..e0b1ad4 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.1/vts/functional/radio_hidl_hal_test.cpp
@@ -38,6 +38,10 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
EXPECT_EQ(RadioError::NONE, radioRsp_v1_1->rspInfo.error);
+
+ /* Vts Testing with Sim Absent only. This needs to be removed later in P when sim present
+ * scenarios will be tested. */
+ EXPECT_EQ(CardState::ABSENT, cardStatus.cardState);
}
void RadioHidlTest_v1_1::TearDown() {}
diff --git a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
index dd4f1ef..c797e35 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
+++ b/radio/1.1/vts/functional/radio_hidl_hal_utils_v1_1.h
@@ -53,6 +53,7 @@
hidl_string imsi;
IccIoResult iccIoResult;
int channelId;
+ KeepaliveStatus keepaliveStatus;
// Sms
SendSmsResult sendSmsResult;
@@ -567,4 +568,4 @@
public:
virtual void SetUp() {}
virtual void TearDown() {}
-};
\ No newline at end of file
+};
diff --git a/radio/1.1/vts/functional/radio_response.cpp b/radio/1.1/vts/functional/radio_response.cpp
index 37b80b1..400ef3c 100644
--- a/radio/1.1/vts/functional/radio_response.cpp
+++ b/radio/1.1/vts/functional/radio_response.cpp
@@ -659,7 +659,9 @@
/* 1.1 Apis */
Return<void> RadioResponse_v1_1::setCarrierInfoForImsiEncryptionResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_v1_1.notify();
return Void();
}
@@ -681,11 +683,16 @@
return Void();
}
-Return<void> RadioResponse_v1_1::startKeepaliveResponse(const RadioResponseInfo& /*info*/,
- const KeepaliveStatus& /*status*/) {
+Return<void> RadioResponse_v1_1::startKeepaliveResponse(const RadioResponseInfo& info,
+ const KeepaliveStatus& status) {
+ rspInfo = info;
+ keepaliveStatus = status;
+ parent_v1_1.notify();
return Void();
}
-Return<void> RadioResponse_v1_1::stopKeepaliveResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse_v1_1::stopKeepaliveResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_v1_1.notify();
return Void();
-}
\ No newline at end of file
+}
diff --git a/tests/msgq/1.0/default/Android.bp b/tests/msgq/1.0/default/Android.bp
index e3c49e7..eb25ac2 100644
--- a/tests/msgq/1.0/default/Android.bp
+++ b/tests/msgq/1.0/default/Android.bp
@@ -17,7 +17,6 @@
name: "android.hardware.tests.msgq@1.0-impl",
defaults: ["hidl_defaults"],
relative_install_path: "hw",
- proprietary: true,
srcs: [
"TestMsgQ.cpp",
"BenchmarkMsgQ.cpp"
diff --git a/wifi/1.1/IWifiChip.hal b/wifi/1.1/IWifiChip.hal
index 50cd02d..1af1f71 100644
--- a/wifi/1.1/IWifiChip.hal
+++ b/wifi/1.1/IWifiChip.hal
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 The Android Open Source Project
+ * Copyright 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.
@@ -44,24 +44,40 @@
};
/**
- * API to set TX power limit.
- * This is used for meeting SAR requirements while making VOIP calls for
- * example.
- *
- * @param powerInDbm Power level in dBm.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
- * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
- * |WifiStatusCode.NOT_AVAILABLE|,
- * |WifiStatusCode.UNKNOWN|
+ * List of preset wifi radio TX power levels for different scenarios.
+ * The actual power values (typically varies based on the channel,
+ * 802.11 connection type, number of MIMO streams, etc) for each scenario
+ * is defined by the OEM as a BDF file since it varies for each wifi chip
+ * vendor and device.
*/
- setTxPowerLimit(int32_t powerInDbm) generates (WifiStatus status);
+ enum TxPowerScenario : uint32_t {
+ VOICE_CALL = 0,
+ };
/**
- * API to reset TX power limit.
- * This is used to set the power back to default values.
+ * API to select one of the preset TX power scenarios.
+ *
+ * The framework must invoke this method with the appropriate scenario to let
+ * the wifi chip change it's transmitting power levels.
+ * OEM's should define various power profiles for each of the scenarios
+ * above (defined in |TxPowerScenario|).
+ *
+ * @param scenario One of the preselected scenarios defined in
+ * |TxPowerScenario|.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.NOT_AVAILABLE|,
+ * |WifiStatusCode.UNKNOWN|
+ */
+ selectTxPowerScenario(TxPowerScenario scenario) generates (WifiStatus status);
+
+ /**
+ * API to reset TX power levels.
+ * This is used to indicate the end of the previously selected TX power
+ * scenario and let the wifi chip fall back to the default power values.
*
* @return status WifiStatus of the operation.
* Possible status codes:
@@ -71,5 +87,5 @@
* |WifiStatusCode.NOT_AVAILABLE|,
* |WifiStatusCode.UNKNOWN|
*/
- resetTxPowerLimit() generates (WifiStatus status);
+ resetTxPowerScenario() generates (WifiStatus status);
};
diff --git a/wifi/1.1/default/hidl_struct_util.cpp b/wifi/1.1/default/hidl_struct_util.cpp
index 6b93b9e..c53cdc5 100644
--- a/wifi/1.1/default/hidl_struct_util.cpp
+++ b/wifi/1.1/default/hidl_struct_util.cpp
@@ -17,9 +17,6 @@
#include <android-base/logging.h>
#include <utils/SystemClock.h>
-#include <android/hardware/wifi/1.0/IWifiChip.h>
-#include <android/hardware/wifi/1.1/IWifiChip.h>
-
#include "hidl_struct_util.h"
namespace android {
@@ -260,6 +257,15 @@
return true;
}
+legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy(
+ V1_1::IWifiChip::TxPowerScenario hidl_scenario) {
+ switch (hidl_scenario) {
+ case V1_1::IWifiChip::TxPowerScenario::VOICE_CALL:
+ return legacy_hal::WIFI_POWER_SCENARIO_VOICE_CALL;
+ };
+ CHECK(false);
+}
+
bool convertLegacyFeaturesToHidlStaCapabilities(
uint32_t legacy_feature_set,
uint32_t legacy_logger_feature_set,
diff --git a/wifi/1.1/default/hidl_struct_util.h b/wifi/1.1/default/hidl_struct_util.h
index 7a840f9..747fd2f 100644
--- a/wifi/1.1/default/hidl_struct_util.h
+++ b/wifi/1.1/default/hidl_struct_util.h
@@ -20,6 +20,8 @@
#include <vector>
#include <android/hardware/wifi/1.0/types.h>
+#include <android/hardware/wifi/1.0/IWifiChip.h>
+#include <android/hardware/wifi/1.1/IWifiChip.h>
#include "wifi_legacy_hal.h"
@@ -51,6 +53,8 @@
bool convertLegacyWakeReasonStatsToHidl(
const legacy_hal::WakeReasonStats& legacy_stats,
WifiDebugHostWakeReasonStats* hidl_stats);
+legacy_hal::wifi_power_scenario convertHidlTxPowerScenarioToLegacy(
+ V1_1::IWifiChip::TxPowerScenario hidl_scenario);
// STA iface conversion methods.
bool convertLegacyFeaturesToHidlStaCapabilities(
diff --git a/wifi/1.1/default/wifi_chip.cpp b/wifi/1.1/default/wifi_chip.cpp
index 2beac26..2f40234 100644
--- a/wifi/1.1/default/wifi_chip.cpp
+++ b/wifi/1.1/default/wifi_chip.cpp
@@ -343,20 +343,20 @@
enable);
}
-Return<void> WifiChip::setTxPowerLimit(
- int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) {
+Return<void> WifiChip::selectTxPowerScenario(
+ TxPowerScenario scenario, selectTxPowerScenario_cb hidl_status_cb) {
return validateAndCall(this,
WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
- &WifiChip::setTxPowerLimitInternal,
+ &WifiChip::selectTxPowerScenarioInternal,
hidl_status_cb,
- powerInDbm);
+ scenario);
}
-Return<void> WifiChip::resetTxPowerLimit(
- resetTxPowerLimit_cb hidl_status_cb) {
+Return<void> WifiChip::resetTxPowerScenario(
+ resetTxPowerScenario_cb hidl_status_cb) {
return validateAndCall(this,
WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
- &WifiChip::resetTxPowerLimitInternal,
+ &WifiChip::resetTxPowerScenarioInternal,
hidl_status_cb);
}
@@ -824,13 +824,14 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiChip::setTxPowerLimitInternal(int32_t powerInDbm) {
- auto legacy_status = legacy_hal_.lock()->setTxPowerLimit(powerInDbm);
+WifiStatus WifiChip::selectTxPowerScenarioInternal(TxPowerScenario scenario) {
+ auto legacy_status = legacy_hal_.lock()->selectTxPowerScenario(
+ hidl_struct_util::convertHidlTxPowerScenarioToLegacy(scenario));
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiChip::resetTxPowerLimitInternal() {
- auto legacy_status = legacy_hal_.lock()->resetTxPowerLimit();
+WifiStatus WifiChip::resetTxPowerScenarioInternal() {
+ auto legacy_status = legacy_hal_.lock()->resetTxPowerScenario();
return createWifiStatusFromLegacyError(legacy_status);
}
diff --git a/wifi/1.1/default/wifi_chip.h b/wifi/1.1/default/wifi_chip.h
index b7dde50..e88100b 100644
--- a/wifi/1.1/default/wifi_chip.h
+++ b/wifi/1.1/default/wifi_chip.h
@@ -126,9 +126,11 @@
getDebugHostWakeReasonStats_cb hidl_status_cb) override;
Return<void> enableDebugErrorAlerts(
bool enable, enableDebugErrorAlerts_cb hidl_status_cb) override;
- Return<void> setTxPowerLimit(
- int32_t powerInDbm, setTxPowerLimit_cb hidl_status_cb) override;
- Return<void> resetTxPowerLimit(resetTxPowerLimit_cb hidl_status_cb) override;
+ Return<void> selectTxPowerScenario(
+ TxPowerScenario scenario,
+ selectTxPowerScenario_cb hidl_status_cb) override;
+ Return<void> resetTxPowerScenario(
+ resetTxPowerScenario_cb hidl_status_cb) override;
private:
void invalidateAndRemoveAllIfaces();
@@ -180,8 +182,8 @@
std::pair<WifiStatus, WifiDebugHostWakeReasonStats>
getDebugHostWakeReasonStatsInternal();
WifiStatus enableDebugErrorAlertsInternal(bool enable);
- WifiStatus setTxPowerLimitInternal(int32_t powerInDbm);
- WifiStatus resetTxPowerLimitInternal();
+ WifiStatus selectTxPowerScenarioInternal(TxPowerScenario scenario);
+ WifiStatus resetTxPowerScenarioInternal();
WifiStatus handleChipConfiguration(ChipModeId mode_id);
WifiStatus registerDebugRingBufferCallback();
diff --git a/wifi/1.1/default/wifi_legacy_hal.cpp b/wifi/1.1/default/wifi_legacy_hal.cpp
index 052aafb..7d683d3 100644
--- a/wifi/1.1/default/wifi_legacy_hal.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal.cpp
@@ -752,13 +752,13 @@
oui_internal.data());
}
-wifi_error WifiLegacyHal::setTxPowerLimit(int32_t tx_level_dbm) {
- return global_func_table_.wifi_set_tx_power_limit(wlan_interface_handle_,
- tx_level_dbm);
+wifi_error WifiLegacyHal::selectTxPowerScenario(wifi_power_scenario scenario) {
+ return global_func_table_.wifi_select_tx_power_scenario(
+ wlan_interface_handle_, scenario);
}
-wifi_error WifiLegacyHal::resetTxPowerLimit() {
- return global_func_table_.wifi_reset_tx_power_limit(wlan_interface_handle_);
+wifi_error WifiLegacyHal::resetTxPowerScenario() {
+ return global_func_table_.wifi_reset_tx_power_scenario(wlan_interface_handle_);
}
std::pair<wifi_error, uint32_t> WifiLegacyHal::getLoggerSupportedFeatureSet() {
diff --git a/wifi/1.1/default/wifi_legacy_hal.h b/wifi/1.1/default/wifi_legacy_hal.h
index 8d9144d..caa1bd5 100644
--- a/wifi/1.1/default/wifi_legacy_hal.h
+++ b/wifi/1.1/default/wifi_legacy_hal.h
@@ -205,8 +205,8 @@
uint32_t period_in_ms);
wifi_error stopSendingOffloadedPacket(uint32_t cmd_id);
wifi_error setScanningMacOui(const std::array<uint8_t, 3>& oui);
- wifi_error setTxPowerLimit(int32_t tx_level_dbm);
- wifi_error resetTxPowerLimit();
+ wifi_error selectTxPowerScenario(wifi_power_scenario scenario);
+ wifi_error resetTxPowerScenario();
// Logger/debug functions.
std::pair<wifi_error, uint32_t> getLoggerSupportedFeatureSet();
wifi_error startPktFateMonitoring();
diff --git a/wifi/1.1/default/wifi_legacy_hal_stubs.cpp b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
index 24ed548..c02e3ba 100644
--- a/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal_stubs.cpp
@@ -132,8 +132,8 @@
populateStubFor(&hal_fn->wifi_get_roaming_capabilities);
populateStubFor(&hal_fn->wifi_enable_firmware_roaming);
populateStubFor(&hal_fn->wifi_configure_roaming);
- populateStubFor(&hal_fn->wifi_set_tx_power_limit);
- populateStubFor(&hal_fn->wifi_reset_tx_power_limit);
+ populateStubFor(&hal_fn->wifi_select_tx_power_scenario);
+ populateStubFor(&hal_fn->wifi_reset_tx_power_scenario);
return true;
}
} // namespace legacy_hal
diff --git a/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
index 839b6c4..d3a983c 100644
--- a/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
@@ -37,7 +37,8 @@
using ::android::hardware::wifi::V1_0::IWifiStaIface;
namespace {
-constexpr int32_t kFakePowerInDbm = -56;
+constexpr IWifiChip::TxPowerScenario kFakePowerScenario =
+ IWifiChip::TxPowerScenario::VOICE_CALL;
}; //namespace
/**
@@ -66,12 +67,12 @@
};
/*
- * SetTxPowerLimit
+ * SelectTxPowerScenario
*/
-TEST_F(WifiChipHidlTest, SetTxPowerLimit) {
+TEST_F(WifiChipHidlTest, SelectTxPowerScenario) {
uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
const auto& status =
- HIDL_INVOKE(wifi_chip_, setTxPowerLimit, kFakePowerInDbm);
+ HIDL_INVOKE(wifi_chip_, selectTxPowerScenario, kFakePowerScenario);
if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
} else {
@@ -80,12 +81,12 @@
}
/*
- * SetTxPowerLimit
+ * ResetTxPowerScenario
*/
-TEST_F(WifiChipHidlTest, ResetTxPowerLimit) {
+TEST_F(WifiChipHidlTest, ResetTxPowerScenario) {
uint32_t caps = configureChipForStaIfaceAndGetCapabilities();
const auto& status =
- HIDL_INVOKE(wifi_chip_, resetTxPowerLimit);
+ HIDL_INVOKE(wifi_chip_, resetTxPowerScenario);
if (caps & IWifiChip::ChipCapabilityMask::SET_TX_POWER_LIMIT) {
EXPECT_EQ(WifiStatusCode::SUCCESS, status.code);
} else {
diff --git a/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp b/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp
index 55f5a87..90c36dd 100644
--- a/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp
+++ b/wifi/offload/1.0/vts/functional/VtsHalWifiOffloadV1_0TargetTest.cpp
@@ -32,6 +32,8 @@
using ::android::hardware::wifi::offload::V1_0::IOffloadCallback;
using ::android::hardware::wifi::offload::V1_0::ScanResult;
using ::android::hardware::wifi::offload::V1_0::ScanParam;
+using ::android::hardware::wifi::offload::V1_0::Ssid;
+using ::android::hardware::wifi::offload::V1_0::NetworkInfo;
using ::android::hardware::wifi::offload::V1_0::ScanFilter;
using ::android::hardware::wifi::offload::V1_0::ScanStats;
using ::android::hardware::wifi::offload::V1_0::OffloadStatus;
@@ -45,7 +47,8 @@
constexpr char kOffloadCallbackSendError[] = "onError";
namespace {
-const uint8_t kSsid[] = {'G', 'o', 'o', 'g', 'l', 'e'};
+const uint8_t kSsid1[] = {'G', 'o', 'o', 'g', 'l', 'e'};
+const uint8_t kSsid2[] = {'X', 'f', 'i', 'n', 'i', 't', 'y'};
const uint8_t kBssid[6] = {0x12, 0xef, 0xa1, 0x2c, 0x97, 0x8b};
const int16_t kRssi = -60;
const uint32_t kFrequency = 2412;
@@ -53,6 +56,10 @@
const uint64_t kTsf = 0;
const uint16_t kCapability = 0;
const uint8_t kNetworkFlags = 0;
+const uint32_t kFrequency1 = 2412;
+const uint32_t kFrequency2 = 2437;
+const uint32_t kDisconnectedModeScanIntervalMs = 5000;
+const int16_t kRssiThreshold = -76;
}
class OffloadCallbackArgs {
@@ -133,7 +140,28 @@
*/
TEST_F(WifiOffloadHidlTest, configureScans) {
ScanParam* pScanParam = new ScanParam();
+ std::vector<uint32_t> frequencyList = {kFrequency1, kFrequency2};
+ pScanParam->disconnectedModeScanIntervalMs =
+ kDisconnectedModeScanIntervalMs;
+ pScanParam->frequencyList = frequencyList;
+ std::vector<Ssid> ssidList;
+ std::vector<std::vector<uint8_t>> ssids{kSsid1, kSsid2};
+ for (const auto& ssid : ssids) {
+ Ssid tmp = ssid;
+ ssidList.push_back(tmp);
+ }
+ pScanParam->ssidList = ssidList;
ScanFilter* pScanFilter = new ScanFilter();
+ pScanFilter->rssiThreshold = kRssiThreshold;
+ std::vector<std::vector<uint8_t>> match_ssids{kSsid1, kSsid2};
+ std::vector<uint8_t> security_flags{kNetworkFlags, kNetworkFlags};
+ std::vector<NetworkInfo> preferredNetworksList;
+ for (size_t i = 0; i < security_flags.size(); i++) {
+ NetworkInfo nwInfo;
+ nwInfo.ssid = match_ssids[i];
+ nwInfo.flags = security_flags[i];
+ preferredNetworksList.push_back(nwInfo);
+ }
const auto& result =
HIDL_INVOKE(wifi_offload_, configureScans, *pScanParam, *pScanFilter);
ASSERT_EQ(OffloadStatusCode::OK, result.code);
@@ -154,7 +182,7 @@
TEST_F(WifiOffloadHidlTest, getScanResults) {
wifi_offload_->setEventCallback(wifi_offload_cb_);
std::vector<ScanResult> scan_results;
- std::vector<uint8_t> ssid(kSsid, kSsid + sizeof(kSsid));
+ std::vector<uint8_t> ssid(kSsid1, kSsid1 + sizeof(kSsid1));
ScanResult scan_result;
scan_result.tsf = kTsf;
scan_result.rssi = kRssi;
diff --git a/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp b/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp
index a69d14d..33f3049 100644
--- a/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp
+++ b/wifi/supplicant/1.0/vts/functional/VtsHalWifiSupplicantV1_0TargetTest.cpp
@@ -23,12 +23,9 @@
class SupplicantHidlEnvironment : public ::testing::Environment {
public:
virtual void SetUp() override {
- stopWifiFramework();
stopSupplicant();
}
virtual void TearDown() override {
- startWifiFramework();
- // Framework will start wpa_supplicant.
}
};
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
index 0afab2f..3b75508 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -140,19 +140,6 @@
std::condition_variable condition_;
};
-void stopWifiFramework() {
- ASSERT_EQ(std::system("stop"), 0);
- // TODO: Use some other mechanism to wait for the framework to
- // finish disabling.
- sleep(5);
-}
-
-void startWifiFramework() {
- ASSERT_EQ(std::system("start"), 0);
- // These tests don't care whether the framework
- // finished enabling or not.
-}
-
void stopSupplicant() {
SupplicantManager supplicant_manager;