Merge "Add test for additional ClearKey UUID." into oc-mr1-dev
diff --git a/audio/2.0/vts/functional/Android.bp b/audio/2.0/vts/functional/Android.bp
index b289709..f3b2ca7 100644
--- a/audio/2.0/vts/functional/Android.bp
+++ b/audio/2.0/vts/functional/Android.bp
@@ -16,29 +16,18 @@
 
 cc_test {
     name: "VtsHalAudioV2_0TargetTest",
-    defaults: ["hidl_defaults"],
-    srcs: ["AudioPrimaryHidlHalTest.cpp",
-           "ValidateAudioConfiguration.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libhidlbase",
-        "libhidltransport",
-        "libutils",
-        "libcutils",
-        "libxml2",
-        "android.hardware.audio@2.0",
-        "android.hardware.audio.common@2.0",
+    defaults: ["VtsHalTargetTestDefaults"],
+    srcs: [
+        "AudioPrimaryHidlHalTest.cpp",
+        "ValidateAudioConfiguration.cpp"
     ],
     static_libs: [
-        "VtsHalHidlTargetTestBase",
         "android.hardware.audio.common.test.utility",
+        "android.hardware.audio@2.0",
+        "android.hardware.audio.common@2.0",
+        "libxml2",
     ],
-    cflags: [
-        "-O0",
-        "-g",
-        "-Wall",
-        "-Wextra",
-        "-Werror",
+    shared_libs: [
+        "libicuuc",
     ],
 }
diff --git a/audio/effect/2.0/vts/functional/Android.bp b/audio/effect/2.0/vts/functional/Android.bp
index 15f1e64..7b421cb 100644
--- a/audio/effect/2.0/vts/functional/Android.bp
+++ b/audio/effect/2.0/vts/functional/Android.bp
@@ -16,30 +16,20 @@
 
 cc_test {
     name: "VtsHalAudioEffectV2_0TargetTest",
-    defaults: ["hidl_defaults"],
-    srcs: ["VtsHalAudioEffectV2_0TargetTest.cpp",
-           "ValidateAudioEffectsConfiguration.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "libxml2",
+    defaults: ["VtsHalTargetTestDefaults"],
+    srcs: [
+        "VtsHalAudioEffectV2_0TargetTest.cpp",
+        "ValidateAudioEffectsConfiguration.cpp"
+    ],
+    static_libs: [
+        "android.hardware.audio.common.test.utility",
         "android.hardware.audio.common@2.0",
         "android.hardware.audio.effect@2.0",
         "android.hidl.allocator@1.0",
         "android.hidl.memory@1.0",
+        "libxml2",
     ],
-    static_libs: [
-        "VtsHalHidlTargetTestBase",
-        "android.hardware.audio.common.test.utility",
-    ],
-    cflags: [
-        "-O0",
-        "-g",
-        "-Wextra",
+    shared_libs: [
+        "libicuuc",
     ],
 }
diff --git a/automotive/vehicle/2.1/types.hal b/automotive/vehicle/2.1/types.hal
index 2e361a3..569e1a5 100644
--- a/automotive/vehicle/2.1/types.hal
+++ b/automotive/vehicle/2.1/types.hal
@@ -249,7 +249,10 @@
       | VehicleArea:GLOBAL),
 };
 
-/** The status of the vehicle's fuel system. */
+/**
+ * The status of the vehicle's fuel system.
+ * These values come from the SAE J1979 standard.
+ */
 enum Obd2FuelSystemStatus : int32_t {
   OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1,
   CLOSED_LOOP = 2,
@@ -264,7 +267,10 @@
   COMPRESSION = 1,
 };
 
-/** These ignition monitors are common to both SPARK and COMPRESSION. */
+/**
+ * Ignition monitors common to both SPARK and COMPRESSION.
+ * These values come from the SAE J1979 standard.
+ */
 enum Obd2CommonIgnitionMonitors : int32_t {
   COMPONENTS_AVAILABLE = 0x1 << 0,
   COMPONENTS_INCOMPLETE = 0x1 << 1,
@@ -276,7 +282,10 @@
   MISFIRE_INCOMPLETE = 0x1 << 5,
 };
 
-/** Ignition monitors available for SPARK vehicles. */
+/**
+ * Ignition monitors available for SPARK vehicles.
+ * These values come from the SAE J1979 standard.
+ */
 enum Obd2SparkIgnitionMonitors : Obd2CommonIgnitionMonitors {
   EGR_AVAILABLE = 0x1 << 6,
   EGR_INCOMPLETE = 0x1 << 7,
@@ -303,7 +312,10 @@
   CATALYST_INCOMPLETE = 0x1 << 21,
 };
 
-/** Ignition monitors only available for COMPRESSION vehicles. */
+/**
+ * Ignition monitors only available for COMPRESSION vehicles.
+ * These values come from the SAE J1979 standard.
+ */
 enum Obd2CompressionIgnitionMonitors : Obd2CommonIgnitionMonitors {
   EGR_OR_VVT_AVAILABLE = 0x1 << 6,
   EGR_OR_VVT_INCOMPLETE = 0x1 << 7,
@@ -324,7 +336,10 @@
   NMHC_CATALYST_INCOMPLETE = 0x1 << 17,
 };
 
-/** The status of the vehicle's secondary air system. */
+/**
+ * The status of the vehicle's secondary air system.
+ * These values come from the SAE J1979 standard.
+ */
 enum Obd2SecondaryAirStatus : int32_t {
   UPSTREAM = 1,
   DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2,
@@ -332,7 +347,10 @@
   PUMP_ON_FOR_DIAGNOSTICS = 8,
 };
 
-/** The fuel type(s) supported by a vehicle. */
+/**
+ * The fuel type(s) supported by a vehicle.
+ * These values come from the SAE J1979 standard.
+ */
 enum Obd2FuelType : int32_t {
   NOT_AVAILABLE = 0,
   GASOLINE = 1,
@@ -366,14 +384,16 @@
  * Some of the properties are represented as an integer mapping to another enum. In those cases
  * expect a comment by the property definition describing the enum to look at for the mapping.
  * Any value greater than the last reserved index is available to vendors to map their extensions.
+ * While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next
+ * to each one to aid implementors.
  */
 enum DiagnosticIntegerSensorIndex : int32_t {
   /** refer to FuelSystemStatus for a description of this value. */
-  FUEL_SYSTEM_STATUS = 0,
-  MALFUNCTION_INDICATOR_LIGHT_ON = 1,
+  FUEL_SYSTEM_STATUS = 0, /* PID 0x03 */
+  MALFUNCTION_INDICATOR_LIGHT_ON = 1, /* PID 0x01 */
 
   /** refer to IgnitionMonitorKind for a description of this value. */
-  IGNITION_MONITORS_SUPPORTED = 2,
+  IGNITION_MONITORS_SUPPORTED = 2, /* PID 0x01 */
 
   /**
    * The value of this sensor is a bitmask that specifies whether ignition-specific
@@ -381,39 +401,39 @@
    * bits in this value are given by, respectively, SparkIgnitionMonitors and
    * CompressionIgnitionMonitors depending on the value of IGNITION_MONITORS_SUPPORTED.
    */
-  IGNITION_SPECIFIC_MONITORS = 3,
-  INTAKE_AIR_TEMPERATURE = 4,
+  IGNITION_SPECIFIC_MONITORS = 3, /* PID 0x01 */
+  INTAKE_AIR_TEMPERATURE = 4, /* PID 0x0F */
 
   /** refer to SecondaryAirStatus for a description of this value. */
-  COMMANDED_SECONDARY_AIR_STATUS = 5,
-  NUM_OXYGEN_SENSORS_PRESENT = 6,
-  RUNTIME_SINCE_ENGINE_START = 7,
-  DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8,
-  WARMUPS_SINCE_CODES_CLEARED = 9,
-  DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10,
-  ABSOLUTE_BAROMETRIC_PRESSURE = 11,
-  CONTROL_MODULE_VOLTAGE = 12,
-  AMBIENT_AIR_TEMPERATURE = 13,
-  TIME_WITH_MALFUNCTION_LIGHT_ON = 14,
-  TIME_SINCE_TROUBLE_CODES_CLEARED = 15,
-  MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16,
-  MAX_OXYGEN_SENSOR_VOLTAGE = 17,
-  MAX_OXYGEN_SENSOR_CURRENT = 18,
-  MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19,
-  MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20,
+  COMMANDED_SECONDARY_AIR_STATUS = 5, /* PID 0x12 */
+  NUM_OXYGEN_SENSORS_PRESENT = 6, /* PID 0x13 */
+  RUNTIME_SINCE_ENGINE_START = 7, /* PID 0x1F */
+  DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8, /* PID 0x21 */
+  WARMUPS_SINCE_CODES_CLEARED = 9, /* PID 0x30 */
+  DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10, /* PID 0x31 */
+  ABSOLUTE_BAROMETRIC_PRESSURE = 11, /* PID 0x33 */
+  CONTROL_MODULE_VOLTAGE = 12, /* PID 0x42 */
+  AMBIENT_AIR_TEMPERATURE = 13, /* PID 0x46 */
+  TIME_WITH_MALFUNCTION_LIGHT_ON = 14, /* PID 0x4D */
+  TIME_SINCE_TROUBLE_CODES_CLEARED = 15, /* PID 0x4E */
+  MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16, /* PID 0x4F */
+  MAX_OXYGEN_SENSOR_VOLTAGE = 17, /* PID 0x4F */
+  MAX_OXYGEN_SENSOR_CURRENT = 18, /* PID 0x4F */
+  MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19, /* PID 0x4F */
+  MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20, /* PID 0x50 */
 
   /** refer to FuelType for a description of this value. */
-  FUEL_TYPE = 21,
-  FUEL_RAIL_ABSOLUTE_PRESSURE = 22,
-  ENGINE_OIL_TEMPERATURE = 23,
-  DRIVER_DEMAND_PERCENT_TORQUE = 24,
-  ENGINE_ACTUAL_PERCENT_TORQUE = 25,
-  ENGINE_REFERENCE_PERCENT_TORQUE = 26,
-  ENGINE_PERCENT_TORQUE_DATA_IDLE = 27,
-  ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28,
-  ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29,
-  ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30,
-  ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31,
+  FUEL_TYPE = 21, /* PID 0x51 */
+  FUEL_RAIL_ABSOLUTE_PRESSURE = 22, /* PID 0x59 */
+  ENGINE_OIL_TEMPERATURE = 23, /* PID 0x5C */
+  DRIVER_DEMAND_PERCENT_TORQUE = 24, /* PID 0x61 */
+  ENGINE_ACTUAL_PERCENT_TORQUE = 25, /* PID 0x62 */
+  ENGINE_REFERENCE_PERCENT_TORQUE = 26, /* PID 0x63 */
+  ENGINE_PERCENT_TORQUE_DATA_IDLE = 27, /* PID 0x64 */
+  ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28, /* PID 0x64 */
+  ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29, /* PID 0x64 */
+  ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30, /* PID 0x64 */
+  ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31, /* PID 0x64 */
   LAST_SYSTEM_INDEX = ENGINE_PERCENT_TORQUE_DATA_POINT4,
 };
 
@@ -421,79 +441,81 @@
  * This enum provides the canonical mapping for sensor properties that have a floating-point value.
  * The ordering of the values is taken from the OBD2 specification.
  * Any value greater than the last reserved index is available to vendors to map their extensions.
+ * While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next
+ * to each one to aid implementors.
  */
 enum DiagnosticFloatSensorIndex : int32_t {
-  CALCULATED_ENGINE_LOAD = 0,
-  ENGINE_COOLANT_TEMPERATURE = 1,
-  SHORT_TERM_FUEL_TRIM_BANK1 = 2,
-  LONG_TERM_FUEL_TRIM_BANK1 = 3,
-  SHORT_TERM_FUEL_TRIM_BANK2 = 4,
-  LONG_TERM_FUEL_TRIM_BANK2 = 5,
-  FUEL_PRESSURE = 6,
-  INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7,
-  ENGINE_RPM = 8,
-  VEHICLE_SPEED = 9,
-  TIMING_ADVANCE = 10,
-  MAF_AIR_FLOW_RATE = 11,
-  THROTTLE_POSITION = 12,
-  OXYGEN_SENSOR1_VOLTAGE = 13,
-  OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14,
-  OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15,
-  OXYGEN_SENSOR2_VOLTAGE = 16,
-  OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17,
-  OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18,
-  OXYGEN_SENSOR3_VOLTAGE = 19,
-  OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20,
-  OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21,
-  OXYGEN_SENSOR4_VOLTAGE = 22,
-  OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23,
-  OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24,
-  OXYGEN_SENSOR5_VOLTAGE = 25,
-  OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26,
-  OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27,
-  OXYGEN_SENSOR6_VOLTAGE = 28,
-  OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29,
-  OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30,
-  OXYGEN_SENSOR7_VOLTAGE = 31,
-  OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32,
-  OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33,
-  OXYGEN_SENSOR8_VOLTAGE = 34,
-  OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35,
-  OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36,
-  FUEL_RAIL_PRESSURE = 37,
-  FUEL_RAIL_GAUGE_PRESSURE = 38,
-  COMMANDED_EXHAUST_GAS_RECIRCULATION = 39,
-  EXHAUST_GAS_RECIRCULATION_ERROR = 40,
-  COMMANDED_EVAPORATIVE_PURGE = 41,
-  FUEL_TANK_LEVEL_INPUT = 42,
-  EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43,
-  CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44,
-  CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45,
-  CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46,
-  CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47,
-  ABSOLUTE_LOAD_VALUE = 48,
-  FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49,
-  RELATIVE_THROTTLE_POSITION = 50,
-  ABSOLUTE_THROTTLE_POSITION_B = 51,
-  ABSOLUTE_THROTTLE_POSITION_C = 52,
-  ACCELERATOR_PEDAL_POSITION_D = 53,
-  ACCELERATOR_PEDAL_POSITION_E = 54,
-  ACCELERATOR_PEDAL_POSITION_F = 55,
-  COMMANDED_THROTTLE_ACTUATOR = 56,
-  ETHANOL_FUEL_PERCENTAGE = 57,
-  ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58,
-  SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59,
-  SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60,
-  SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61,
-  SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62,
-  LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63,
-  LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64,
-  LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65,
-  LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66,
-  RELATIVE_ACCELERATOR_PEDAL_POSITION = 67,
-  HYBRID_BATTERY_PACK_REMAINING_LIFE = 68,
-  FUEL_INJECTION_TIMING = 69,
-  ENGINE_FUEL_RATE = 70,
+  CALCULATED_ENGINE_LOAD = 0, /* PID 0x04 */
+  ENGINE_COOLANT_TEMPERATURE = 1, /* PID 0x05 */
+  SHORT_TERM_FUEL_TRIM_BANK1 = 2, /* PID 0x06 */
+  LONG_TERM_FUEL_TRIM_BANK1 = 3, /* PID 0x07 */
+  SHORT_TERM_FUEL_TRIM_BANK2 = 4, /* PID 0x08 */
+  LONG_TERM_FUEL_TRIM_BANK2 = 5, /* PID 0x09 */
+  FUEL_PRESSURE = 6, /* PID 0x0A */
+  INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7, /* PID 0x0B */
+  ENGINE_RPM = 8, /* PID 0x0C */
+  VEHICLE_SPEED = 9, /* PID 0x0D */
+  TIMING_ADVANCE = 10, /* PID 0x0E */
+  MAF_AIR_FLOW_RATE = 11, /* PID 0x10 */
+  THROTTLE_POSITION = 12, /* PID 0x11 */
+  OXYGEN_SENSOR1_VOLTAGE = 13, /* PID 0x14 */
+  OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14, /* PID 0x14 */
+  OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15, /* PID 0x24 */
+  OXYGEN_SENSOR2_VOLTAGE = 16, /* PID 0x15 */
+  OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17, /* PID 0x15 */
+  OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18, /* PID 0x25 */
+  OXYGEN_SENSOR3_VOLTAGE = 19, /* PID 0x16 */
+  OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20, /* PID 0x16 */
+  OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21, /* PID 0x26 */
+  OXYGEN_SENSOR4_VOLTAGE = 22, /* PID 0x17 */
+  OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23, /* PID 0x17 */
+  OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24, /* PID 0x27 */
+  OXYGEN_SENSOR5_VOLTAGE = 25, /* PID 0x18 */
+  OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26, /* PID 0x18 */
+  OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27, /* PID 0x28 */
+  OXYGEN_SENSOR6_VOLTAGE = 28, /* PID 0x19 */
+  OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29, /* PID 0x19 */
+  OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30, /* PID 0x29 */
+  OXYGEN_SENSOR7_VOLTAGE = 31, /* PID 0x1A */
+  OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32, /* PID 0x1A */
+  OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33, /* PID 0x2A */
+  OXYGEN_SENSOR8_VOLTAGE = 34, /* PID 0x1B */
+  OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35, /* PID 0x1B */
+  OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36, /* PID 0x2B */
+  FUEL_RAIL_PRESSURE = 37, /* PID 0x22 */
+  FUEL_RAIL_GAUGE_PRESSURE = 38, /* PID 0x23 */
+  COMMANDED_EXHAUST_GAS_RECIRCULATION = 39, /* PID 0x2C */
+  EXHAUST_GAS_RECIRCULATION_ERROR = 40, /* PID 0x2D */
+  COMMANDED_EVAPORATIVE_PURGE = 41, /* PID 0x2E */
+  FUEL_TANK_LEVEL_INPUT = 42, /* PID 0x2F */
+  EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43, /* PID 0x32 */
+  CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44, /* PID 0x3C */
+  CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45, /* PID 0x3D */
+  CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46, /* PID 0x3E */
+  CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47, /* PID 0x3F */
+  ABSOLUTE_LOAD_VALUE = 48, /* PID 0x43 */
+  FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49, /* PID 0x44 */
+  RELATIVE_THROTTLE_POSITION = 50, /* PID 0x45 */
+  ABSOLUTE_THROTTLE_POSITION_B = 51, /* PID 0x47 */
+  ABSOLUTE_THROTTLE_POSITION_C = 52, /* PID 0x48 */
+  ACCELERATOR_PEDAL_POSITION_D = 53, /* PID 0x49 */
+  ACCELERATOR_PEDAL_POSITION_E = 54, /* PID 0x4A */
+  ACCELERATOR_PEDAL_POSITION_F = 55, /* PID 0x4B */
+  COMMANDED_THROTTLE_ACTUATOR = 56, /* PID 0x4C */
+  ETHANOL_FUEL_PERCENTAGE = 57,/* PID 0x52 */
+  ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58, /* PID 0x53 */
+  SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59, /* PID 0x55 */
+  SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60, /* PID 0x57 */
+  SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61,/* PID 0x55 */
+  SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62, /* PID 0x57 */
+  LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, /* PID 0x56 */
+  LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, /* PID 0x58 */
+  LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65, /* PID 0x56 */
+  LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66, /* PID 0x58 */
+  RELATIVE_ACCELERATOR_PEDAL_POSITION = 67, /* PID 0x5A */
+  HYBRID_BATTERY_PACK_REMAINING_LIFE = 68, /* PID 0x5B */
+  FUEL_INJECTION_TIMING = 69, /* PID 0x5D */
+  ENGINE_FUEL_RATE = 70, /* PID 0x5E */
   LAST_SYSTEM_INDEX = ENGINE_FUEL_RATE,
 };
 
diff --git a/biometrics/fingerprint/2.1/vts/functional/Android.bp b/biometrics/fingerprint/2.1/vts/functional/Android.bp
index 27b7157..bee3657 100644
--- a/biometrics/fingerprint/2.1/vts/functional/Android.bp
+++ b/biometrics/fingerprint/2.1/vts/functional/Android.bp
@@ -16,21 +16,8 @@
 
 cc_test {
     name: "VtsHalBiometricsFingerprintV2_1TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalBiometricsFingerprintV2_1TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "libhidltransport",
-        "libhardware",
-        "libhidlbase",
-        "liblog",
-        "libutils",
-        "android.hardware.biometrics.fingerprint@2.1",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.biometrics.fingerprint@2.1"],
 }
 
diff --git a/bluetooth/1.0/default/OWNERS b/bluetooth/1.0/default/OWNERS
new file mode 100644
index 0000000..5df5bfe
--- /dev/null
+++ b/bluetooth/1.0/default/OWNERS
@@ -0,0 +1,3 @@
+eisenbach@google.com
+mylesgw@google.com
+pavlin@google.com
diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc
index ffc283e..15b6c74 100644
--- a/bluetooth/1.0/default/vendor_interface.cc
+++ b/bluetooth/1.0/default/vendor_interface.cc
@@ -226,6 +226,11 @@
   int fd_list[CH_MAX] = {0};
   int fd_count = lib_interface_->op(BT_VND_OP_USERIAL_OPEN, &fd_list);
 
+  if (fd_count < 1 || fd_count > CH_MAX - 1) {
+    ALOGE("%s: fd_count %d is invalid!", __func__, fd_count);
+    return false;
+  }
+
   for (int i = 0; i < fd_count; i++) {
     if (fd_list[i] == INVALID_FD) {
       ALOGE("%s: fd %d is invalid!", __func__, fd_list[i]);
diff --git a/boot/1.0/vts/functional/Android.bp b/boot/1.0/vts/functional/Android.bp
index 5b14f54..2ef89f3 100644
--- a/boot/1.0/vts/functional/Android.bp
+++ b/boot/1.0/vts/functional/Android.bp
@@ -16,20 +16,7 @@
 
 cc_test {
     name: "VtsHalBootV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalBootV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.boot@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.boot@1.0"],
 }
diff --git a/broadcastradio/1.0/vts/functional/Android.bp b/broadcastradio/1.0/vts/functional/Android.bp
index cf52f49..f31a2dc 100644
--- a/broadcastradio/1.0/vts/functional/Android.bp
+++ b/broadcastradio/1.0/vts/functional/Android.bp
@@ -16,21 +16,7 @@
 
 cc_test {
     name: "VtsHalBroadcastradioV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalBroadcastradioV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.broadcastradio@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.broadcastradio@1.0"],
 }
diff --git a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
index fa0f030..fd048db 100644
--- a/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
+++ b/broadcastradio/1.0/vts/functional/VtsHalBroadcastradioV1_0TargetTest.cpp
@@ -229,7 +229,18 @@
     bool getProperties();
     bool openTuner();
     bool checkAntenna();
-    BandConfig& getBand(unsigned idx);
+
+    /**
+     * Retrieves AM/FM band configuration from module properties.
+     *
+     * The configuration may not exist: if radio type is other than AM/FM
+     * or provided index is out of bounds.
+     * In such case, empty configuration is returned.
+     *
+     * @param idx Band index to retrieve.
+     * @return Band configuration reference.
+     */
+    const BandConfig& getBand(unsigned idx);
 
     static const nsecs_t kConnectCallbacktimeoutNs = seconds_to_nanoseconds(1);
     static const nsecs_t kConfigCallbacktimeoutNs = seconds_to_nanoseconds(10);
@@ -349,7 +360,7 @@
     return ((halResult == Result::OK) && (halConfig.antennaConnected == true));
 }
 
-BandConfig& BroadcastRadioHidlTest::getBand(unsigned idx) {
+const BandConfig& BroadcastRadioHidlTest::getBand(unsigned idx) {
     static BandConfig dummyBandConfig = {};
     if (radioClass == Class::AM_FM) {
         EXPECT_GT(mHalProperties.bands.size(), idx);
@@ -419,8 +430,12 @@
     auto openCb = [&](Result result, const sp<ITuner>&) { halResult = result; };
     auto hidlReturn = mRadio->openTuner(getBand(0), true, mTunerCallback, openCb);
     EXPECT_TRUE(hidlReturn.isOk());
-    if (halResult == Result::INVALID_STATE) {
-        EXPECT_TRUE(waitForCallback(kConfigCallbacktimeoutNs));
+    if (halResult == Result::OK) {
+        if (radioClass == Class::AM_FM) {
+            EXPECT_TRUE(waitForCallback(kConfigCallbacktimeoutNs));
+        }
+    } else {
+        EXPECT_EQ(Result::INVALID_STATE, halResult);
     }
 }
 
@@ -432,6 +447,9 @@
  *  - the methods return 0 (no error)
  *  - the configuration callback is received within kConfigCallbacktimeoutNs ns
  *  - the configuration read back from HAl has the same class Id
+ *
+ * Skipped for other radio classes than AM/FM, because setConfiguration
+ * applies only for these bands.
  */
 TEST_P(BroadcastRadioHidlTest, SetAndGetConfiguration) {
     if (radioClass != Class::AM_FM) skipped = true;
@@ -467,6 +485,9 @@
  * Verifies that:
  *  - the methods returns INVALID_ARGUMENTS on invalid arguments
  *  - the method recovers and succeeds after passing correct arguments
+ *
+ * Skipped for other radio classes than AM/FM, because setConfiguration
+ * applies only for these bands.
  */
 TEST_P(BroadcastRadioHidlTest, SetConfigurationFails) {
     if (radioClass != Class::AM_FM) skipped = true;
@@ -531,6 +552,9 @@
  *  - the method returns 0 (no error)
  *  - the tuned callback is received within kTuneCallbacktimeoutNs ns
  *  - skipping sub-channel or not does not fail the call
+ *
+ * Skipped for other radio classes than AM/FM, because step is not possible
+ * on DAB nor satellite.
  */
 TEST_P(BroadcastRadioHidlTest, Step) {
     if (radioClass != Class::AM_FM) skipped = true;
@@ -559,6 +583,9 @@
  *  - the HAL implements the methods
  *  - the methods return 0 (no error)
  *  - the tuned callback is received within kTuneCallbacktimeoutNs ns after tune()
+ *
+ * Skipped for other radio classes than AM/FM, because tune to frequency
+ * is not possible on DAB nor satellite.
  */
 TEST_P(BroadcastRadioHidlTest, TuneAndGetProgramInformationAndCancel) {
     if (radioClass != Class::AM_FM) skipped = true;
@@ -617,6 +644,9 @@
  * Verifies that:
  *  - the method returns INVALID_ARGUMENTS when applicable
  *  - the method recovers and succeeds after passing correct arguments
+ *
+ * Skipped for other radio classes than AM/FM, because tune to frequency
+ * is not possible on DAB nor satellite.
  */
 TEST_P(BroadcastRadioHidlTest, TuneFailsOutOfBounds) {
     if (radioClass != Class::AM_FM) skipped = true;
diff --git a/broadcastradio/1.1/default/BroadcastRadio.cpp b/broadcastradio/1.1/default/BroadcastRadio.cpp
index ce7a10f..38b4b99 100644
--- a/broadcastradio/1.1/default/BroadcastRadio.cpp
+++ b/broadcastradio/1.1/default/BroadcastRadio.cpp
@@ -45,16 +45,28 @@
         "Digital radio mock",
         {  // amFmBands
             AmFmBandConfig({
+                Band::AM,
+                153,         // lowerLimit
+                26100,       // upperLimit
+                {5, 9, 10},  // spacings
+            }),
+            AmFmBandConfig({
+                Band::FM,
+                65800,           // lowerLimit
+                108000,          // upperLimit
+                {10, 100, 200},  // spacings
+            }),
+            AmFmBandConfig({
                 Band::AM_HD,
-                540,   // lowerLimit
-                1610,  // upperLimit
-                10,    // spacing
+                153,         // lowerLimit
+                26100,       // upperLimit
+                {5, 9, 10},  // spacings
             }),
             AmFmBandConfig({
                 Band::FM_HD,
                 87900,   // lowerLimit
                 107900,  // upperLimit
-                200,     // spacing
+                {200},   // spacings
             }),
         },
     })},
@@ -114,14 +126,14 @@
         dst.antennaConnected = true;
         dst.lowerLimit = src.lowerLimit;
         dst.upperLimit = src.upperLimit;
-        dst.spacings = vector<uint32_t>({src.spacing});
+        dst.spacings = src.spacings;
 
-        if (src.type == Band::AM) {
+        if (utils::isAm(src.type)) {
             dst.ext.am.stereo = true;
-        } else if (src.type == Band::FM) {
-            dst.ext.fm.deemphasis = Deemphasis::D75;
+        } else if (utils::isFm(src.type)) {
+            dst.ext.fm.deemphasis = static_cast<Deemphasis>(Deemphasis::D50 | Deemphasis::D75);
             dst.ext.fm.stereo = true;
-            dst.ext.fm.rds = Rds::US;
+            dst.ext.fm.rds = static_cast<Rds>(Rds::WORLD | Rds::US);
             dst.ext.fm.ta = true;
             dst.ext.fm.af = true;
             dst.ext.fm.ea = true;
diff --git a/broadcastradio/1.1/default/BroadcastRadio.h b/broadcastradio/1.1/default/BroadcastRadio.h
index 71e3be8..a96a2ab 100644
--- a/broadcastradio/1.1/default/BroadcastRadio.h
+++ b/broadcastradio/1.1/default/BroadcastRadio.h
@@ -31,7 +31,7 @@
     V1_0::Band type;
     uint32_t lowerLimit;  // kHz
     uint32_t upperLimit;  // kHz
-    uint32_t spacing;     // kHz
+    std::vector<uint32_t> spacings;  // kHz
 };
 
 struct ModuleConfig {
diff --git a/broadcastradio/1.1/default/OWNERS b/broadcastradio/1.1/default/OWNERS
new file mode 100644
index 0000000..0c27b71
--- /dev/null
+++ b/broadcastradio/1.1/default/OWNERS
@@ -0,0 +1,4 @@
+# Automotive team
+egranata@google.com
+keunyoung@google.com
+twasilczyk@google.com
diff --git a/broadcastradio/1.1/default/Tuner.cpp b/broadcastradio/1.1/default/Tuner.cpp
index 87964d3..9a34cb1 100644
--- a/broadcastradio/1.1/default/Tuner.cpp
+++ b/broadcastradio/1.1/default/Tuner.cpp
@@ -83,7 +83,7 @@
         mAmfmConfig.antennaConnected = true;
         mCurrentProgram = utils::make_selector(mAmfmConfig.type, mAmfmConfig.lowerLimit);
 
-        if (mAmfmConfig.type == Band::FM_HD || mAmfmConfig.type == Band::FM) {
+        if (utils::isFm(mAmfmConfig.type)) {
             mVirtualRadio = std::ref(getFmRadio());
         } else {
             mVirtualRadio = std::ref(getAmRadio());
diff --git a/broadcastradio/1.1/tests/OWNERS b/broadcastradio/1.1/tests/OWNERS
new file mode 100644
index 0000000..aa5ce82
--- /dev/null
+++ b/broadcastradio/1.1/tests/OWNERS
@@ -0,0 +1,8 @@
+# Automotive team
+egranata@google.com
+keunyoung@google.com
+twasilczyk@google.com
+
+# VTS team
+ryanjcampbell@google.com
+yim@google.com
diff --git a/broadcastradio/1.1/utils/OWNERS b/broadcastradio/1.1/utils/OWNERS
new file mode 100644
index 0000000..0c27b71
--- /dev/null
+++ b/broadcastradio/1.1/utils/OWNERS
@@ -0,0 +1,4 @@
+# Automotive team
+egranata@google.com
+keunyoung@google.com
+twasilczyk@google.com
diff --git a/broadcastradio/1.1/utils/Utils.cpp b/broadcastradio/1.1/utils/Utils.cpp
index 8ccd98e..4dd6b13 100644
--- a/broadcastradio/1.1/utils/Utils.cpp
+++ b/broadcastradio/1.1/utils/Utils.cpp
@@ -115,6 +115,14 @@
     }
 }
 
+bool isAm(const Band band) {
+    return band == Band::AM || band == Band::AM_HD;
+}
+
+bool isFm(const Band band) {
+    return band == Band::FM || band == Band::FM_HD;
+}
+
 bool hasId(const ProgramSelector& sel, const IdentifierType type) {
     auto itype = static_cast<uint32_t>(type);
     if (sel.primaryId.type == itype) return true;
@@ -149,17 +157,12 @@
 
     // we can't use ProgramType::AM_HD or FM_HD, because we don't know HD station ID
     ProgramType type;
-    switch (band) {
-        case Band::AM:
-        case Band::AM_HD:
-            type = ProgramType::AM;
-            break;
-        case Band::FM:
-        case Band::FM_HD:
-            type = ProgramType::FM;
-            break;
-        default:
-            LOG_ALWAYS_FATAL("Unsupported band: %s", toString(band).c_str());
+    if (isAm(band)) {
+        type = ProgramType::AM;
+    } else if (isFm(band)) {
+        type = ProgramType::FM;
+    } else {
+        LOG_ALWAYS_FATAL("Unsupported band: %s", toString(band).c_str());
     }
 
     sel.programType = static_cast<uint32_t>(type);
@@ -215,9 +218,9 @@
     if (l.lowerLimit != r.lowerLimit) return false;
     if (l.upperLimit != r.upperLimit) return false;
     if (l.spacings != r.spacings) return false;
-    if (l.type == Band::AM || l.type == Band::AM_HD) {
+    if (V1_1::utils::isAm(l.type)) {
         return l.ext.am == r.ext.am;
-    } else if (l.type == Band::FM || l.type == Band::FM_HD) {
+    } else if (V1_1::utils::isFm(l.type)) {
         return l.ext.fm == r.ext.fm;
     } else {
         ALOGW("Unsupported band config type: %s", toString(l.type).c_str());
diff --git a/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h b/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
index 4d69c0a..24c60ee 100644
--- a/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
+++ b/broadcastradio/1.1/utils/include/broadcastradio-utils/Utils.h
@@ -48,6 +48,9 @@
 ProgramType getType(const ProgramSelector& sel);
 bool isAmFm(const ProgramType type);
 
+bool isAm(const V1_0::Band band);
+bool isFm(const V1_0::Band band);
+
 bool hasId(const ProgramSelector& sel, const IdentifierType type);
 
 /**
diff --git a/broadcastradio/1.1/vts/OWNERS b/broadcastradio/1.1/vts/OWNERS
new file mode 100644
index 0000000..aa5ce82
--- /dev/null
+++ b/broadcastradio/1.1/vts/OWNERS
@@ -0,0 +1,8 @@
+# Automotive team
+egranata@google.com
+keunyoung@google.com
+twasilczyk@google.com
+
+# VTS team
+ryanjcampbell@google.com
+yim@google.com
diff --git a/broadcastradio/1.1/vts/functional/Android.bp b/broadcastradio/1.1/vts/functional/Android.bp
index 6e5c84c..4b93cbc 100644
--- a/broadcastradio/1.1/vts/functional/Android.bp
+++ b/broadcastradio/1.1/vts/functional/Android.bp
@@ -16,28 +16,13 @@
 
 cc_test {
     name: "VtsHalBroadcastradioV1_1TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalBroadcastradioV1_1TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
+    static_libs: [
         "android.hardware.broadcastradio@1.0",
         "android.hardware.broadcastradio@1.1",
-    ],
-    static_libs: [
-        "VtsHalHidlTargetTestBase",
         "android.hardware.broadcastradio@1.1-utils-lib",
         "android.hardware.broadcastradio@1.1-vts-utils-lib",
         "libgmock",
     ],
-    cflags: [
-        "-Wextra",
-        "-O0",
-        "-g",
-    ],
 }
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 8ff9847..e6cd3b4 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -1417,8 +1417,8 @@
     }
 }
 
-// Image capture cancel should fail when image capture is not running.
-TEST_F(CameraHidlTest, cancelPictureFail) {
+// Image capture cancel is a no-op when image capture is not running.
+TEST_F(CameraHidlTest, cancelPictureNOP) {
     hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
 
     for (const auto& name : cameraDeviceNames) {
@@ -1433,7 +1433,7 @@
 
             Return<Status> returnStatus = device1->cancelPicture();
             ASSERT_TRUE(returnStatus.isOk());
-            ASSERT_NE(Status::OK, returnStatus);
+            ASSERT_EQ(Status::OK, returnStatus);
 
             stopPreviewAndClose(device1);
         }
diff --git a/configstore/1.0/vts/functional/Android.bp b/configstore/1.0/vts/functional/Android.bp
index 1775538..1b8a591 100644
--- a/configstore/1.0/vts/functional/Android.bp
+++ b/configstore/1.0/vts/functional/Android.bp
@@ -16,19 +16,8 @@
 
 cc_test {
     name: "VtsHalConfigstoreV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalConfigstoreV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "liblog",
-        "libutils",
-        "android.hardware.configstore@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.configstore@1.0"],
 }
 
diff --git a/configstore/1.1/default/Android.mk b/configstore/1.1/default/Android.mk
index ac3d8b0..58b67c1 100644
--- a/configstore/1.1/default/Android.mk
+++ b/configstore/1.1/default/Android.mk
@@ -3,6 +3,7 @@
 ################################################################################
 include $(CLEAR_VARS)
 LOCAL_MODULE := android.hardware.configstore@1.1-service
+LOCAL_REQUIRED_MODULES_arm64 := configstore@1.1.policy
 LOCAL_PROPRIETARY_MODULE := true
 LOCAL_MODULE_CLASS := EXECUTABLES
 LOCAL_MODULE_RELATIVE_PATH := hw
@@ -17,7 +18,18 @@
     libhidlbase \
     libhidltransport \
     libbase \
+    libhwminijail \
     liblog \
     libutils \
 
 include $(BUILD_EXECUTABLE)
+
+# seccomp filter for configstore
+ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), arm64))
+include $(CLEAR_VARS)
+LOCAL_MODULE := configstore@1.1.policy
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/seccomp_policy
+LOCAL_SRC_FILES := seccomp_policy/configstore@1.1-$(TARGET_ARCH).policy
+include $(BUILD_PREBUILT)
+endif
diff --git a/configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy b/configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy
new file mode 100644
index 0000000..8c901eb
--- /dev/null
+++ b/configstore/1.1/default/seccomp_policy/configstore@1.1-arm64.policy
@@ -0,0 +1,40 @@
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+futex: 1
+# ioctl: arg1 == BINDER_WRITE_READ
+ioctl: arg1 == 0xc0306201
+ioctl: 1
+# prctl: arg0 == PR_SET_NAME || arg0 == PR_SET_VMA || arg0 == PR_SET_TIMERSLACK
+prctl: arg0 == 15 || arg0 == 0x53564d41 || arg0 == 29
+openat: 1
+mmap: 1
+mprotect: 1
+close: 1
+getuid: 1
+read: 1
+faccessat: 1
+write: 1
+fstat: 1
+clone: 1
+munmap: 1
+lseek: 1
+sigaltstack: 1
+writev: 1
+setpriority: 1
+restart_syscall: 1
+exit: 1
+exit_group: 1
+rt_sigreturn: 1
+getrlimit: 1
diff --git a/configstore/1.1/default/service.cpp b/configstore/1.1/default/service.cpp
index 52db025..535e0cd 100644
--- a/configstore/1.1/default/service.cpp
+++ b/configstore/1.1/default/service.cpp
@@ -18,6 +18,7 @@
 
 #include <android/hardware/configstore/1.1/ISurfaceFlingerConfigs.h>
 #include <hidl/HidlTransportSupport.h>
+#include <hwminijail/HardwareMinijail.h>
 
 #include "SurfaceFlingerConfigs.h"
 
@@ -25,6 +26,7 @@
 using android::hardware::joinRpcThreadpool;
 using android::hardware::configstore::V1_1::ISurfaceFlingerConfigs;
 using android::hardware::configstore::V1_1::implementation::SurfaceFlingerConfigs;
+using android::hardware::SetupMinijail;
 using android::sp;
 using android::status_t;
 using android::OK;
@@ -32,6 +34,8 @@
 int main() {
     configureRpcThreadpool(10, true);
 
+    SetupMinijail("/vendor/etc/seccomp_policy/configstore@1.1.policy");
+
     sp<ISurfaceFlingerConfigs> surfaceFlingerConfigs = new SurfaceFlingerConfigs;
     status_t status = surfaceFlingerConfigs->registerAsService();
     LOG_ALWAYS_FATAL_IF(status != OK, "Could not register ISurfaceFlingerConfigs");
diff --git a/configstore/1.1/vts/functional/Android.bp b/configstore/1.1/vts/functional/Android.bp
index 5cfa483..59beb09 100644
--- a/configstore/1.1/vts/functional/Android.bp
+++ b/configstore/1.1/vts/functional/Android.bp
@@ -16,19 +16,11 @@
 
 cc_test {
     name: "VtsHalConfigstoreV1_1TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalConfigstoreV1_1TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "liblog",
-        "libutils",
+    static_libs: [
+        "android.hardware.configstore@1.0",
         "android.hardware.configstore@1.1",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
 }
 
diff --git a/contexthub/1.0/vts/functional/Android.bp b/contexthub/1.0/vts/functional/Android.bp
index c35386d..7c6e8c7 100644
--- a/contexthub/1.0/vts/functional/Android.bp
+++ b/contexthub/1.0/vts/functional/Android.bp
@@ -16,19 +16,8 @@
 
 cc_test {
     name: "VtsHalContexthubV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalContexthubV1_0TargetTest.cpp"],
-    shared_libs: [
-        "liblog",
-        "libhidlbase",
-        "libhidltransport",
-        "libutils",
-        "android.hardware.contexthub@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.contexthub@1.0"],
 }
 
diff --git a/current.txt b/current.txt
index bb5f2ac..f8cdc93 100644
--- a/current.txt
+++ b/current.txt
@@ -195,6 +195,7 @@
 e822cb7f4a1bdd45689c5e92ccd19a2201c20b771bd4b2ec1ae627e324591f9d android.hardware.radio@1.0::IRadioResponse
 6e69adb24d7c0b0ca3a54a38c49a5625b161b3f5d5f7d6fda0befdbbfc8e9e06 android.hardware.radio@1.0::IRadioResponse
 28e929b453df3d9f5060af2764e6cdb123ddb893e3e86923c877f6ff7e5f02c9 android.hardware.wifi@1.0::types
+df1d7b27e644bfed0a4f606a8c44d35d45cafce82c7c648494c8a25c7cd4a949 android.hardware.wifi@1.0::types
 
 # HALs released in Android O MR1
 
diff --git a/dumpstate/1.0/vts/functional/Android.bp b/dumpstate/1.0/vts/functional/Android.bp
index a1c735b..1ab530f 100644
--- a/dumpstate/1.0/vts/functional/Android.bp
+++ b/dumpstate/1.0/vts/functional/Android.bp
@@ -15,18 +15,7 @@
 
 cc_test {
     name: "VtsHalDumpstateV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalDumpstateV1_0TargetTest.cpp"],
-    shared_libs: [
-        "android.hardware.dumpstate@1.0",
-        "libcutils",
-        "libhidlbase",
-        "liblog",
-        "libutils",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.dumpstate@1.0"],
 }
diff --git a/gatekeeper/1.0/vts/functional/Android.bp b/gatekeeper/1.0/vts/functional/Android.bp
index 70cb615..aa1da7b 100644
--- a/gatekeeper/1.0/vts/functional/Android.bp
+++ b/gatekeeper/1.0/vts/functional/Android.bp
@@ -16,21 +16,7 @@
 
 cc_test {
     name: "VtsHalGatekeeperV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalGatekeeperV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.gatekeeper@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.gatekeeper@1.0"],
 }
diff --git a/gnss/1.0/vts/functional/Android.bp b/gnss/1.0/vts/functional/Android.bp
index 6d96059..d7713db 100644
--- a/gnss/1.0/vts/functional/Android.bp
+++ b/gnss/1.0/vts/functional/Android.bp
@@ -16,21 +16,7 @@
 
 cc_test {
     name: "VtsHalGnssV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalGnssV1_0TargetTest.cpp"],
-    shared_libs: [
-        "android.hardware.gnss@1.0",
-        "libbase",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "liblog",
-        "libnativehelper",
-        "libutils",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
-}
\ No newline at end of file
+    static_libs: ["android.hardware.gnss@1.0"],
+}
diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp
index 2e87144..1ba7c9a 100644
--- a/graphics/composer/2.1/vts/functional/Android.bp
+++ b/graphics/composer/2.1/vts/functional/Android.bp
@@ -44,33 +44,21 @@
 
 cc_test {
     name: "VtsHalGraphicsComposerV2_1TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalGraphicsComposerV2_1TargetTest.cpp"],
+
+    // TODO(b/64437680): Assume these libs are always available on the device.
     shared_libs: [
+        "libfmq",
+        "libsync",
+    ],
+    static_libs: [
         "android.hardware.graphics.allocator@2.0",
         "android.hardware.graphics.composer@2.1",
         "android.hardware.graphics.mapper@2.0",
-        "libbase",
-        "libcutils",
-        "libfmq",
-        "libhidlbase",
-        "libhidltransport",
-        "liblog",
-        "libnativehelper",
-        "libsync",
-        "libutils",
-    ],
-    static_libs: [
-        "libhwcomposer-command-buffer",
         "libVtsHalGraphicsComposerTestUtils",
         "libVtsHalGraphicsMapperTestUtils",
-        "VtsHalHidlTargetTestBase",
+        "libhwcomposer-command-buffer",
+        "libnativehelper",
     ],
-    cflags: [
-        "-Wall",
-        "-Wextra",
-        "-Werror",
-        "-O0",
-        "-g",
-    ]
 }
diff --git a/graphics/mapper/2.0/vts/functional/Android.bp b/graphics/mapper/2.0/vts/functional/Android.bp
index 1c0e4c5..ac6cb47 100644
--- a/graphics/mapper/2.0/vts/functional/Android.bp
+++ b/graphics/mapper/2.0/vts/functional/Android.bp
@@ -37,30 +37,16 @@
 
 cc_test {
     name: "VtsHalGraphicsMapperV2_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalGraphicsMapperV2_0TargetTest.cpp"],
     shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
         "libsync",
-        "libutils",
+    ],
+    static_libs: [
         "android.hardware.graphics.allocator@2.0",
         "android.hardware.graphics.mapper@2.0",
         "android.hardware.graphics.common@1.0",
-    ],
-    static_libs: [
         "libVtsHalGraphicsMapperTestUtils",
-        "VtsHalHidlTargetTestBase",
+        "libnativehelper",
     ],
-    cflags: [
-        "-Wall",
-        "-Wextra",
-        "-Werror",
-        "-O0",
-        "-g",
-    ]
 }
diff --git a/health/1.0/vts/functional/Android.bp b/health/1.0/vts/functional/Android.bp
index 1a4c8c8..8742651 100644
--- a/health/1.0/vts/functional/Android.bp
+++ b/health/1.0/vts/functional/Android.bp
@@ -16,17 +16,7 @@
 
 cc_test {
     name: "VtsHalHealthV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalHealthV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libhidlbase",
-        "liblog",
-        "libutils",
-        "android.hardware.health@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.health@1.0"],
 }
diff --git a/keymaster/3.0/vts/functional/Android.bp b/keymaster/3.0/vts/functional/Android.bp
new file mode 100644
index 0000000..7d96704
--- /dev/null
+++ b/keymaster/3.0/vts/functional/Android.bp
@@ -0,0 +1,32 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+cc_test {
+    name: "VtsHalKeymasterV3_0TargetTest",
+    defaults: ["VtsHalTargetTestDefaults"],
+    srcs: [
+        "authorization_set.cpp",
+        "attestation_record.cpp",
+        "key_param_output.cpp",
+        "keymaster_hidl_hal_test.cpp",
+        "keystore_tags_utils.cpp",
+    ],
+    static_libs: [
+        "android.hardware.keymaster@3.0",
+        "libcrypto",
+        "libsoftkeymasterdevice",
+    ],
+}
diff --git a/keymaster/3.0/vts/functional/Android.mk b/keymaster/3.0/vts/functional/Android.mk
deleted file mode 100644
index 4098664..0000000
--- a/keymaster/3.0/vts/functional/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := VtsHalKeymasterV3_0TargetTest
-LOCAL_SRC_FILES := \
-        authorization_set.cpp \
-        attestation_record.cpp \
-        key_param_output.cpp \
-        keymaster_hidl_hal_test.cpp \
-        keystore_tags_utils.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
-        android.hardware.keymaster@3.0 \
-        libcrypto \
-        libhidlbase \
-        liblog \
-        libsoftkeymasterdevice \
-        libutils \
-
-LOCAL_STATIC_LIBRARIES := \
-        VtsHalHidlTargetTestBase \
-
-LOCAL_CFLAGS := -Wall -Werror
-
-include $(BUILD_NATIVE_TEST)
diff --git a/keymaster/Android.bp b/keymaster/Android.bp
index 09b8cb2..90a0195 100644
--- a/keymaster/Android.bp
+++ b/keymaster/Android.bp
@@ -1,4 +1,5 @@
 // This is an autogenerated file, do not edit.
 subdirs = [
     "3.0",
+    "3.0/vts/functional",
 ]
diff --git a/light/2.0/vts/functional/Android.bp b/light/2.0/vts/functional/Android.bp
index 0558ff2..e0ec4cf 100644
--- a/light/2.0/vts/functional/Android.bp
+++ b/light/2.0/vts/functional/Android.bp
@@ -16,19 +16,8 @@
 
 cc_test {
     name: "VtsHalLightV2_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalLightV2_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "liblog",
-        "libutils",
-        "android.hardware.light@2.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.light@2.0"],
 }
 
diff --git a/media/omx/1.0/vts/functional/audio/Android.bp b/media/omx/1.0/vts/functional/audio/Android.bp
index 66fd20b..f517fa1 100644
--- a/media/omx/1.0/vts/functional/audio/Android.bp
+++ b/media/omx/1.0/vts/functional/audio/Android.bp
@@ -16,65 +16,19 @@
 
 cc_test {
     name: "VtsHalMediaOmxV1_0TargetAudioEncTest",
-    defaults: ["hidl_defaults"],
-    srcs: ["VtsHalMediaOmxV1_0TargetAudioEncTest.cpp",
-           "media_audio_hidl_test_common.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidlmemory",
-        "libhidltransport",
-        "libhwbinder",
-        "libnativehelper",
-        "libutils",
-        "libstagefright_foundation",
-        "android.hidl.allocator@1.0",
-        "android.hidl.memory@1.0",
-        "android.hardware.media.omx@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase",
-                  "VtsHalMediaOmxV1_0CommonUtil"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
-    include_dirs: [
-        "frameworks/native/include/media/openmax/",
-        "hardware/interfaces/media/omx/1.0/vts/functional/common",
+    defaults: ["VtsHalMediaOmxV1_0Defaults"],
+    srcs: [
+        "VtsHalMediaOmxV1_0TargetAudioEncTest.cpp",
+        "media_audio_hidl_test_common.cpp"
     ],
 }
 
 cc_test {
     name: "VtsHalMediaOmxV1_0TargetAudioDecTest",
-    defaults: ["hidl_defaults"],
-    srcs: ["VtsHalMediaOmxV1_0TargetAudioDecTest.cpp",
-           "media_audio_hidl_test_common.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidlmemory",
-        "libhidltransport",
-        "libhwbinder",
-        "libnativehelper",
-        "libutils",
-        "libstagefright_foundation",
-        "android.hidl.allocator@1.0",
-        "android.hidl.memory@1.0",
-        "android.hardware.media.omx@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase",
-                  "VtsHalMediaOmxV1_0CommonUtil"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
-    include_dirs: [
-        "frameworks/native/include/media/openmax/",
-        "hardware/interfaces/media/omx/1.0/vts/functional/common",
+    defaults: ["VtsHalMediaOmxV1_0Defaults"],
+    srcs: [
+        "VtsHalMediaOmxV1_0TargetAudioDecTest.cpp",
+        "media_audio_hidl_test_common.cpp"
     ],
 }
 
diff --git a/media/omx/1.0/vts/functional/common/Android.bp b/media/omx/1.0/vts/functional/common/Android.bp
old mode 100755
new mode 100644
index 93251fe..af55e3a
--- a/media/omx/1.0/vts/functional/common/Android.bp
+++ b/media/omx/1.0/vts/functional/common/Android.bp
@@ -16,18 +16,40 @@
 
 cc_library_static {
     name: "VtsHalMediaOmxV1_0CommonUtil",
-    defaults: ["hidl_defaults"],
     srcs: ["media_hidl_test_common.cpp"],
-    shared_libs: [
-        "liblog",
+
+    header_libs: ["media_plugin_headers"],
+    export_header_lib_headers: ["media_plugin_headers"],
+    export_include_dirs: ["."],
+
+    static_libs: [
+        "VtsHalHidlTargetTestBase",
         "libhidlmemory",
         "android.hidl.allocator@1.0",
         "android.hidl.memory@1.0",
         "android.hardware.media.omx@1.0",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [ "-O0", "-g", ],
-    include_dirs: [
-        "frameworks/native/include/media/openmax/",
+}
+
+cc_defaults {
+    name: "VtsHalMediaOmxV1_0Defaults",
+    defaults: ["VtsHalTargetTestDefaults"],
+
+    // Link to these statically as they are not guaranteed to be on the device.
+    static_libs: [
+        "VtsHalMediaOmxV1_0CommonUtil",
+        "android.hardware.graphics.bufferqueue@1.0",
+        "android.hardware.graphics.common@1.0",
+        "android.hardware.media.omx@1.0",
+        "android.hardware.media@1.0",
+        "android.hidl.allocator@1.0",
+        "android.hidl.memory@1.0",
+        "libhidlmemory",
+        "libnativehelper",
+    ],
+
+    // TODO(b/64437680): Assume these libs are always available on the device.
+    shared_libs: [
+        "libstagefright_foundation",
     ],
 }
diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp
old mode 100755
new mode 100644
index 863731a..b7d53ed
--- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp
+++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp
@@ -60,6 +60,25 @@
     return setParam(omxNode, OMX_IndexParamStandardComponentRole, &params);
 }
 
+Return<android::hardware::media::omx::V1_0::Status> setPortBufferSize(
+    sp<IOmxNode> omxNode, OMX_U32 portIndex, OMX_U32 size) {
+    android::hardware::media::omx::V1_0::Status status;
+    OMX_PARAM_PORTDEFINITIONTYPE portDef;
+
+    status = getPortParam(omxNode, OMX_IndexParamPortDefinition, portIndex,
+                          &portDef);
+    if (status != ::android::hardware::media::omx::V1_0::Status::OK)
+        return status;
+    if (portDef.nBufferSize < size) {
+        portDef.nBufferSize = size;
+        status = setPortParam(omxNode, OMX_IndexParamPortDefinition, portIndex,
+                              &portDef);
+        if (status != ::android::hardware::media::omx::V1_0::Status::OK)
+            return status;
+    }
+    return status;
+}
+
 // get/set video component port format
 Return<android::hardware::media::omx::V1_0::Status> setVideoPortFormat(
     sp<IOmxNode> omxNode, OMX_U32 portIndex,
diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h
index b3ca92c..d3ecc59 100644
--- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h
+++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h
@@ -54,6 +54,9 @@
  */
 #define RANDOM_INDEX 1729
 
+#define ALIGN_POWER_OF_TWO(value, n) \
+    (((value) + ((1 << (n)) - 1)) & ~((1 << (n)) - 1))
+
 enum bufferOwner {
     client,
     component,
@@ -123,20 +126,21 @@
         android::Vector<BufferInfo>* iBuffers = nullptr,
         android::Vector<BufferInfo>* oBuffers = nullptr) {
         int64_t finishBy = android::ALooper::GetNowUs() + timeoutUs;
+        android::Mutex::Autolock autoLock(msgLock);
         for (;;) {
-            android::Mutex::Autolock autoLock(msgLock);
             android::List<Message>::iterator it = msgQueue.begin();
             while (it != msgQueue.end()) {
                 if (it->type ==
                     android::hardware::media::omx::V1_0::Message::Type::EVENT) {
                     *msg = *it;
-                    msgQueue.erase(it);
+                    it = msgQueue.erase(it);
                     // OMX_EventBufferFlag event is sent when the component has
                     // processed a buffer with its EOS flag set. This event is
                     // not sent by soft omx components. Vendor components can
                     // send this. From IOMX point of view, we will ignore this
                     // event.
-                    if (msg->data.eventData.event == OMX_EventBufferFlag) break;
+                    if (msg->data.eventData.event == OMX_EventBufferFlag)
+                        continue;
                     return ::android::hardware::media::omx::V1_0::Status::OK;
                 } else if (it->type == android::hardware::media::omx::V1_0::
                                            Message::Type::FILL_BUFFER_DONE) {
@@ -147,7 +151,7 @@
                                 it->data.bufferData.buffer) {
                                 if (callBack) callBack(*it, &(*oBuffers)[i]);
                                 oBuffers->editItemAt(i).owner = client;
-                                msgQueue.erase(it);
+                                it = msgQueue.erase(it);
                                 break;
                             }
                         }
@@ -162,24 +166,22 @@
                                 it->data.bufferData.buffer) {
                                 if (callBack) callBack(*it, &(*iBuffers)[i]);
                                 iBuffers->editItemAt(i).owner = client;
-                                msgQueue.erase(it);
+                                it = msgQueue.erase(it);
                                 break;
                             }
                         }
                         EXPECT_LE(i, iBuffers->size());
                     }
+                } else {
+                    EXPECT_TRUE(false) << "Received unexpected message";
+                    ++it;
                 }
-                ++it;
             }
-            if (finishBy - android::ALooper::GetNowUs() < 0)
-                return toStatus(android::TIMED_OUT);
-            android::status_t err =
-                (timeoutUs < 0)
-                    ? msgCondition.wait(msgLock)
-                    : msgCondition.waitRelative(
-                          msgLock,
-                          (finishBy - android::ALooper::GetNowUs()) * 1000ll);
-            if (err == android::TIMED_OUT) return toStatus(err);
+            int64_t delayUs = finishBy - android::ALooper::GetNowUs();
+            if (delayUs < 0) return toStatus(android::TIMED_OUT);
+            (timeoutUs < 0)
+                ? msgCondition.wait(msgLock)
+                : msgCondition.waitRelative(msgLock, delayUs * 1000ll);
         }
     }
 
@@ -283,6 +285,9 @@
 Return<android::hardware::media::omx::V1_0::Status> setRole(
     sp<IOmxNode> omxNode, const char* role);
 
+Return<android::hardware::media::omx::V1_0::Status> setPortBufferSize(
+    sp<IOmxNode> omxNode, OMX_U32 portIndex, OMX_U32 size);
+
 Return<android::hardware::media::omx::V1_0::Status> setVideoPortFormat(
     sp<IOmxNode> omxNode, OMX_U32 portIndex,
     OMX_VIDEO_CODINGTYPE eCompressionFormat, OMX_COLOR_FORMATTYPE eColorFormat,
diff --git a/media/omx/1.0/vts/functional/component/Android.bp b/media/omx/1.0/vts/functional/component/Android.bp
index fd3210f..f76b6e9 100644
--- a/media/omx/1.0/vts/functional/component/Android.bp
+++ b/media/omx/1.0/vts/functional/component/Android.bp
@@ -16,32 +16,7 @@
 
 cc_test {
     name: "VtsHalMediaOmxV1_0TargetComponentTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalMediaOmxV1_0Defaults"],
     srcs: ["VtsHalMediaOmxV1_0TargetComponentTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidlmemory",
-        "libhidltransport",
-        "libhwbinder",
-        "libnativehelper",
-        "libutils",
-        "libstagefright_foundation",
-        "android.hidl.allocator@1.0",
-        "android.hidl.memory@1.0",
-        "android.hardware.media.omx@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase",
-                  "VtsHalMediaOmxV1_0CommonUtil"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
-    include_dirs: [
-        "frameworks/native/include/media/openmax/",
-        "hardware/interfaces/media/omx/1.0/vts/functional/common",
-    ],
 }
 
diff --git a/media/omx/1.0/vts/functional/master/Android.bp b/media/omx/1.0/vts/functional/master/Android.bp
index e24b79b..4a45e69 100644
--- a/media/omx/1.0/vts/functional/master/Android.bp
+++ b/media/omx/1.0/vts/functional/master/Android.bp
@@ -16,29 +16,7 @@
 
 cc_test {
     name: "VtsHalMediaOmxV1_0TargetMasterTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalMediaOmxV1_0Defaults"],
     srcs: ["VtsHalMediaOmxV1_0TargetMasterTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libnativehelper",
-        "libutils",
-        "android.hidl.allocator@1.0",
-        "android.hidl.memory@1.0",
-        "android.hardware.media.omx@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
-    include_dirs: [
-        "frameworks/native/include/media/openmax/",
-        "hardware/interfaces/media/omx/1.0/vts/functional/common",
-    ],
 }
 
diff --git a/media/omx/1.0/vts/functional/video/Android.bp b/media/omx/1.0/vts/functional/video/Android.bp
index 4e94f3b..e251a15 100644
--- a/media/omx/1.0/vts/functional/video/Android.bp
+++ b/media/omx/1.0/vts/functional/video/Android.bp
@@ -16,70 +16,26 @@
 
 cc_test {
     name: "VtsHalMediaOmxV1_0TargetVideoDecTest",
-    defaults: ["hidl_defaults"],
-    srcs: ["VtsHalMediaOmxV1_0TargetVideoDecTest.cpp",
-           "media_video_hidl_test_common.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidlmemory",
-        "libhidltransport",
-        "libhwbinder",
-        "libnativehelper",
-        "libutils",
-        "libstagefright_foundation",
-        "android.hidl.allocator@1.0",
-        "android.hidl.memory@1.0",
-        "android.hardware.media.omx@1.0",
+    defaults: ["VtsHalMediaOmxV1_0Defaults"],
+    srcs: [
+        "VtsHalMediaOmxV1_0TargetVideoDecTest.cpp",
+        "media_video_hidl_test_common.cpp"
+    ],
+    static_libs: [
         "android.hardware.graphics.allocator@2.0",
         "android.hardware.graphics.mapper@2.0",
-        "android.hardware.graphics.common@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase",
-                  "VtsHalMediaOmxV1_0CommonUtil"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
-    include_dirs: [
-        "frameworks/native/include/media/openmax/",
-        "hardware/interfaces/media/omx/1.0/vts/functional/common",
     ],
 }
 
 cc_test {
     name: "VtsHalMediaOmxV1_0TargetVideoEncTest",
-    defaults: ["hidl_defaults"],
-    srcs: ["VtsHalMediaOmxV1_0TargetVideoEncTest.cpp",
-           "media_video_hidl_test_common.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidlmemory",
-        "libhidltransport",
-        "libhwbinder",
-        "libnativehelper",
+    defaults: ["VtsHalMediaOmxV1_0Defaults"],
+    srcs: [
+        "VtsHalMediaOmxV1_0TargetVideoEncTest.cpp",
+        "media_video_hidl_test_common.cpp"
+    ],
+    static_libs: [
         "libnativewindow",
-        "libutils",
-        "libstagefright_foundation",
-        "android.hidl.allocator@1.0",
-        "android.hidl.memory@1.0",
-        "android.hardware.media.omx@1.0",
-        "android.hardware.graphics.bufferqueue@1.0",
         "android.hardware.graphics.mapper@2.0",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase",
-                  "VtsHalMediaOmxV1_0CommonUtil"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
-    include_dirs: [
-        "frameworks/native/include/media/openmax/",
-        "hardware/interfaces/media/omx/1.0/vts/functional/common",
-    ],
 }
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
index 16ba745..c75bd7c 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
@@ -27,6 +27,7 @@
 #include <android/hidl/allocator/1.0/IAllocator.h>
 #include <android/hidl/memory/1.0/IMapper.h>
 #include <android/hidl/memory/1.0/IMemory.h>
+#include <cutils/atomic.h>
 
 using ::android::hardware::graphics::common::V1_0::BufferUsage;
 using ::android::hardware::graphics::common::V1_0::PixelFormat;
@@ -47,6 +48,7 @@
 
 #include <VtsHalHidlTargetTestBase.h>
 #include <getopt.h>
+#include <media/hardware/HardwareAPI.h>
 #include <media_hidl_test_common.h>
 #include <media_video_hidl_test_common.h>
 #include <fstream>
@@ -410,7 +412,7 @@
 void allocateGraphicBuffers(sp<IOmxNode> omxNode, OMX_U32 portIndex,
                             android::Vector<BufferInfo>* buffArray,
                             uint32_t nFrameWidth, uint32_t nFrameHeight,
-                            int32_t* nStride, uint32_t count) {
+                            int32_t* nStride, int format, uint32_t count) {
     android::hardware::media::omx::V1_0::Status status;
     sp<android::hardware::graphics::allocator::V2_0::IAllocator> allocator =
         android::hardware::graphics::allocator::V2_0::IAllocator::getService();
@@ -427,7 +429,7 @@
     descriptorInfo.width = nFrameWidth;
     descriptorInfo.height = nFrameHeight;
     descriptorInfo.layerCount = 1;
-    descriptorInfo.format = PixelFormat::RGBA_8888;
+    descriptorInfo.format = static_cast<PixelFormat>(format);
     descriptorInfo.usage = static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN);
     omxNode->getGraphicBufferUsage(
         portIndex,
@@ -452,6 +454,9 @@
     EXPECT_EQ(error, android::hardware::graphics::mapper::V2_0::Error::NONE);
 
     EXPECT_EQ(buffArray->size(), count);
+
+    static volatile int32_t nextId = 0;
+    uint64_t id = static_cast<uint64_t>(getpid()) << 32;
     allocator->allocate(
         descriptor, count,
         [&](android::hardware::graphics::mapper::V2_0::Error _s, uint32_t _n1,
@@ -475,7 +480,7 @@
                 buffArray->editItemAt(i).omxBuffer.attr.anwBuffer.layerCount =
                     descriptorInfo.layerCount;
                 buffArray->editItemAt(i).omxBuffer.attr.anwBuffer.id =
-                    (*buffArray)[i].id;
+                    id | static_cast<uint32_t>(android_atomic_inc(&nextId));
             }
         });
 }
@@ -521,12 +526,15 @@
 
                 // set Port Params
                 uint32_t nFrameWidth, nFrameHeight, xFramerate;
-                OMX_COLOR_FORMATTYPE eColorFormat =
-                    OMX_COLOR_FormatYUV420Planar;
                 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth,
                                     &nFrameHeight, &xFramerate);
+                // get configured color format
+                OMX_PARAM_PORTDEFINITIONTYPE portDef;
+                status = getPortParam(omxNode, OMX_IndexParamPortDefinition,
+                                      kPortIndexOutput, &portDef);
                 setDefaultPortParam(omxNode, kPortIndexOutput,
-                                    OMX_VIDEO_CodingUnused, eColorFormat,
+                                    OMX_VIDEO_CodingUnused,
+                                    portDef.format.video.eColorFormat,
                                     nFrameWidth, nFrameHeight, 0, xFramerate);
 
                 // If you can disable a port, then you should be able to
@@ -558,6 +566,7 @@
                                            portDef.format.video.nFrameWidth,
                                            portDef.format.video.nFrameHeight,
                                            &portDef.format.video.nStride,
+                                           portDef.format.video.eColorFormat,
                                            portDef.nBufferCountActual);
                 }
                 status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT,
@@ -717,6 +726,116 @@
     }
 }
 
+// DescribeColorFormatParams Copy Constructor (Borrowed from OMXUtils.cpp)
+android::DescribeColorFormatParams::DescribeColorFormatParams(
+    const android::DescribeColorFormat2Params& params) {
+    eColorFormat = params.eColorFormat;
+    nFrameWidth = params.nFrameWidth;
+    nFrameHeight = params.nFrameHeight;
+    nStride = params.nStride;
+    nSliceHeight = params.nSliceHeight;
+    bUsingNativeBuffers = params.bUsingNativeBuffers;
+};
+
+bool isColorFormatFlexibleYUV(sp<IOmxNode> omxNode,
+                              OMX_COLOR_FORMATTYPE eColorFormat) {
+    android::hardware::media::omx::V1_0::Status status;
+    unsigned int index = OMX_IndexMax, index2 = OMX_IndexMax;
+    omxNode->getExtensionIndex(
+        "OMX.google.android.index.describeColorFormat",
+        [&index](android::hardware::media::omx::V1_0::Status _s,
+                          unsigned int _nl) {
+            if (_s == ::android::hardware::media::omx::V1_0::Status::OK)
+                index = _nl;
+        });
+    omxNode->getExtensionIndex(
+        "OMX.google.android.index.describeColorFormat2",
+        [&index2](android::hardware::media::omx::V1_0::Status _s,
+                           unsigned int _nl) {
+            if (_s == ::android::hardware::media::omx::V1_0::Status::OK)
+                index2 = _nl;
+        });
+
+    android::DescribeColorFormat2Params describeParams;
+    describeParams.eColorFormat = eColorFormat;
+    describeParams.nFrameWidth = 128;
+    describeParams.nFrameHeight = 128;
+    describeParams.nStride = 128;
+    describeParams.nSliceHeight = 128;
+    describeParams.bUsingNativeBuffers = OMX_FALSE;
+    if (index != OMX_IndexMax) {
+        android::DescribeColorFormatParams describeParamsV1(describeParams);
+        status = getParam(omxNode, static_cast<OMX_INDEXTYPE>(index),
+                          &describeParamsV1);
+        if (status == ::android::hardware::media::omx::V1_0::Status::OK) {
+            android::MediaImage& img = describeParamsV1.sMediaImage;
+            if (img.mType == android::MediaImage::MEDIA_IMAGE_TYPE_YUV) {
+                if (img.mNumPlanes == 3 &&
+                    img.mPlane[img.Y].mHorizSubsampling == 1 &&
+                    img.mPlane[img.Y].mVertSubsampling == 1) {
+                    if (img.mPlane[img.U].mHorizSubsampling == 2 &&
+                        img.mPlane[img.U].mVertSubsampling == 2 &&
+                        img.mPlane[img.V].mHorizSubsampling == 2 &&
+                        img.mPlane[img.V].mVertSubsampling == 2) {
+                        if (img.mBitDepth <= 8) {
+                            return true;
+                        }
+                    }
+                }
+            }
+        }
+    } else if (index2 != OMX_IndexMax) {
+        status = getParam(omxNode, static_cast<OMX_INDEXTYPE>(index2),
+                          &describeParams);
+        android::MediaImage2& img = describeParams.sMediaImage;
+        if (img.mType == android::MediaImage2::MEDIA_IMAGE_TYPE_YUV) {
+            if (img.mNumPlanes == 3 &&
+                img.mPlane[img.Y].mHorizSubsampling == 1 &&
+                img.mPlane[img.Y].mVertSubsampling == 1) {
+                if (img.mPlane[img.U].mHorizSubsampling == 2 &&
+                    img.mPlane[img.U].mVertSubsampling == 2 &&
+                    img.mPlane[img.V].mHorizSubsampling == 2 &&
+                    img.mPlane[img.V].mVertSubsampling == 2) {
+                    if (img.mBitDepth <= 8) {
+                        return true;
+                    }
+                }
+            }
+        }
+    }
+    return false;
+}
+
+// get default color format for output port
+void getDefaultColorFormat(sp<IOmxNode> omxNode, OMX_U32 kPortIndexOutput,
+                           PortMode oPortMode,
+                           OMX_COLOR_FORMATTYPE* eColorFormat) {
+    android::hardware::media::omx::V1_0::Status status;
+    OMX_VIDEO_PARAM_PORTFORMATTYPE portFormat;
+    *eColorFormat = OMX_COLOR_FormatUnused;
+    portFormat.nIndex = 0;
+    while (1) {
+        status = getPortParam(omxNode, OMX_IndexParamVideoPortFormat,
+                              kPortIndexOutput, &portFormat);
+        if (status != ::android::hardware::media::omx::V1_0::Status::OK) break;
+        EXPECT_EQ(portFormat.eCompressionFormat, OMX_VIDEO_CodingUnused);
+        if (oPortMode != PortMode::PRESET_BYTE_BUFFER) {
+            *eColorFormat = portFormat.eColorFormat;
+            break;
+        }
+        if (isColorFormatFlexibleYUV(omxNode, portFormat.eColorFormat)) {
+            *eColorFormat = portFormat.eColorFormat;
+            break;
+        }
+        if (OMX_COLOR_FormatYUV420SemiPlanar == portFormat.eColorFormat ||
+            OMX_COLOR_FormatYUV420Planar == portFormat.eColorFormat) {
+            *eColorFormat = portFormat.eColorFormat;
+            break;
+        }
+        portFormat.nIndex++;
+    }
+}
+
 // set component role
 TEST_F(VideoDecHidlTest, SetRole) {
     description("Test Set Component Role");
@@ -778,7 +897,7 @@
     eleInfo.open(info);
     ASSERT_EQ(eleInfo.is_open(), true);
     android::Vector<FrameData> Info;
-    int bytesCount = 0;
+    int bytesCount = 0, maxBytesCount = 0;
     uint32_t flags = 0;
     uint32_t timestamp = 0;
     timestampDevTest = true;
@@ -789,9 +908,15 @@
         Info.push_back({bytesCount, flags, timestamp});
         if (flags != OMX_BUFFERFLAG_CODECCONFIG)
             timestampUslist.push_back(timestamp);
+        if (maxBytesCount < bytesCount) maxBytesCount = bytesCount;
     }
     eleInfo.close();
 
+    // As the frame sizes are known ahead, use it to configure i/p buffer size
+    maxBytesCount = ALIGN_POWER_OF_TWO(maxBytesCount, 10);
+    status = setPortBufferSize(omxNode, kPortIndexInput, maxBytesCount);
+    ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+
     // set port mode
     portMode[0] = PortMode::PRESET_BYTE_BUFFER;
     portMode[1] = PortMode::DYNAMIC_ANW_BUFFER;
@@ -806,11 +931,21 @@
 
     // set Port Params
     uint32_t nFrameWidth, nFrameHeight, xFramerate;
-    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
     getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
                         &xFramerate);
+    // get default color format
+    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
+    getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
+                          &eColorFormat);
+    ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
+    status =
+        setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
+                           eColorFormat, xFramerate);
+    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
     setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
                         eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
+
+    // disabling adaptive playback.
     omxNode->prepareForAdaptivePlayback(kPortIndexOutput, false, 1920, 1080);
 
     android::Vector<BufferInfo> iBuffer, oBuffer;
@@ -830,7 +965,8 @@
         allocateGraphicBuffers(
             omxNode, kPortIndexOutput, &oBuffer,
             portDef.format.video.nFrameWidth, portDef.format.video.nFrameHeight,
-            &portDef.format.video.nStride, portDef.nBufferCountActual);
+            &portDef.format.video.nStride, portDef.format.video.eColorFormat,
+            portDef.nBufferCountActual);
     }
 
     // Port Reconfiguration
@@ -868,22 +1004,28 @@
         kPortIndexOutput = kPortIndexInput + 1;
     }
 
-    // set Port Params
-    uint32_t nFrameWidth, nFrameHeight, xFramerate;
-    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
-    getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
-                        &xFramerate);
-    setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
-                        eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
-
     // set port mode
-    PortMode portMode[2];
-    portMode[0] = portMode[1] = PortMode::PRESET_BYTE_BUFFER;
     status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
     ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
     status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
     ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
 
+    // set Port Params
+    uint32_t nFrameWidth, nFrameHeight, xFramerate;
+    getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
+                        &xFramerate);
+    // get default color format
+    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
+    getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
+                          &eColorFormat);
+    ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
+    status =
+        setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
+                           eColorFormat, xFramerate);
+    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+    setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
+                        eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
+
     android::Vector<BufferInfo> iBuffer, oBuffer;
 
     // set state to idle
@@ -933,7 +1075,7 @@
     eleInfo.open(info);
     ASSERT_EQ(eleInfo.is_open(), true);
     android::Vector<FrameData> Info;
-    int bytesCount = 0;
+    int bytesCount = 0, maxBytesCount = 0;
     uint32_t flags = 0;
     uint32_t timestamp = 0;
     while (1) {
@@ -941,25 +1083,37 @@
         eleInfo >> flags;
         eleInfo >> timestamp;
         Info.push_back({bytesCount, flags, timestamp});
+        if (maxBytesCount < bytesCount) maxBytesCount = bytesCount;
     }
     eleInfo.close();
 
-    // set Port Params
-    uint32_t nFrameWidth, nFrameHeight, xFramerate;
-    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
-    getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
-                        &xFramerate);
-    setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
-                        eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
+    // As the frame sizes are known ahead, use it to configure i/p buffer size
+    maxBytesCount = ALIGN_POWER_OF_TWO(maxBytesCount, 10);
+    status = setPortBufferSize(omxNode, kPortIndexInput, maxBytesCount);
+    ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
 
     // set port mode
-    PortMode portMode[2];
-    portMode[0] = portMode[1] = PortMode::PRESET_BYTE_BUFFER;
     status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
     ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
     status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
     ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
 
+    // set Port Params
+    uint32_t nFrameWidth, nFrameHeight, xFramerate;
+    getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
+                        &xFramerate);
+    // get default color format
+    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
+    getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
+                          &eColorFormat);
+    ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
+    status =
+        setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
+                           eColorFormat, xFramerate);
+    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+    setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
+                        eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
+
     android::Vector<BufferInfo> iBuffer, oBuffer;
 
     // set state to idle
@@ -1034,7 +1188,7 @@
     eleInfo.open(info);
     ASSERT_EQ(eleInfo.is_open(), true);
     android::Vector<FrameData> Info;
-    int bytesCount = 0;
+    int bytesCount = 0, maxBytesCount = 0;
     uint32_t flags = 0;
     uint32_t timestamp = 0;
     while (1) {
@@ -1042,25 +1196,37 @@
         eleInfo >> flags;
         eleInfo >> timestamp;
         Info.push_back({bytesCount, flags, timestamp});
+        if (maxBytesCount < bytesCount) maxBytesCount = bytesCount;
     }
     eleInfo.close();
 
-    // set Port Params
-    uint32_t nFrameWidth, nFrameHeight, xFramerate;
-    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
-    getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
-                        &xFramerate);
-    setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
-                        eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
+    // As the frame sizes are known ahead, use it to configure i/p buffer size
+    maxBytesCount = ALIGN_POWER_OF_TWO(maxBytesCount, 10);
+    status = setPortBufferSize(omxNode, kPortIndexInput, maxBytesCount);
+    ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
 
     // set port mode
-    PortMode portMode[2];
-    portMode[0] = portMode[1] = PortMode::PRESET_BYTE_BUFFER;
     status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
     ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
     status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
     ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
 
+    // set Port Params
+    uint32_t nFrameWidth, nFrameHeight, xFramerate;
+    getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
+                        &xFramerate);
+    // get default color format
+    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
+    getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
+                          &eColorFormat);
+    ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
+    status =
+        setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
+                           eColorFormat, xFramerate);
+    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+    setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
+                        eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
+
     android::Vector<BufferInfo> iBuffer, oBuffer;
 
     // set state to idle
@@ -1117,7 +1283,7 @@
     eleInfo.open(info);
     ASSERT_EQ(eleInfo.is_open(), true);
     android::Vector<FrameData> Info;
-    int bytesCount = 0;
+    int bytesCount = 0, maxBytesCount = 0;
     uint32_t flags = 0;
     uint32_t timestamp = 0;
     while (1) {
@@ -1125,25 +1291,37 @@
         eleInfo >> flags;
         eleInfo >> timestamp;
         Info.push_back({bytesCount, flags, timestamp});
+        if (maxBytesCount < bytesCount) maxBytesCount = bytesCount;
     }
     eleInfo.close();
 
-    // set Port Params
-    uint32_t nFrameWidth, nFrameHeight, xFramerate;
-    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
-    getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
-                        &xFramerate);
-    setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
-                        eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
+    // As the frame sizes are known ahead, use it to configure i/p buffer size
+    maxBytesCount = ALIGN_POWER_OF_TWO(maxBytesCount, 10);
+    status = setPortBufferSize(omxNode, kPortIndexInput, maxBytesCount);
+    ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
 
     // set port mode
-    PortMode portMode[2];
-    portMode[0] = portMode[1] = PortMode::PRESET_BYTE_BUFFER;
     status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
     ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
     status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
     ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
 
+    // set Port Params
+    uint32_t nFrameWidth, nFrameHeight, xFramerate;
+    getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
+                        &xFramerate);
+    // get default color format
+    OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
+    getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
+                          &eColorFormat);
+    ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
+    status =
+        setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
+                           eColorFormat, xFramerate);
+    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
+    setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
+                        eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
+
     android::Vector<BufferInfo> iBuffer, oBuffer;
 
     // set state to idle
@@ -1183,6 +1361,7 @@
                       kPortIndexOutput, eleStream, &Info, index,
                       Info.size() - index, portMode[1], false);
     }
+    eleStream.close();
     flushPorts(omxNode, observer, &iBuffer, &oBuffer, kPortIndexInput,
                kPortIndexOutput);
     framesReceived = 0;
diff --git a/media/res/bbb_aac_stereo_128kbps_48000hz.aac b/media/res/bbb_aac_stereo_128kbps_48000hz.aac
old mode 100755
new mode 100644
Binary files differ
diff --git a/media/res/bbb_aac_stereo_128kbps_48000hz.info b/media/res/bbb_aac_stereo_128kbps_48000hz.info
old mode 100755
new mode 100644
diff --git a/media/res/bbb_amrwb_1ch_14kbps_16000hz.amrwb b/media/res/bbb_amrwb_1ch_14kbps_16000hz.amrwb
old mode 100755
new mode 100644
Binary files differ
diff --git a/media/res/bbb_amrwb_1ch_14kbps_16000hz.info b/media/res/bbb_amrwb_1ch_14kbps_16000hz.info
old mode 100755
new mode 100644
diff --git a/media/res/bbb_g711alaw_1ch_8khz.info b/media/res/bbb_g711alaw_1ch_8khz.info
old mode 100755
new mode 100644
diff --git a/media/res/bbb_g711alaw_1ch_8khz.raw b/media/res/bbb_g711alaw_1ch_8khz.raw
old mode 100755
new mode 100644
diff --git a/media/res/bbb_g711mulaw_1ch_8khz.info b/media/res/bbb_g711mulaw_1ch_8khz.info
old mode 100755
new mode 100644
diff --git a/media/res/bbb_g711mulaw_1ch_8khz.raw b/media/res/bbb_g711mulaw_1ch_8khz.raw
old mode 100755
new mode 100644
diff --git a/media/res/bbb_gsm_1ch_8khz_13kbps.info b/media/res/bbb_gsm_1ch_8khz_13kbps.info
old mode 100755
new mode 100644
diff --git a/media/res/bbb_gsm_1ch_8khz_13kbps.raw b/media/res/bbb_gsm_1ch_8khz_13kbps.raw
old mode 100755
new mode 100644
Binary files differ
diff --git a/media/res/bbb_opus_stereo_128kbps_48000hz.info b/media/res/bbb_opus_stereo_128kbps_48000hz.info
old mode 100755
new mode 100644
diff --git a/media/res/bbb_opus_stereo_128kbps_48000hz.opus b/media/res/bbb_opus_stereo_128kbps_48000hz.opus
old mode 100755
new mode 100644
Binary files differ
diff --git a/media/res/bbb_raw_1ch_8khz_s32le.info b/media/res/bbb_raw_1ch_8khz_s32le.info
old mode 100755
new mode 100644
diff --git a/media/res/bbb_raw_1ch_8khz_s32le.raw b/media/res/bbb_raw_1ch_8khz_s32le.raw
old mode 100755
new mode 100644
Binary files differ
diff --git a/media/res/bbb_vorbis_stereo_128kbps_48000hz.info b/media/res/bbb_vorbis_stereo_128kbps_48000hz.info
old mode 100755
new mode 100644
diff --git a/media/res/bbb_vorbis_stereo_128kbps_48000hz.vorbis b/media/res/bbb_vorbis_stereo_128kbps_48000hz.vorbis
old mode 100755
new mode 100644
Binary files differ
diff --git a/memtrack/1.0/vts/functional/Android.bp b/memtrack/1.0/vts/functional/Android.bp
index 71e6111..2d833e7 100644
--- a/memtrack/1.0/vts/functional/Android.bp
+++ b/memtrack/1.0/vts/functional/Android.bp
@@ -16,20 +16,7 @@
 
 cc_test {
     name: "VtsHalMemtrackV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalMemtrackV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhardware",
-        "libhidlbase",
-        "libutils",
-        "android.hardware.memtrack@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.memtrack@1.0"],
 }
diff --git a/minijail/Android.mk b/minijail/Android.mk
new file mode 100644
index 0000000..272bb0e
--- /dev/null
+++ b/minijail/Android.mk
@@ -0,0 +1,14 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libhwminijail
+LOCAL_PROPRIETARY_MODULE := true
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_SRC_FILES := HardwareMinijail.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+    libbase \
+    libminijail_vendor
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/minijail/HardwareMinijail.cpp b/minijail/HardwareMinijail.cpp
new file mode 100644
index 0000000..e6b1144
--- /dev/null
+++ b/minijail/HardwareMinijail.cpp
@@ -0,0 +1,45 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <android-base/logging.h>
+#include <libminijail.h>
+
+#include <hwminijail/HardwareMinijail.h>
+
+namespace android {
+namespace hardware {
+
+void SetupMinijail(const std::string& seccomp_policy_path) {
+    if (access(seccomp_policy_path.c_str(), R_OK) == -1) {
+        LOG(WARNING) << "Could not find seccomp policy file at: " << seccomp_policy_path;
+        return;
+    }
+
+    struct minijail* jail = minijail_new();
+    if (jail == NULL) {
+        LOG(FATAL) << "Failed to create minijail.";
+    }
+
+    minijail_no_new_privs(jail);
+    minijail_log_seccomp_filter_failures(jail);
+    minijail_use_seccomp_filter(jail);
+    minijail_parse_seccomp_filters(jail, seccomp_policy_path.c_str());
+    minijail_enter(jail);
+    minijail_destroy(jail);
+}
+
+}  // namespace hardware
+}  // namespace android
diff --git a/minijail/include/hwminijail/HardwareMinijail.h b/minijail/include/hwminijail/HardwareMinijail.h
new file mode 100644
index 0000000..8fcf007
--- /dev/null
+++ b/minijail/include/hwminijail/HardwareMinijail.h
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef ANDROID_HARDWARE_CONFIGSTORE_MINIJAIL_H
+#define ANDROID_HARDWARE_CONFIGSTORE_MINIJAIL_H
+
+#include <string>
+
+namespace android {
+namespace hardware {
+
+void SetupMinijail(const std::string& seccomp_policy_path);
+
+}  // namespace hardware
+}  // namespace android
+
+#endif  // ANDROID_HARDWARE_CONFIGSTORE_UTILS_H
diff --git a/neuralnetworks/1.0/vts/functional/Android.bp b/neuralnetworks/1.0/vts/functional/Android.bp
index 96eb4cb..d76b2c3 100644
--- a/neuralnetworks/1.0/vts/functional/Android.bp
+++ b/neuralnetworks/1.0/vts/functional/Android.bp
@@ -17,21 +17,11 @@
 cc_test {
     name: "VtsHalNeuralnetworksV1_0TargetTest",
     srcs: ["VtsHalNeuralnetworksV1_0TargetTest.cpp"],
-    defaults: ["hidl_defaults"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "libhidlmemory",
-        "libhidltransport",
-        "liblog",
-        "libutils",
+    defaults: ["VtsHalTargetTestDefaults"],
+    static_libs: [
         "android.hardware.neuralnetworks@1.0",
         "android.hidl.allocator@1.0",
         "android.hidl.memory@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
+        "libhidlmemory",
     ],
 }
diff --git a/nfc/1.0/default/OWNERS b/nfc/1.0/default/OWNERS
new file mode 100644
index 0000000..984e5f9
--- /dev/null
+++ b/nfc/1.0/default/OWNERS
@@ -0,0 +1,2 @@
+eisenbach@google.com
+kandoiruchi@google.com
diff --git a/oemlock/1.0/vts/functional/Android.bp b/oemlock/1.0/vts/functional/Android.bp
index a13b3dc..20737a1 100644
--- a/oemlock/1.0/vts/functional/Android.bp
+++ b/oemlock/1.0/vts/functional/Android.bp
@@ -16,21 +16,7 @@
 
 cc_test {
     name: "VtsHalOemLockV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalOemLockV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.oemlock@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.oemlock@1.0"],
 }
diff --git a/power/1.0/vts/functional/Android.bp b/power/1.0/vts/functional/Android.bp
index 5ab1eb4..45f74fc 100644
--- a/power/1.0/vts/functional/Android.bp
+++ b/power/1.0/vts/functional/Android.bp
@@ -16,21 +16,7 @@
 
 cc_test {
     name: "VtsHalPowerV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalPowerV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.power@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.power@1.0"],
 }
diff --git a/power/1.1/vts/functional/Android.bp b/power/1.1/vts/functional/Android.bp
index f886bd2..604cd36 100644
--- a/power/1.1/vts/functional/Android.bp
+++ b/power/1.1/vts/functional/Android.bp
@@ -16,19 +16,10 @@
 
 cc_test {
     name: "VtsHalPowerV1_1TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalPowerV1_1TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libhidlbase",
-        "libhidltransport",
-        "libutils",
+    static_libs: [
+        "android.hardware.power@1.0",
         "android.hardware.power@1.1",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
 }
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 36fd7c2..10f8f62 100644
--- a/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.1/vts/functional/radio_hidl_hal_api.cpp
@@ -62,10 +62,12 @@
     EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
+        ALOGI("startNetworkScan, rspInfo.error = %d\n", (int32_t)radioRsp_v1_1->rspInfo.error);
         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::REQUEST_NOT_SUPPORTED);
+                    radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED ||
+                    radioRsp_v1_1->rspInfo.error == RadioError::OPERATION_NOT_ALLOWED);
     }
 }
 
@@ -85,6 +87,8 @@
     EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
+        ALOGI("startNetworkScan_InvalidArgument, rspInfo.error = %d\n",
+              (int32_t)radioRsp_v1_1->rspInfo.error);
         ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
                     radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT ||
                     radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
@@ -103,6 +107,7 @@
     EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
 
     if (cardStatus.cardState == CardState::ABSENT) {
+        ALOGI("stopNetworkScan rspInfo.error = %d\n", (int32_t)radioRsp_v1_1->rspInfo.error);
         ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
                     radioRsp_v1_1->rspInfo.error == RadioError::SIM_ABSENT ||
                     radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED);
diff --git a/renderscript/1.0/vts/functional/Android.bp b/renderscript/1.0/vts/functional/Android.bp
index 5256c1f..bf011e6 100644
--- a/renderscript/1.0/vts/functional/Android.bp
+++ b/renderscript/1.0/vts/functional/Android.bp
@@ -23,21 +23,9 @@
         "VtsScriptTests.cpp",
         "bitcode.cpp",
     ],
-    defaults: ["hidl_defaults"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "libnativewindow",
+    defaults: ["VtsHalTargetTestDefaults"],
+    static_libs: [
         "android.hardware.renderscript@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
+        "libnativewindow",
     ],
 }
diff --git a/sensors/1.0/vts/functional/Android.bp b/sensors/1.0/vts/functional/Android.bp
index af149ba..a49307d 100644
--- a/sensors/1.0/vts/functional/Android.bp
+++ b/sensors/1.0/vts/functional/Android.bp
@@ -16,19 +16,8 @@
 
 cc_test {
     name: "VtsHalSensorsV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalSensorsV1_0TargetTest.cpp"],
-    shared_libs: [
-        "android.hardware.sensors@1.0",
-        "libcutils",
-        "libhidlbase",
-        "liblog",
-        "libutils",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.sensors@1.0"],
 }
 
diff --git a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
index 3006508..357270f 100644
--- a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
+++ b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp
@@ -1235,6 +1235,11 @@
 
   SensorInfo sensor = defaultSensorByType(type);
 
+  if (!isValidType(sensor.type)) {
+    // no default sensor of this type
+    return;
+  }
+
   if (!isDirectReportRateSupported(sensor, rate)) {
     return;
   }
diff --git a/soundtrigger/2.0/vts/functional/Android.bp b/soundtrigger/2.0/vts/functional/Android.bp
index 8f0cc4e..be6b3a8 100644
--- a/soundtrigger/2.0/vts/functional/Android.bp
+++ b/soundtrigger/2.0/vts/functional/Android.bp
@@ -16,21 +16,7 @@
 
 cc_test {
     name: "VtsHalSoundtriggerV2_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalSoundtriggerV2_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.soundtrigger@2.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.soundtrigger@2.0"],
 }
diff --git a/tetheroffload/config/1.0/vts/functional/Android.bp b/tetheroffload/config/1.0/vts/functional/Android.bp
index 2e720c6..dc95eaa 100644
--- a/tetheroffload/config/1.0/vts/functional/Android.bp
+++ b/tetheroffload/config/1.0/vts/functional/Android.bp
@@ -14,20 +14,7 @@
 
 cc_test {
     name: "VtsHalTetheroffloadConfigV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalTetheroffloadConfigV1_0TargetTest.cpp"],
-    shared_libs: [
-        "android.hardware.tetheroffload.config@1.0",
-        "libbase",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "liblog",
-        "libutils",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.tetheroffload.config@1.0"],
 }
diff --git a/tetheroffload/control/1.0/vts/functional/Android.bp b/tetheroffload/control/1.0/vts/functional/Android.bp
index 69fac6e..c6216a2 100644
--- a/tetheroffload/control/1.0/vts/functional/Android.bp
+++ b/tetheroffload/control/1.0/vts/functional/Android.bp
@@ -14,21 +14,10 @@
 
 cc_test {
     name: "VtsHalTetheroffloadControlV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalTetheroffloadControlV1_0TargetTest.cpp"],
-    shared_libs: [
+    static_libs: [
         "android.hardware.tetheroffload.config@1.0",
         "android.hardware.tetheroffload.control@1.0",
-        "libbase",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "liblog",
-        "libutils",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
     ],
 }
diff --git a/tetheroffload/control/1.0/vts/functional/VtsHalTetheroffloadControlV1_0TargetTest.cpp b/tetheroffload/control/1.0/vts/functional/VtsHalTetheroffloadControlV1_0TargetTest.cpp
index 3d5cc81..3059eac 100644
--- a/tetheroffload/control/1.0/vts/functional/VtsHalTetheroffloadControlV1_0TargetTest.cpp
+++ b/tetheroffload/control/1.0/vts/functional/VtsHalTetheroffloadControlV1_0TargetTest.cpp
@@ -444,7 +444,7 @@
     const hidl_string iface("rmnet_data0");
     const hidl_string v4Addr("192.0.2.2");
     const hidl_string v4Gw("192.0.2.1");
-    const vector<hidl_string> v6Gws{hidl_string("fe80::db8:1"), hidl_string("fe80::db8::2")};
+    const vector<hidl_string> v6Gws{hidl_string("fe80::db8:1"), hidl_string("fe80::db8:2")};
     const Return<void> ret =
         control->setUpstreamParameters(iface, v4Addr, v4Gw, v6Gws, ASSERT_TRUE_CALLBACK);
     EXPECT_TRUE(ret.isOk());
diff --git a/thermal/1.0/vts/functional/Android.bp b/thermal/1.0/vts/functional/Android.bp
index 9046882..f661f1e 100644
--- a/thermal/1.0/vts/functional/Android.bp
+++ b/thermal/1.0/vts/functional/Android.bp
@@ -16,22 +16,8 @@
 
 cc_test {
     name: "VtsHalThermalV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalThermalV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.thermal@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.thermal@1.0"],
 }
 
diff --git a/tv/input/1.0/vts/functional/Android.bp b/tv/input/1.0/vts/functional/Android.bp
index c862429..978830c 100644
--- a/tv/input/1.0/vts/functional/Android.bp
+++ b/tv/input/1.0/vts/functional/Android.bp
@@ -16,22 +16,8 @@
 
 cc_test {
     name: "VtsHalTvInputV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalTvInputV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.tv.input@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.tv.input@1.0"],
 }
 
diff --git a/usb/1.0/vts/functional/Android.bp b/usb/1.0/vts/functional/Android.bp
index 7438bc7..96d3c0e 100644
--- a/usb/1.0/vts/functional/Android.bp
+++ b/usb/1.0/vts/functional/Android.bp
@@ -16,21 +16,7 @@
 
 cc_test {
     name: "VtsHalUsbV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalUsbV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.usb@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.usb@1.0"],
 }
diff --git a/usb/1.1/vts/functional/Android.bp b/usb/1.1/vts/functional/Android.bp
index 820f794..4bb3203 100644
--- a/usb/1.1/vts/functional/Android.bp
+++ b/usb/1.1/vts/functional/Android.bp
@@ -16,23 +16,11 @@
 
 cc_test {
     name: "VtsHalUsbV1_1TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalUsbV1_1TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
+    static_libs: [
         "android.hardware.usb@1.0",
         "android.hardware.usb@1.1",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
 }
 
diff --git a/vibrator/1.0/vts/functional/Android.bp b/vibrator/1.0/vts/functional/Android.bp
index 9e25def..016d627 100644
--- a/vibrator/1.0/vts/functional/Android.bp
+++ b/vibrator/1.0/vts/functional/Android.bp
@@ -16,19 +16,8 @@
 
 cc_test {
     name: "VtsHalVibratorV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalVibratorV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "liblog",
-        "libutils",
-        "android.hardware.vibrator@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.vibrator@1.0"],
 }
 
diff --git a/vibrator/1.1/vts/functional/Android.bp b/vibrator/1.1/vts/functional/Android.bp
index 5baa8ed..4f6454b 100644
--- a/vibrator/1.1/vts/functional/Android.bp
+++ b/vibrator/1.1/vts/functional/Android.bp
@@ -16,19 +16,11 @@
 
 cc_test {
     name: "VtsHalVibratorV1_1TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalVibratorV1_1TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "libhidlbase",
-        "liblog",
-        "libutils",
+    static_libs: [
+        "android.hardware.vibrator@1.0",
         "android.hardware.vibrator@1.1",
     ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
 }
 
diff --git a/vr/1.0/vts/functional/Android.bp b/vr/1.0/vts/functional/Android.bp
index 5d5a99a..4029137 100644
--- a/vr/1.0/vts/functional/Android.bp
+++ b/vr/1.0/vts/functional/Android.bp
@@ -16,17 +16,7 @@
 
 cc_test {
     name: "VtsHalVrV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalVrV1_0TargetTest.cpp"],
-    shared_libs: [
-        "liblog",
-        "libhidlbase",
-        "libutils",
-        "android.hardware.vr@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-       "-O0",
-        "-g",
-    ]
+    static_libs: ["android.hardware.vr@1.0"],
 }
diff --git a/weaver/1.0/vts/functional/Android.bp b/weaver/1.0/vts/functional/Android.bp
index 9b0ff6d..0089d89 100644
--- a/weaver/1.0/vts/functional/Android.bp
+++ b/weaver/1.0/vts/functional/Android.bp
@@ -16,21 +16,7 @@
 
 cc_test {
     name: "VtsHalWeaverV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalWeaverV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.weaver@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.weaver@1.0"],
 }
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index 1b5f8f7..b9fb0bd 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -1355,8 +1355,8 @@
    */
   uint32_t maxNdiInterfaces;
   /**
-   * Maximum number of data paths (NDP) which can be created concurrently on each individual
-   * data interface (NDI).
+   * Maximum number of data paths (NDP) which can be created concurrently on the device, across all
+   * data interfaces (NDI).
    */
   uint32_t maxNdpSessions;
   /**
diff --git a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
index 06e21ff..3c23135 100644
--- a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
@@ -182,6 +182,8 @@
         EXPECT_EQ(WifiStatusCode::SUCCESS,
                   HIDL_INVOKE(wifi_chip_, configureChip, mode.id).code);
         stopWifi();
+        // Sleep for 5 milliseconds between each wifi state toggle.
+        usleep(5000);
     }
 }
 
diff --git a/wifi/1.1/default/wifi_legacy_hal.cpp b/wifi/1.1/default/wifi_legacy_hal.cpp
index 7d683d3..151a600 100644
--- a/wifi/1.1/default/wifi_legacy_hal.cpp
+++ b/wifi/1.1/default/wifi_legacy_hal.cpp
@@ -1284,7 +1284,7 @@
     for (int i = 0; i < num_scan_results; i++) {
       auto& scan_result = cached_scan_result.results[i];
       if (scan_result.ie_length > 0) {
-        LOG(ERROR) << "Cached scan result has non-zero IE length "
+        LOG(DEBUG) << "Cached scan result has non-zero IE length "
                    << scan_result.ie_length;
         scan_result.ie_length = 0;
       }
diff --git a/wifi/1.1/vts/functional/Android.bp b/wifi/1.1/vts/functional/Android.bp
index 6b0baf7..1b0c12d 100644
--- a/wifi/1.1/vts/functional/Android.bp
+++ b/wifi/1.1/vts/functional/Android.bp
@@ -16,24 +16,13 @@
 
 cc_test {
     name: "VtsHalWifiV1_1TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: [
         "VtsHalWifiV1_1TargetTest.cpp",
         "wifi_chip_hidl_test.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
+    static_libs: [
+        "VtsHalWifiV1_0TargetTestUtil",
         "android.hardware.wifi@1.0",
         "android.hardware.wifi@1.1",
     ],
-    static_libs: ["VtsHalWifiV1_0TargetTestUtil", "VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
 }
diff --git a/wifi/offload/1.0/vts/functional/Android.bp b/wifi/offload/1.0/vts/functional/Android.bp
index f907a89..140e45e 100644
--- a/wifi/offload/1.0/vts/functional/Android.bp
+++ b/wifi/offload/1.0/vts/functional/Android.bp
@@ -16,21 +16,7 @@
 
 cc_test {
     name: "VtsHalWifiOffloadV1_0TargetTest",
-    defaults: ["hidl_defaults"],
+    defaults: ["VtsHalTargetTestDefaults"],
     srcs: ["VtsHalWifiOffloadV1_0TargetTest.cpp"],
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libcutils",
-        "libhidlbase",
-        "libhidltransport",
-        "libnativehelper",
-        "libutils",
-        "android.hardware.wifi.offload@1.0",
-    ],
-    static_libs: ["VtsHalHidlTargetTestBase"],
-    cflags: [
-        "-O0",
-        "-g",
-    ],
+    static_libs: ["android.hardware.wifi.offload@1.0"],
 }