Merge "Add corresponding error code to fix vts test" into oc-mr1-dev
diff --git a/automotive/vehicle/2.1/Android.mk b/automotive/vehicle/2.1/Android.mk
index 095a1c7..2dfbefc 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)
@@ -358,9 +358,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 +370,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 +389,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 +408,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 +427,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 +446,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 +465,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 +484,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 +503,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 +522,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)
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 cea7f1b..e5f9411 100644
--- a/automotive/vehicle/2.1/types.hal
+++ b/automotive/vehicle/2.1/types.hal
@@ -260,8 +260,8 @@
       | 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,
@@ -270,13 +270,13 @@
 };
 
 /** 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,
 
@@ -288,7 +288,7 @@
 };
 
 /** Ignition monitors available for SPARK vehicles. */
-enum SparkIgnitionMonitors : CommonIgnitionMonitors {
+enum Obd2SparkIgnitionMonitors : Obd2CommonIgnitionMonitors {
   EGR_AVAILABLE = 0x1 << 6,
   EGR_INCOMPLETE = 0x1 << 7,
 
@@ -315,7 +315,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,
 
@@ -335,14 +335,16 @@
   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,
@@ -376,7 +378,7 @@
  * 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,
@@ -431,7 +433,7 @@
  * 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,
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 2985d42..f48a8db 100644
--- a/broadcastradio/1.1/default/Tuner.cpp
+++ b/broadcastradio/1.1/default/Tuner.cpp
@@ -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,14 +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()),
-      mIsAnalogForced(false) {
-    // 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);
@@ -66,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;
 
@@ -77,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);
     };
@@ -87,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
@@ -109,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);
@@ -140,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;
@@ -196,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");
@@ -244,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");
@@ -269,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;
 }
 
@@ -287,46 +302,57 @@
 
 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__);
-    _hidl_cb(Result::OK, mIsAnalogForced);
-    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) {
     ALOGV("%s", __func__);
+    lock_guard<mutex> lk(mMut);
+    if (mIsClosed) return Result::NOT_INITIALIZED;
+
     mIsAnalogForced = isForced;
     return Result::OK;
 }
diff --git a/broadcastradio/1.1/default/Tuner.h b/broadcastradio/1.1/default/Tuner.h
index 3efbd09..c4efe6e 100644
--- a/broadcastradio/1.1/default/Tuner.h
+++ b/broadcastradio/1.1/default/Tuner.h
@@ -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,13 +53,13 @@
    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;
@@ -67,8 +67,8 @@
     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 4c6b3b1..1c2285d 100644
--- a/broadcastradio/1.1/default/VirtualProgram.cpp
+++ b/broadcastradio/1.1/default/VirtualProgram.cpp
@@ -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 692e7bc..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 <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/utils/Utils.cpp b/broadcastradio/1.1/utils/Utils.cpp
index 8bb7691..50a407c 100644
--- a/broadcastradio/1.1/utils/Utils.cpp
+++ b/broadcastradio/1.1/utils/Utils.cpp
@@ -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;
diff --git a/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h b/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
index a7da9fe..4d69c0a 100644
--- a/broadcastradio/1.1/utils/include/broadcastradio-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}.
  *
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index c9f03b0..8ff9847 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -2213,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};
@@ -2257,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};
@@ -2272,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;
@@ -2288,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;
@@ -2303,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;
@@ -2383,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};
 
@@ -2441,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++,
@@ -2449,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};
@@ -2501,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};
@@ -2520,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;
@@ -2535,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;
@@ -2550,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;
@@ -2603,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++,
@@ -2611,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};
@@ -3291,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 cc89c69..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
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 549b592..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.
@@ -129,4 +130,116 @@
         ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
                     radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
     }
-}
\ No newline at end of file
+}
+
+/*
+ * 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_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 407b464..400ef3c 100644
--- a/radio/1.1/vts/functional/radio_response.cpp
+++ b/radio/1.1/vts/functional/radio_response.cpp
@@ -683,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
+}