Snap for 4448085 from bd5f69ec16aa39f7afb26206db3458f142007f45 to oc-m3-release

Change-Id: I18d3916b7126d5a06cd0abd432f07fba9ed70d07
diff --git a/agents/hal/AgentRequestHandler.cpp b/agents/hal/AgentRequestHandler.cpp
index 3fd4006..df2698a 100644
--- a/agents/hal/AgentRequestHandler.cpp
+++ b/agents/hal/AgentRequestHandler.cpp
@@ -312,28 +312,12 @@
     return false;
   }
 
-  const char* result = client->ReadSpecification(
-      command_message.service_name(),
-      command_message.target_class(),
-      command_message.target_type(),
-      command_message.target_version() / 100.0,
+  const string& result = client->ReadSpecification(
+      command_message.service_name(), command_message.target_class(),
+      command_message.target_type(), command_message.target_version() / 100.0f,
       command_message.target_package());
 
-  AndroidSystemControlResponseMessage response_msg;
-  if (result != NULL && strlen(result) > 0) {
-    cout << "[agent] Call: success" << endl;
-    response_msg.set_response_code(SUCCESS);
-    response_msg.set_result(result);
-  } else {
-    cout << "[agent] Call: fail" << endl;
-    response_msg.set_response_code(FAIL);
-    response_msg.set_reason("Failed to call the api.");
-  }
-  bool succ = VtsSocketSendMessage(response_msg);
-#ifndef VTS_AGENT_DRIVER_COMM_BINDER  // socket
-  free((void*)result);
-#endif
-  return succ;
+  return SendApiResult("ReadSpecification", result);
 }
 
 bool AgentRequestHandler::ListApis() {
@@ -349,25 +333,7 @@
 #endif
     return false;
   }
-  const char* result = client->GetFunctions();
-  if (result != NULL) {
-    cout << "GetFunctions: len " << strlen(result) << endl;
-  }
-
-  AndroidSystemControlResponseMessage response_msg;
-  if (result != NULL && strlen(result) > 0) {
-    response_msg.set_response_code(SUCCESS);
-    response_msg.set_spec(string(result));
-  } else {
-    response_msg.set_response_code(FAIL);
-    response_msg.set_reason("Failed to get the functions.");
-  }
-
-  bool succ = VtsSocketSendMessage(response_msg);
-#ifndef VTS_AGENT_DRIVER_COMM_BINDER  // socket
-  free((void*)result);
-#endif
-  return succ;
+  return SendApiResult("GetAttribute", "", client->GetFunctions());
 }
 
 bool AgentRequestHandler::CallApi(const string& call_payload,
@@ -385,22 +351,7 @@
     return false;
   }
 
-  const char* result = client->Call(call_payload, uid);
-  AndroidSystemControlResponseMessage response_msg;
-  if (result != NULL && strlen(result) > 0) {
-    cout << "[agent] Call: success" << endl;
-    response_msg.set_response_code(SUCCESS);
-    response_msg.set_result(result);
-  } else {
-    cout << "[agent] Call: fail" << endl;
-    response_msg.set_response_code(FAIL);
-    response_msg.set_reason("Failed to call the api.");
-  }
-  bool succ = VtsSocketSendMessage(response_msg);
-#ifndef VTS_AGENT_DRIVER_COMM_BINDER  // socket
-  free((void*)result);
-#endif
-  return succ;
+  return SendApiResult("Call", client->Call(call_payload, uid));
 }
 
 bool AgentRequestHandler::GetAttribute(const string& payload) {
@@ -417,23 +368,28 @@
     return false;
   }
 
-  const char* result = client->GetAttribute(payload);
+  return SendApiResult("GetAttribute", client->GetAttribute(payload));
+}
 
+bool AgentRequestHandler::SendApiResult(const string& func_name,
+                                        const string& result,
+                                        const string& spec) {
   AndroidSystemControlResponseMessage response_msg;
-  if (result != NULL && strlen(result) > 0) {
+  if (result.size() > 0 || spec.size() > 0) {
     cout << "[agent] Call: success" << endl;
     response_msg.set_response_code(SUCCESS);
-    response_msg.set_result(result);
+    if (result.size() > 0) {
+      response_msg.set_result(result);
+    }
+    if (spec.size() > 0) {
+      response_msg.set_spec(spec);
+    }
   } else {
     cout << "[agent] Call: fail" << endl;
     response_msg.set_response_code(FAIL);
-    response_msg.set_reason("Failed to call the api.");
+    response_msg.set_reason("Failed to call api function: " + func_name);
   }
-  bool succ = VtsSocketSendMessage(response_msg);
-#ifndef VTS_AGENT_DRIVER_COMM_BINDER  // socket
-  free((void*)result);
-#endif
-  return succ;
+  return VtsSocketSendMessage(response_msg);
 }
 
 bool AgentRequestHandler::DefaultResponse() {
@@ -457,23 +413,21 @@
     return false;
   }
 
-  VtsDriverControlResponseMessage* result_message = client->ExecuteShellCommand(
-      command_message.shell_command());
+  auto result_message =
+      client->ExecuteShellCommand(command_message.shell_command());
 
   AndroidSystemControlResponseMessage response_msg;
 
-  if (result_message == NULL) {
+  if (result_message) {
+    CreateSystemControlResponseFromDriverControlResponse(*result_message,
+                                                         &response_msg);
+  } else {
     cout << "ExecuteShellCommand: failed to call the api" << endl;
     response_msg.set_response_code(FAIL);
     response_msg.set_reason("Failed to call the api.");
-  } else {
-    CreateSystemControlResponseFromDriverControlResponse(
-        *result_message, &response_msg);
-    delete(result_message);
   }
 
-  bool succ = VtsSocketSendMessage(response_msg);
-  return succ;
+  return VtsSocketSendMessage(response_msg);
 }
 
 void AgentRequestHandler::CreateSystemControlResponseFromDriverControlResponse(
diff --git a/agents/hal/AgentRequestHandler.h b/agents/hal/AgentRequestHandler.h
index 4058872..794f882 100644
--- a/agents/hal/AgentRequestHandler.h
+++ b/agents/hal/AgentRequestHandler.h
@@ -86,6 +86,11 @@
   // Returns a default response message.
   bool DefaultResponse();
 
+  // Send SUCCESS response with given result and/or spec if it is not empty,
+  // otherwise send FAIL.
+  bool SendApiResult(const string& func_name, const string& result,
+                     const string& spec = "");
+
  protected:
   // the currently opened, connected service name.
   string service_name_;
diff --git a/agents/hal/SocketClientToDriver.cpp b/agents/hal/SocketClientToDriver.cpp
index a1c7ac0..be28f50 100644
--- a/agents/hal/SocketClientToDriver.cpp
+++ b/agents/hal/SocketClientToDriver.cpp
@@ -93,32 +93,28 @@
   return response_message.return_value();
 }
 
-const char* VtsDriverSocketClient::GetFunctions() {
+string VtsDriverSocketClient::GetFunctions() {
   cout << "[agent->driver] LIST_FUNCTIONS" << endl;
 
   VtsDriverControlCommandMessage command_message;
   command_message.set_command_type(LIST_FUNCTIONS);
-  if (!VtsSocketSendMessage(command_message)) return NULL;
+  if (!VtsSocketSendMessage(command_message)) {
+    return {};
+  }
 
   VtsDriverControlResponseMessage response_message;
-  if (!VtsSocketRecvMessage(&response_message)) return NULL;
-
-  char* result =
-      (char*)malloc(strlen(response_message.return_message().c_str()) + 1);
-  if (!result) {
-    cerr << __func__ << " ERROR result is NULL" << endl;
-    return NULL;
+  if (!VtsSocketRecvMessage(&response_message)) {
+    return {};
   }
-  strcpy(result, response_message.return_message().c_str());
-  return result;
+
+  return response_message.return_message();
 }
 
-const char* VtsDriverSocketClient::ReadSpecification(
-    const string& component_name,
-    int target_class,
-    int target_type,
-    float target_version,
-    const string& target_package) {
+string VtsDriverSocketClient::ReadSpecification(const string& component_name,
+                                                int target_class,
+                                                int target_type,
+                                                float target_version,
+                                                const string& target_package) {
   cout << "[agent->driver] LIST_FUNCTIONS" << endl;
 
   VtsDriverControlCommandMessage command_message;
@@ -130,73 +126,64 @@
   command_message.set_target_version(target_version);
   command_message.set_target_package(target_package);
 
-  if (!VtsSocketSendMessage(command_message)) return NULL;
+  if (!VtsSocketSendMessage(command_message)) {
+    return {};
+  }
 
   VtsDriverControlResponseMessage response_message;
-  if (!VtsSocketRecvMessage(&response_message)) return NULL;
-
-  char* result =
-      (char*)malloc(strlen(response_message.return_message().c_str()) + 1);
-  if (!result) {
-    cerr << __func__ << " ERROR result is NULL" << endl;
-    return NULL;
+  if (!VtsSocketRecvMessage(&response_message)) {
+    return {};
   }
-  strcpy(result, response_message.return_message().c_str());
-  return result;
+
+  return response_message.return_message();
 }
 
-const char* VtsDriverSocketClient::Call(const string& arg, const string& uid) {
+string VtsDriverSocketClient::Call(const string& arg, const string& uid) {
   VtsDriverControlCommandMessage command_message;
   command_message.set_command_type(CALL_FUNCTION);
   command_message.set_arg(arg);
   command_message.set_driver_caller_uid(uid);
-  if (!VtsSocketSendMessage(command_message)) return NULL;
+  if (!VtsSocketSendMessage(command_message)) {
+    return {};
+  }
 
   VtsDriverControlResponseMessage response_message;
-  if (!VtsSocketRecvMessage(&response_message)) return NULL;
-
-  char* result =
-      (char*)malloc(strlen(response_message.return_message().c_str()) + 1);
-  if (!result) {
-    cerr << __func__ << " ERROR result is NULL" << endl;
-    return NULL;
+  if (!VtsSocketRecvMessage(&response_message)) {
+    return {};
   }
-  strcpy(result, response_message.return_message().c_str());
-  cout << __func__ << " result: " << result << endl;
-  return result;
+
+  cout << __func__ << " result: " << response_message.return_message() << endl;
+  return response_message.return_message();
 }
 
-const char* VtsDriverSocketClient::GetAttribute(const string& arg) {
+string VtsDriverSocketClient::GetAttribute(const string& arg) {
   VtsDriverControlCommandMessage command_message;
   command_message.set_command_type(GET_ATTRIBUTE);
   command_message.set_arg(arg);
-  if (!VtsSocketSendMessage(command_message)) return NULL;
+  if (!VtsSocketSendMessage(command_message)) {
+    return {};
+  }
 
   VtsDriverControlResponseMessage response_message;
-  if (!VtsSocketRecvMessage(&response_message)) return NULL;
-
-  char* result =
-      (char*)malloc(strlen(response_message.return_message().c_str()) + 1);
-  if (!result) {
-    cerr << __func__ << " ERROR result is NULL" << endl;
-    return NULL;
+  if (!VtsSocketRecvMessage(&response_message)) {
+    return {};
   }
-  strcpy(result, response_message.return_message().c_str());
-  return result;
+
+  return response_message.return_message();
 }
 
-VtsDriverControlResponseMessage* VtsDriverSocketClient::ExecuteShellCommand(
+unique_ptr<VtsDriverControlResponseMessage>
+VtsDriverSocketClient::ExecuteShellCommand(
     const ::google::protobuf::RepeatedPtrField<::std::string> shell_command) {
   VtsDriverControlCommandMessage command_message;
   command_message.set_command_type(EXECUTE_COMMAND);
   for (const auto& cmd : shell_command) {
     command_message.add_shell_command(cmd);
   }
-  if (!VtsSocketSendMessage(command_message)) return NULL;
+  if (!VtsSocketSendMessage(command_message)) return nullptr;
 
-  VtsDriverControlResponseMessage* response_message =
-      new VtsDriverControlResponseMessage();
-  if (!VtsSocketRecvMessage(response_message)) return NULL;
+  auto response_message = make_unique<VtsDriverControlResponseMessage>();
+  if (!VtsSocketRecvMessage(response_message.get())) return nullptr;
 
   return response_message;
 }
diff --git a/agents/hal/SocketClientToDriver.h b/agents/hal/SocketClientToDriver.h
index e572431..4dbf4c7 100644
--- a/agents/hal/SocketClientToDriver.h
+++ b/agents/hal/SocketClientToDriver.h
@@ -47,27 +47,24 @@
                   const string& module_name);
 
   // Sends a LIST_FUNCTIONS request.
-  const char* GetFunctions();
+  string GetFunctions();
 
   // Sends a VTS_DRIVER_COMMAND_READ_SPECIFICATION request.
-  const char* ReadSpecification(
-          const string& component_name,
-          int target_class,
-          int target_type,
-          float target_version,
-          const string& target_package);
+  string ReadSpecification(const string& component_name, int target_class,
+                           int target_type, float target_version,
+                           const string& target_package);
 
   // Sends a CALL_FUNCTION request.
-  const char* Call(const string& arg, const string& uid);
+  string Call(const string& arg, const string& uid);
 
   // Sends a GET_ATTRIBUTE request.
-  const char* GetAttribute(const string& arg);
+  string GetAttribute(const string& arg);
 
   // Sends a GET_STATUS request.
   int32_t Status(int32_t type);
 
   // Sends a EXECUTE request.
-  VtsDriverControlResponseMessage* ExecuteShellCommand(
+  unique_ptr<VtsDriverControlResponseMessage> ExecuteShellCommand(
       const ::google::protobuf::RepeatedPtrField<::std::string> shell_command);
 };
 
diff --git a/compilation_tools/vtsc/code_gen/driver/DriverCodeGenBase.cpp b/compilation_tools/vtsc/code_gen/driver/DriverCodeGenBase.cpp
index ce46317..ffac79f 100644
--- a/compilation_tools/vtsc/code_gen/driver/DriverCodeGenBase.cpp
+++ b/compilation_tools/vtsc/code_gen/driver/DriverCodeGenBase.cpp
@@ -113,6 +113,7 @@
 void DriverCodeGenBase::GenerateClassHeader(Formatter& out,
     const ComponentSpecificationMessage& message,
     const string& fuzzer_extended_class_name) {
+  GenerateHeaderInterfaceImpl(out, message);
   out << "class " << fuzzer_extended_class_name << " : public DriverBase {"
       << "\n";
   out << " public:" << "\n";
@@ -157,7 +158,7 @@
 void DriverCodeGenBase::GenerateClassImpl(Formatter& out,
     const ComponentSpecificationMessage& message,
     const string& fuzzer_extended_class_name) {
-  GenerateCppBodyCallbackFunction(out, message, fuzzer_extended_class_name);
+  GenerateCppBodyInterfaceImpl(out, message, fuzzer_extended_class_name);
   GenerateCppBodyFuzzFunction(out, message, fuzzer_extended_class_name);
   GenerateCppBodyGetAttributeFunction(out, message, fuzzer_extended_class_name);
   GenerateDriverFunctionImpl(out, message, fuzzer_extended_class_name);
@@ -181,8 +182,7 @@
   out << "#include <driver_base/DriverCallbackBase.h>"
       << "\n";
   out << "\n";
-  if (message.component_class() == HAL_HIDL &&
-      endsWith(message.component_name(), "Callback")) {
+  if (message.component_class() == HAL_HIDL) {
     out << "#include <VtsDriverCommUtil.h>" << "\n";
     out << "\n";
   }
diff --git a/compilation_tools/vtsc/code_gen/driver/DriverCodeGenBase.h b/compilation_tools/vtsc/code_gen/driver/DriverCodeGenBase.h
index ba81dbe..a66ff1b 100644
--- a/compilation_tools/vtsc/code_gen/driver/DriverCodeGenBase.h
+++ b/compilation_tools/vtsc/code_gen/driver/DriverCodeGenBase.h
@@ -82,10 +82,14 @@
       const ComponentSpecificationMessage& message,
       const string& fuzzer_extended_class_name);
 
-  // Generates C/C++ code for callback functions.
-  virtual void GenerateCppBodyCallbackFunction(Formatter& /*out*/,
-      const ComponentSpecificationMessage& /*message*/,
-      const string& /*fuzzer_extended_class_name*/) {};
+  // Generates C/C++ code for interface implemetation class.
+  virtual void GenerateCppBodyInterfaceImpl(
+      Formatter& /*out*/, const ComponentSpecificationMessage& /*message*/,
+      const string& /*fuzzer_extended_class_name*/){};
+
+  // Generates header code for interface impl class.
+  virtual void GenerateHeaderInterfaceImpl(
+      Formatter& /*out*/, const ComponentSpecificationMessage& /*message*/){};
 
   // Generates header code for construction function.
   virtual void GenerateClassConstructionFunction(Formatter& /*out*/,
diff --git a/compilation_tools/vtsc/code_gen/driver/HalCodeGen.cpp b/compilation_tools/vtsc/code_gen/driver/HalCodeGen.cpp
index fa04a2d..7d43162 100644
--- a/compilation_tools/vtsc/code_gen/driver/HalCodeGen.cpp
+++ b/compilation_tools/vtsc/code_gen/driver/HalCodeGen.cpp
@@ -35,8 +35,7 @@
 
 const char* const HalCodeGen::kInstanceVariableName = "device_";
 
-
-void HalCodeGen::GenerateCppBodyCallbackFunction(
+void HalCodeGen::GenerateCppBodyInterfaceImpl(
     Formatter& out, const ComponentSpecificationMessage& message,
     const string& fuzzer_extended_class_name) {
   bool first_callback = true;
diff --git a/compilation_tools/vtsc/code_gen/driver/HalCodeGen.h b/compilation_tools/vtsc/code_gen/driver/HalCodeGen.h
index b2d2186..2ff0f5f 100644
--- a/compilation_tools/vtsc/code_gen/driver/HalCodeGen.h
+++ b/compilation_tools/vtsc/code_gen/driver/HalCodeGen.h
@@ -46,8 +46,8 @@
       const ComponentSpecificationMessage& message,
       const string& fuzzer_extended_class_name) override;
 
-  void GenerateCppBodyCallbackFunction(Formatter& out,
-      const ComponentSpecificationMessage& message,
+  void GenerateCppBodyInterfaceImpl(
+      Formatter& out, const ComponentSpecificationMessage& message,
       const string& fuzzer_extended_class_name) override;
 
   void GenerateClassConstructionFunction(Formatter& out,
diff --git a/compilation_tools/vtsc/code_gen/driver/HalHidlCodeGen.cpp b/compilation_tools/vtsc/code_gen/driver/HalHidlCodeGen.cpp
index 709c6f5..3c7ddce 100644
--- a/compilation_tools/vtsc/code_gen/driver/HalHidlCodeGen.cpp
+++ b/compilation_tools/vtsc/code_gen/driver/HalHidlCodeGen.cpp
@@ -36,106 +36,109 @@
 
 const char* const HalHidlCodeGen::kInstanceVariableName = "hw_binder_proxy_";
 
-void HalHidlCodeGen::GenerateCppBodyCallbackFunction(Formatter& out,
-    const ComponentSpecificationMessage& message,
+void HalHidlCodeGen::GenerateCppBodyInterfaceImpl(
+    Formatter& out, const ComponentSpecificationMessage& message,
     const string& /*fuzzer_extended_class_name*/) {
-  if (endsWith(message.component_name(), "Callback")) {
-    out << "\n";
-    FQName component_fq_name = GetFQName(message);
-    for (const auto& api : message.interface().api()) {
-      // Generate return statement.
-      if (CanElideCallback(api)) {
-        out << "::android::hardware::Return<"
-            << GetCppVariableType(api.return_type_hidl(0), &message) << "> ";
-      } else {
-        out << "::android::hardware::Return<void> ";
-      }
-      // Generate function call.
-      string full_method_name = "Vts_" + component_fq_name.tokenName() + "::"
-          + api.name();
-      out << full_method_name << "(\n";
-      out.indent();
-      for (int index = 0; index < api.arg_size(); index++) {
-        const auto& arg = api.arg(index);
-        if (!isConstType(arg.type())) {
-          out << GetCppVariableType(arg, &message);
-        } else {
-          out << GetCppVariableType(arg, &message, true);
-        }
-        out << " arg" << index << " __attribute__((__unused__))";
-        if (index != (api.arg_size() - 1))
-          out << ",\n";
-      }
-      if (api.return_type_hidl_size() == 0 || CanElideCallback(api)) {
-        out << ") {" << "\n";
-      } else {  // handle the case of callbacks.
-        out << (api.arg_size() != 0 ? ", " : "");
-        out << "std::function<void(";
-        for (int index = 0; index < api.return_type_hidl_size(); index++) {
-          const auto& return_val = api.return_type_hidl(index);
-          if (!isConstType(return_val.type())) {
-            out << GetCppVariableType(return_val, &message);
-          } else {
-            out << GetCppVariableType(return_val, &message, true);
-          }
-          out << " arg" << index;
-          if (index != (api.return_type_hidl_size() - 1))
-            out << ",";
-        }
-        out << ")>) {" << "\n";
-      }
-      out << "cout << \"" << api.name() << " called\" << endl;" << "\n";
-      out << "AndroidSystemCallbackRequestMessage callback_message;" << "\n";
-      out << "callback_message.set_id(GetCallbackID(\"" << api.name() << "\"));" << "\n";
-      out << "callback_message.set_name(\"" << full_method_name << "\");" << "\n";
-      for (int index = 0; index < api.arg_size(); index++) {
-        out << "VariableSpecificationMessage* var_msg" << index << " = "
-            << "callback_message.add_arg();\n";
-        GenerateSetResultCodeForTypedVariable(out, api.arg(index),
-                                              "var_msg" + std::to_string(index),
-                                              "arg" + std::to_string(index));
-      }
-      out << "RpcCallToAgent(callback_message, callback_socket_name_);" << "\n";
-
-      // TODO(zhuoyao): return the received results from host.
-      if (CanElideCallback(api)) {
-        const auto& return_val = api.return_type_hidl(0);
-        const auto& type = return_val.type();
-        if (type == TYPE_SCALAR) {
-          out << "return static_cast<"
-              << GetCppVariableType(return_val.scalar_type()) << ">(0);\n";
-        } else if (type == TYPE_ENUM || type == TYPE_MASK) {
-          if (return_val.has_predefined_type()) {
-            std::string predefined_type_name = return_val.predefined_type();
-            ReplaceSubString(predefined_type_name, "::", "__");
-            out << "return Random" << predefined_type_name << "();\n";
-          } else {
-            cerr << __func__ << " ENUM doesn't have predefined type" << endl;
-            exit(-1);
-          }
-        } else {
-          out << "return nullptr;\n";
-        }
-      } else {
-        out << "return ::android::hardware::Void();\n";
-      }
-      out.unindent();
-      out << "}" << "\n";
-      out << "\n";
+  out << "\n";
+  FQName component_fq_name = GetFQName(message);
+  for (const auto& api : message.interface().api()) {
+    // Generate return statement.
+    if (CanElideCallback(api)) {
+      out << "::android::hardware::Return<"
+          << GetCppVariableType(api.return_type_hidl(0), &message) << "> ";
+    } else {
+      out << "::android::hardware::Return<void> ";
     }
-
-    string component_name_token = "Vts_" + component_fq_name.tokenName();
-    out << "sp<" << component_fq_name.cppName() << "> VtsFuzzerCreate"
-        << component_name_token << "(const string& callback_socket_name)";
-    out << " {" << "\n";
+    // Generate function call.
+    string full_method_name =
+        "Vts_" + component_fq_name.tokenName() + "::" + api.name();
+    out << full_method_name << "(\n";
     out.indent();
-    out << "static sp<" << component_fq_name.cppName() << "> result;\n";
-    out << "result = new " << component_name_token << "(callback_socket_name);"
-        << "\n";
-    out << "return result;\n";
+    for (int index = 0; index < api.arg_size(); index++) {
+      const auto& arg = api.arg(index);
+      if (!isConstType(arg.type())) {
+        out << GetCppVariableType(arg, &message);
+      } else {
+        out << GetCppVariableType(arg, &message, true);
+      }
+      out << " arg" << index << " __attribute__((__unused__))";
+      if (index != (api.arg_size() - 1)) out << ",\n";
+    }
+    if (api.return_type_hidl_size() == 0 || CanElideCallback(api)) {
+      out << ") {\n";
+    } else {  // handle the case of callbacks.
+      out << (api.arg_size() != 0 ? ", " : "");
+      out << "std::function<void(";
+      for (int index = 0; index < api.return_type_hidl_size(); index++) {
+        const auto& return_val = api.return_type_hidl(index);
+        if (!isConstType(return_val.type())) {
+          out << GetCppVariableType(return_val, &message);
+        } else {
+          out << GetCppVariableType(return_val, &message, true);
+        }
+        out << " arg" << index;
+        if (index != (api.return_type_hidl_size() - 1)) {
+          out << ",";
+        }
+      }
+      out << ")>) {\n";
+    }
+    out << "cout << \"" << api.name() << " called\" << endl;\n";
+    out << "AndroidSystemCallbackRequestMessage callback_message;\n";
+    out << "callback_message.set_id(GetCallbackID(\"" << api.name()
+        << "\"));\n";
+    out << "callback_message.set_name(\"" << full_method_name << "\");\n";
+    for (int index = 0; index < api.arg_size(); index++) {
+      out << "VariableSpecificationMessage* var_msg" << index << " = "
+          << "callback_message.add_arg();\n";
+      GenerateSetResultCodeForTypedVariable(out, api.arg(index),
+                                            "var_msg" + std::to_string(index),
+                                            "arg" + std::to_string(index));
+    }
+    out << "RpcCallToAgent(callback_message, callback_socket_name_);\n";
+
+    // TODO(zhuoyao): return the received results from host.
+    if (CanElideCallback(api)) {
+      const auto& return_val = api.return_type_hidl(0);
+      const auto& type = return_val.type();
+      if (type == TYPE_SCALAR) {
+        out << "return static_cast<"
+            << GetCppVariableType(return_val.scalar_type()) << ">(0);\n";
+      } else if (type == TYPE_ENUM || type == TYPE_MASK) {
+        if (return_val.has_predefined_type()) {
+          std::string predefined_type_name = return_val.predefined_type();
+          ReplaceSubString(predefined_type_name, "::", "__");
+          if (type == TYPE_ENUM) {
+            out << "return static_cast< " << GetCppVariableType(return_val)
+                << ">(Random" << predefined_type_name << "());\n";
+          } else {
+            out << "return Random" << predefined_type_name << "();\n";
+          }
+        } else {
+          cerr << __func__ << " ENUM doesn't have predefined type" << endl;
+          exit(-1);
+        }
+      } else {
+        out << "return nullptr;\n";
+      }
+    } else {
+      out << "return ::android::hardware::Void();\n";
+    }
     out.unindent();
-    out << "}" << "\n" << "\n";
+    out << "}"
+        << "\n";
+    out << "\n";
   }
+
+  string component_name_token = "Vts_" + component_fq_name.tokenName();
+  out << "sp<" << component_fq_name.cppName() << "> VtsFuzzerCreate"
+      << component_name_token << "(const string& callback_socket_name) {\n";
+  out.indent();
+  out << "static sp<" << component_fq_name.cppName() << "> result;\n";
+  out << "result = new " << component_name_token << "(callback_socket_name);\n";
+  out << "return result;\n";
+  out.unindent();
+  out << "}\n\n";
 }
 
 void HalHidlCodeGen::GenerateScalarTypeInC(Formatter& out, const string& type) {
@@ -182,8 +185,7 @@
 void HalHidlCodeGen::GenerateDriverFunctionImpl(Formatter& out,
     const ComponentSpecificationMessage& message,
     const string& fuzzer_extended_class_name) {
-  if (message.component_name() != "types"
-      && !endsWith(message.component_name(), "Callback")) {
+  if (message.component_name() != "types") {
     out << "bool " << fuzzer_extended_class_name << "::CallFunction("
         << "\n";
     out.indent();
@@ -365,8 +367,7 @@
 void HalHidlCodeGen::GenerateCppBodyGetAttributeFunction(
     Formatter& out, const ComponentSpecificationMessage& message,
     const string& fuzzer_extended_class_name) {
-  if (message.component_name() != "types" &&
-      !endsWith(message.component_name(), "Callback")) {
+  if (message.component_name() != "types") {
     out << "bool " << fuzzer_extended_class_name << "::GetAttribute(" << "\n";
     out.indent();
     out << "FunctionSpecificationMessage* /*func_msg*/,"
@@ -406,8 +407,7 @@
 void HalHidlCodeGen::GenerateHeaderGlobalFunctionDeclarations(Formatter& out,
     const ComponentSpecificationMessage& message,
     const bool print_extern_block) {
-  if (message.component_name() != "types"
-      && !endsWith(message.component_name(), "Callback")) {
+  if (message.component_name() != "types") {
     if (print_extern_block) {
       out << "extern \"C\" {" << "\n";
     }
@@ -428,8 +428,7 @@
 void HalHidlCodeGen::GenerateCppBodyGlobalFunctions(Formatter& out,
     const ComponentSpecificationMessage& message,
     const string& fuzzer_extended_class_name, const bool print_extern_block) {
-  if (message.component_name() != "types"
-      && !endsWith(message.component_name(), "Callback")) {
+  if (message.component_name() != "types") {
     if (print_extern_block) {
       out << "extern \"C\" {" << "\n";
     }
@@ -473,114 +472,98 @@
 void HalHidlCodeGen::GenerateClassHeader(Formatter& out,
     const ComponentSpecificationMessage& message,
     const string& fuzzer_extended_class_name) {
-  if (message.component_name() != "types"
-      && !endsWith(message.component_name(), "Callback")) {
+  if (message.component_name() != "types") {
     for (const auto attribute : message.interface().attribute()) {
       GenerateAllFunctionDeclForAttribute(out, attribute);
     }
     DriverCodeGenBase::GenerateClassHeader(out, message,
                                            fuzzer_extended_class_name);
-  } else if (message.component_name() == "types") {
+  } else {
     for (const auto attribute : message.attribute()) {
       GenerateAllFunctionDeclForAttribute(out, attribute);
     };
-  } else if (endsWith(message.component_name(), "Callback")) {
-    for (const auto attribute : message.interface().attribute()) {
-      GenerateAllFunctionDeclForAttribute(out, attribute);
-    }
+  }
+}
 
-    out << "\n";
-    FQName component_fq_name = GetFQName(message);
-    string component_name_token = "Vts_" + component_fq_name.tokenName();;
-    out << "class " << component_name_token << " : public "
-        << component_fq_name.cppName() << ", public DriverCallbackBase {"
-        << "\n";
-    out << " public:" << "\n";
+void HalHidlCodeGen::GenerateHeaderInterfaceImpl(
+    Formatter& out, const ComponentSpecificationMessage& message) {
+  out << "\n";
+  FQName component_fq_name = GetFQName(message);
+  string component_name_token = "Vts_" + component_fq_name.tokenName();
+  out << "class " << component_name_token << " : public "
+      << component_fq_name.cppName() << ", public DriverCallbackBase {\n";
+  out << " public:\n";
+  out.indent();
+  out << component_name_token << "(const string& callback_socket_name)\n"
+      << "    : callback_socket_name_(callback_socket_name) {};\n\n";
+  out << "virtual ~" << component_name_token << "()"
+      << " = default;\n\n";
+  for (const auto& api : message.interface().api()) {
+    // Generate return statement.
+    if (CanElideCallback(api)) {
+      out << "::android::hardware::Return<"
+          << GetCppVariableType(api.return_type_hidl(0), &message) << "> ";
+    } else {
+      out << "::android::hardware::Return<void> ";
+    }
+    // Generate function call.
+    out << api.name() << "(\n";
     out.indent();
-    out << component_name_token << "(const string& callback_socket_name)\n"
-        << "    : callback_socket_name_(callback_socket_name) {};" << "\n";
-    out << "\n";
-    out << "virtual ~" << component_name_token << "()"
-        << " = default;" << "\n";
-    out << "\n";
-    for (const auto& api : message.interface().api()) {
-      // Generate return statement.
-      if (CanElideCallback(api)) {
-        out << "::android::hardware::Return<"
-            << GetCppVariableType(api.return_type_hidl(0), &message) << "> ";
+    for (int index = 0; index < api.arg_size(); index++) {
+      const auto& arg = api.arg(index);
+      if (!isConstType(arg.type())) {
+        out << GetCppVariableType(arg, &message);
       } else {
-        out << "::android::hardware::Return<void> ";
+        out << GetCppVariableType(arg, &message, true);
       }
-      // Generate function call.
-      out << api.name() << "(\n";
-      out.indent();
-      for (int index = 0; index < api.arg_size(); index++) {
-        const auto& arg = api.arg(index);
-        if (!isConstType(arg.type())) {
-          out << GetCppVariableType(arg, &message);
+      out << " arg" << index;
+      if (index != (api.arg_size() - 1)) out << ",\n";
+    }
+    if (api.return_type_hidl_size() == 0 || CanElideCallback(api)) {
+      out << ") override;\n\n";
+    } else {  // handle the case of callbacks.
+      out << (api.arg_size() != 0 ? ", " : "");
+      out << "std::function<void(";
+      for (int index = 0; index < api.return_type_hidl_size(); index++) {
+        const auto& return_val = api.return_type_hidl(index);
+        if (!isConstType(return_val.type())) {
+          out << GetCppVariableType(return_val, &message);
         } else {
-          out << GetCppVariableType(arg, &message, true);
+          out << GetCppVariableType(return_val, &message, true);
         }
         out << " arg" << index;
-        if (index != (api.arg_size() - 1))
-          out << ",\n";
+        if (index != (api.return_type_hidl_size() - 1)) out << ",";
       }
-      if (api.return_type_hidl_size() == 0 || CanElideCallback(api)) {
-        out << ") override;" << "\n\n";
-      } else {  // handle the case of callbacks.
-        out << (api.arg_size() != 0 ? ", " : "");
-        out << "std::function<void(";
-        for (int index = 0; index < api.return_type_hidl_size(); index++) {
-          const auto& return_val = api.return_type_hidl(index);
-          if (!isConstType(return_val.type())) {
-            out << GetCppVariableType(return_val, &message);
-          } else {
-            out << GetCppVariableType(return_val, &message, true);
-          }
-          out << " arg" << index;
-          if (index != (api.return_type_hidl_size() - 1))
-            out << ",";
-        }
-        out << ")>) override;" << "\n\n";
-      }
-      out.unindent();
+      out << ")>) override;\n\n";
     }
-    out << "\n";
     out.unindent();
-    out << " private:" << "\n";
-    out.indent();
-    out << "string callback_socket_name_;\n";
-    out.unindent();
-    out << "};" << "\n";
-    out << "\n";
-
-    out << "sp<" << component_fq_name.cppName() << "> VtsFuzzerCreate"
-        << component_name_token << "(const string& callback_socket_name);"
-        << "\n";
-    out << "\n";
   }
+  out << "\n";
+  out.unindent();
+  out << " private:\n";
+  out.indent();
+  out << "string callback_socket_name_;\n";
+  out.unindent();
+  out << "};\n\n";
+
+  out << "sp<" << component_fq_name.cppName() << "> VtsFuzzerCreate"
+      << component_name_token << "(const string& callback_socket_name);\n\n";
 }
 
 void HalHidlCodeGen::GenerateClassImpl(Formatter& out,
     const ComponentSpecificationMessage& message,
     const string& fuzzer_extended_class_name) {
-  if (message.component_name() != "types"
-      && !endsWith(message.component_name(), "Callback")) {
+  if (message.component_name() != "types") {
     for (auto attribute : message.interface().attribute()) {
       GenerateAllFunctionImplForAttribute(out, attribute);
     }
     GenerateGetServiceImpl(out, message, fuzzer_extended_class_name);
     DriverCodeGenBase::GenerateClassImpl(out, message,
                                          fuzzer_extended_class_name);
-  } else if (message.component_name() == "types") {
+  } else {
     for (auto attribute : message.attribute()) {
       GenerateAllFunctionImplForAttribute(out, attribute);
     }
-  } else if (endsWith(message.component_name(), "Callback")) {
-    for (auto attribute : message.interface().attribute()) {
-      GenerateAllFunctionImplForAttribute(out, attribute);
-    }
-    GenerateCppBodyCallbackFunction(out, message, fuzzer_extended_class_name);
   }
 }
 
@@ -653,8 +636,7 @@
 void HalHidlCodeGen::GenerateAdditionalFuctionDeclarations(Formatter& out,
     const ComponentSpecificationMessage& message,
     const string& /*fuzzer_extended_class_name*/) {
-  if (message.component_name() != "types"
-      && !endsWith(message.component_name(), "Callback")) {
+  if (message.component_name() != "types") {
     out << "bool GetService(bool get_stub, const char* service_name);"
         << "\n\n";
   }
@@ -684,7 +666,8 @@
       return;
     }
     string attribute_name = ClearStringWithNameSpaceAccess(attribute.name());
-    out << attribute.name() << " " << "Random" << attribute_name << "();\n";
+    out << attribute.enum_value().scalar_type() << " "
+        << "Random" << attribute_name << "();\n";
   }
 }
 
@@ -697,8 +680,8 @@
       return;
     }
     string attribute_name = ClearStringWithNameSpaceAccess(attribute.name());
-    out << attribute.name() << " " << "Random" << attribute_name << "() {"
-        << "\n";
+    out << attribute.enum_value().scalar_type() << " Random" << attribute_name
+        << "() {\n";
     out.indent();
     out << attribute.enum_value().scalar_type() << " choice = " << "("
         << attribute.enum_value().scalar_type() << ") " << "rand() / "
@@ -731,11 +714,13 @@
             << attribute.enum_value().scalar_type() << "\n";
         exit(-1);
       }
-      out << ") return " << attribute.name() << "::"
-          << attribute.enum_value().enumerator(index) << ";" << "\n";
+      out << ") return static_cast<" << attribute.enum_value().scalar_type()
+          << ">(" << attribute.name()
+          << "::" << attribute.enum_value().enumerator(index) << ");\n";
     }
-    out << "return " << attribute.name() << "::"
-        << attribute.enum_value().enumerator(0) << ";" << "\n";
+    out << "return static_cast<" << attribute.enum_value().scalar_type() << ">("
+        << attribute.name() << "::" << attribute.enum_value().enumerator(0)
+        << ");\n";
     out.unindent();
     out << "}" << "\n";
   }
@@ -1218,8 +1203,7 @@
 void HalHidlCodeGen::GenerateVerificationFunctionImpl(Formatter& out,
     const ComponentSpecificationMessage& message,
     const string& fuzzer_extended_class_name) {
-  if (message.component_name() != "types"
-      && !endsWith(message.component_name(), "Callback")) {
+  if (message.component_name() != "types") {
     // Generate the main profiler function.
     out << "\nbool " << fuzzer_extended_class_name;
     out.indent();
@@ -1743,7 +1727,8 @@
 }
 
 bool HalHidlCodeGen::isConstType(const VariableType& type) {
-  if (type == TYPE_ARRAY || type == TYPE_VECTOR || type == TYPE_REF) {
+  if (type == TYPE_ARRAY || type == TYPE_VECTOR || type == TYPE_REF ||
+      type == TYPE_HIDL_INTERFACE) {
     return true;
   }
   if (isElidableType(type)) {
diff --git a/compilation_tools/vtsc/code_gen/driver/HalHidlCodeGen.h b/compilation_tools/vtsc/code_gen/driver/HalHidlCodeGen.h
index 9e719d8..a5ba370 100644
--- a/compilation_tools/vtsc/code_gen/driver/HalHidlCodeGen.h
+++ b/compilation_tools/vtsc/code_gen/driver/HalHidlCodeGen.h
@@ -61,8 +61,11 @@
       const ComponentSpecificationMessage& message,
       const string& fuzzer_extended_class_name) override;
 
-  void GenerateCppBodyCallbackFunction(Formatter& out,
-      const ComponentSpecificationMessage& message,
+  void GenerateHeaderInterfaceImpl(
+      Formatter& out, const ComponentSpecificationMessage& message) override;
+
+  void GenerateCppBodyInterfaceImpl(
+      Formatter& out, const ComponentSpecificationMessage& message,
       const string& fuzzer_extended_class_name) override;
 
   void GenerateClassConstructionFunction(Formatter& out,
@@ -96,11 +99,16 @@
   void GeneratePrivateMemberDeclarations(Formatter& out,
       const ComponentSpecificationMessage& message) override;
 
+ private:
   void GenerateCppBodyFuzzFunction(Formatter& out,
       const StructSpecificationMessage& message,
       const string& fuzzer_extended_class_name,
       const string& original_data_structure_name, const string& parent_path);
 
+  // Generates the code to declar the impl class for an interface.
+  void GenerateClassDecalrationForInterface(
+      Formatter& out, const ComponentSpecificationMessage& message);
+
   // Generates a scalar type in C/C++.
   void GenerateScalarTypeInC(Formatter& out, const string& type);
 
diff --git a/compilation_tools/vtsc/code_gen/driver/LegacyHalCodeGen.h b/compilation_tools/vtsc/code_gen/driver/LegacyHalCodeGen.h
index a68179f..ec570b5 100644
--- a/compilation_tools/vtsc/code_gen/driver/LegacyHalCodeGen.h
+++ b/compilation_tools/vtsc/code_gen/driver/LegacyHalCodeGen.h
@@ -45,10 +45,6 @@
       const ComponentSpecificationMessage& message,
       const string& fuzzer_extended_class_name) override;
 
-  void GenerateCppBodyCallbackFunction(Formatter& /*out*/,
-      const ComponentSpecificationMessage& /*message*/,
-      const string& /*fuzzer_extended_class_name*/) override {};
-
   void GenerateClassConstructionFunction(Formatter& out,
       const ComponentSpecificationMessage& message,
       const string& fuzzer_extended_class_name) override;
diff --git a/compilation_tools/vtsc/code_gen/driver/LibSharedCodeGen.h b/compilation_tools/vtsc/code_gen/driver/LibSharedCodeGen.h
index a28648c..3ba52cf 100644
--- a/compilation_tools/vtsc/code_gen/driver/LibSharedCodeGen.h
+++ b/compilation_tools/vtsc/code_gen/driver/LibSharedCodeGen.h
@@ -45,10 +45,6 @@
       const ComponentSpecificationMessage& message,
       const string& fuzzer_extended_class_name) override;
 
-  void GenerateCppBodyCallbackFunction(Formatter& /*out*/,
-      const ComponentSpecificationMessage& /*message*/,
-      const string& /*fuzzer_extended_class_name*/) override {};
-
   void GenerateClassConstructionFunction(Formatter& out,
       const ComponentSpecificationMessage& message,
       const string& fuzzer_extended_class_name) override;
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/Bar.driver.cpp b/compilation_tools/vtsc/test/golden/DRIVER/Bar.driver.cpp
index e5907c0..e2d07bb 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/Bar.driver.cpp
+++ b/compilation_tools/vtsc/test/golden/DRIVER/Bar.driver.cpp
@@ -53,6 +53,547 @@
     return true;
 }
 
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::doThis(
+    float arg0 __attribute__((__unused__))) {
+    cout << "doThis called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("doThis"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::doThis");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("float_t");
+    var_msg0->mutable_scalar_value()->set_float_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<int32_t> Vts_android_hardware_tests_bar_V1_0_IBar::doThatAndReturnSomething(
+    int64_t arg0 __attribute__((__unused__))) {
+    cout << "doThatAndReturnSomething called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("doThatAndReturnSomething"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::doThatAndReturnSomething");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("int64_t");
+    var_msg0->mutable_scalar_value()->set_int64_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast<int32_t>(0);
+}
+
+::android::hardware::Return<double> Vts_android_hardware_tests_bar_V1_0_IBar::doQuiteABit(
+    int32_t arg0 __attribute__((__unused__)),
+    int64_t arg1 __attribute__((__unused__)),
+    float arg2 __attribute__((__unused__)),
+    double arg3 __attribute__((__unused__))) {
+    cout << "doQuiteABit called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("doQuiteABit"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::doQuiteABit");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("int32_t");
+    var_msg0->mutable_scalar_value()->set_int32_t(arg0);
+    VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+    var_msg1->set_type(TYPE_SCALAR);
+    var_msg1->set_scalar_type("int64_t");
+    var_msg1->mutable_scalar_value()->set_int64_t(arg1);
+    VariableSpecificationMessage* var_msg2 = callback_message.add_arg();
+    var_msg2->set_type(TYPE_SCALAR);
+    var_msg2->set_scalar_type("float_t");
+    var_msg2->mutable_scalar_value()->set_float_t(arg2);
+    VariableSpecificationMessage* var_msg3 = callback_message.add_arg();
+    var_msg3->set_type(TYPE_SCALAR);
+    var_msg3->set_scalar_type("double_t");
+    var_msg3->mutable_scalar_value()->set_double_t(arg3);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast<double>(0);
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::doSomethingElse(
+    const ::android::hardware::hidl_array<int32_t,15>& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_array<int32_t,32>& arg0)>) {
+    cout << "doSomethingElse called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("doSomethingElse"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::doSomethingElse");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_ARRAY);
+    var_msg0->set_vector_size(1);
+    for (int i = 0; i < 1; i++) {
+        auto *var_msg0_array_i = var_msg0->add_vector_value();
+        var_msg0_array_i->set_type(TYPE_SCALAR);
+        var_msg0_array_i->set_scalar_type("int32_t");
+        var_msg0_array_i->mutable_scalar_value()->set_int32_t(arg0[i]);
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::doStuffAndReturnAString(
+    std::function<void(const ::android::hardware::hidl_string& arg0)>) {
+    cout << "doStuffAndReturnAString called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("doStuffAndReturnAString"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::doStuffAndReturnAString");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::mapThisVector(
+    const ::android::hardware::hidl_vec<int32_t>& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_vec<int32_t>& arg0)>) {
+    cout << "mapThisVector called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("mapThisVector"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::mapThisVector");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_VECTOR);
+    var_msg0->set_vector_size(arg0.size());
+    for (int i = 0; i < (int)arg0.size(); i++) {
+        auto *var_msg0_vector_i = var_msg0->add_vector_value();
+        var_msg0_vector_i->set_type(TYPE_SCALAR);
+        var_msg0_vector_i->set_scalar_type("int32_t");
+        var_msg0_vector_i->mutable_scalar_value()->set_int32_t(arg0[i]);
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::callMe(
+    const sp<::android::hardware::tests::foo::V1_0::IFooCallback>& arg0 __attribute__((__unused__))) {
+    cout << "callMe called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("callMe"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::callMe");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_HIDL_CALLBACK);
+    /* ERROR: TYPE_HIDL_CALLBACK is not supported yet. */
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<::android::hardware::tests::foo::V1_0::IFoo::SomeEnum> Vts_android_hardware_tests_bar_V1_0_IBar::useAnEnum(
+    ::android::hardware::tests::foo::V1_0::IFoo::SomeEnum arg0 __attribute__((__unused__))) {
+    cout << "useAnEnum called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("useAnEnum"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::useAnEnum");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_ENUM);
+    SetResult__android__hardware__tests__foo__V1_0__IFoo__SomeEnum(var_msg0, arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast< ::android::hardware::tests::foo::V1_0::IFoo::SomeEnum>(Random__android__hardware__tests__foo__V1_0__IFoo__SomeEnum());
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::haveAGooberVec(
+    const ::android::hardware::hidl_vec<::android::hardware::tests::foo::V1_0::IFoo::Goober>& arg0 __attribute__((__unused__))) {
+    cout << "haveAGooberVec called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveAGooberVec"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::haveAGooberVec");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_VECTOR);
+    var_msg0->set_vector_size(arg0.size());
+    for (int i = 0; i < (int)arg0.size(); i++) {
+        auto *var_msg0_vector_i = var_msg0->add_vector_value();
+        var_msg0_vector_i->set_type(TYPE_STRUCT);
+        SetResult__android__hardware__tests__foo__V1_0__IFoo__Goober(var_msg0_vector_i, arg0[i]);
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::haveAGoober(
+    const ::android::hardware::tests::foo::V1_0::IFoo::Goober& arg0 __attribute__((__unused__))) {
+    cout << "haveAGoober called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveAGoober"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::haveAGoober");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_STRUCT);
+    SetResult__android__hardware__tests__foo__V1_0__IFoo__Goober(var_msg0, arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::haveAGooberArray(
+    const ::android::hardware::hidl_array<::android::hardware::tests::foo::V1_0::IFoo::Goober,20>& arg0 __attribute__((__unused__))) {
+    cout << "haveAGooberArray called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveAGooberArray"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::haveAGooberArray");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_ARRAY);
+    var_msg0->set_vector_size(1);
+    for (int i = 0; i < 1; i++) {
+        auto *var_msg0_array_i = var_msg0->add_vector_value();
+        var_msg0_array_i->set_type(TYPE_STRUCT);
+        auto *var_msg0_array_i_q = var_msg0_array_i->add_struct_value();
+        var_msg0_array_i_q->set_type(TYPE_SCALAR);
+        var_msg0_array_i_q->set_scalar_type("int32_t");
+        var_msg0_array_i_q->mutable_scalar_value()->set_int32_t(arg0[i].q);
+        var_msg0_array_i_q->set_name("q");
+        auto *var_msg0_array_i_name = var_msg0_array_i->add_struct_value();
+        var_msg0_array_i_name->set_type(TYPE_STRING);
+        var_msg0_array_i_name->mutable_string_value()->set_message(arg0[i].name.c_str());
+        var_msg0_array_i_name->mutable_string_value()->set_length(arg0[i].name.size());
+        var_msg0_array_i_name->set_name("name");
+        auto *var_msg0_array_i_address = var_msg0_array_i->add_struct_value();
+        var_msg0_array_i_address->set_type(TYPE_STRING);
+        var_msg0_array_i_address->mutable_string_value()->set_message(arg0[i].address.c_str());
+        var_msg0_array_i_address->mutable_string_value()->set_length(arg0[i].address.size());
+        var_msg0_array_i_address->set_name("address");
+        auto *var_msg0_array_i_numbers = var_msg0_array_i->add_struct_value();
+        var_msg0_array_i_numbers->set_type(TYPE_ARRAY);
+        var_msg0_array_i_numbers->set_vector_size(1);
+        for (int i = 0; i < 1; i++) {
+            auto *var_msg0_array_i_numbers_array_i = var_msg0_array_i_numbers->add_vector_value();
+            var_msg0_array_i_numbers_array_i->set_type(TYPE_SCALAR);
+            var_msg0_array_i_numbers_array_i->set_scalar_type("double_t");
+            var_msg0_array_i_numbers_array_i->mutable_scalar_value()->set_double_t(arg0[i].numbers[i]);
+        }
+        var_msg0_array_i_numbers->set_name("numbers");
+        auto *var_msg0_array_i_fumble = var_msg0_array_i->add_struct_value();
+        var_msg0_array_i_fumble->set_type(TYPE_STRUCT);
+        SetResult__android__hardware__tests__foo__V1_0__IFoo__Fumble(var_msg0_array_i_fumble, arg0[i].fumble);
+        var_msg0_array_i_fumble->set_name("fumble");
+        auto *var_msg0_array_i_gumble = var_msg0_array_i->add_struct_value();
+        var_msg0_array_i_gumble->set_type(TYPE_STRUCT);
+        SetResult__android__hardware__tests__foo__V1_0__IFoo__Fumble(var_msg0_array_i_gumble, arg0[i].gumble);
+        var_msg0_array_i_gumble->set_name("gumble");
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::haveATypeFromAnotherFile(
+    const ::android::hardware::tests::foo::V1_0::Abc& arg0 __attribute__((__unused__))) {
+    cout << "haveATypeFromAnotherFile called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveATypeFromAnotherFile"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::haveATypeFromAnotherFile");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_STRUCT);
+    SetResult__android__hardware__tests__foo__V1_0__Abc(var_msg0, arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::haveSomeStrings(
+    const ::android::hardware::hidl_array<::android::hardware::hidl_string,3>& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_array<::android::hardware::hidl_string,2>& arg0)>) {
+    cout << "haveSomeStrings called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveSomeStrings"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::haveSomeStrings");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_ARRAY);
+    var_msg0->set_vector_size(1);
+    for (int i = 0; i < 1; i++) {
+        auto *var_msg0_array_i = var_msg0->add_vector_value();
+        var_msg0_array_i->set_type(TYPE_STRING);
+        var_msg0_array_i->mutable_string_value()->set_message(arg0[i].c_str());
+        var_msg0_array_i->mutable_string_value()->set_length(arg0[i].size());
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::haveAStringVec(
+    const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& arg0)>) {
+    cout << "haveAStringVec called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveAStringVec"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::haveAStringVec");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_VECTOR);
+    var_msg0->set_vector_size(arg0.size());
+    for (int i = 0; i < (int)arg0.size(); i++) {
+        auto *var_msg0_vector_i = var_msg0->add_vector_value();
+        var_msg0_vector_i->set_type(TYPE_STRING);
+        var_msg0_vector_i->mutable_string_value()->set_message(arg0[i].c_str());
+        var_msg0_vector_i->mutable_string_value()->set_length(arg0[i].size());
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::transposeMe(
+    const ::android::hardware::hidl_array<float, 3,5>& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_array<float, 5,3>& arg0)>) {
+    cout << "transposeMe called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("transposeMe"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::transposeMe");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_ARRAY);
+    var_msg0->set_vector_size(1);
+    for (int i = 0; i < 1; i++) {
+        auto *var_msg0_array_i = var_msg0->add_vector_value();
+        var_msg0_array_i->set_type(TYPE_ARRAY);
+        var_msg0_array_i->set_vector_size(1);
+        for (int i = 0; i < 1; i++) {
+            auto *var_msg0_array_i_array_i = var_msg0_array_i->add_vector_value();
+            var_msg0_array_i_array_i->set_type(TYPE_SCALAR);
+            var_msg0_array_i_array_i->set_scalar_type("float_t");
+            var_msg0_array_i_array_i->mutable_scalar_value()->set_float_t(arg0[i][i]);
+        }
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::callingDrWho(
+    const ::android::hardware::tests::foo::V1_0::IFoo::MultiDimensional& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::tests::foo::V1_0::IFoo::MultiDimensional& arg0)>) {
+    cout << "callingDrWho called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("callingDrWho"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::callingDrWho");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_STRUCT);
+    SetResult__android__hardware__tests__foo__V1_0__IFoo__MultiDimensional(var_msg0, arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::transpose(
+    const ::android::hardware::tests::foo::V1_0::IFoo::StringMatrix5x3& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::tests::foo::V1_0::IFoo::StringMatrix3x5& arg0)>) {
+    cout << "transpose called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("transpose"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::transpose");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_STRUCT);
+    SetResult__android__hardware__tests__foo__V1_0__IFoo__StringMatrix5x3(var_msg0, arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::transpose2(
+    const ::android::hardware::hidl_array<::android::hardware::hidl_string, 5,3>& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_array<::android::hardware::hidl_string, 3,5>& arg0)>) {
+    cout << "transpose2 called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("transpose2"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::transpose2");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_ARRAY);
+    var_msg0->set_vector_size(1);
+    for (int i = 0; i < 1; i++) {
+        auto *var_msg0_array_i = var_msg0->add_vector_value();
+        var_msg0_array_i->set_type(TYPE_ARRAY);
+        var_msg0_array_i->set_vector_size(1);
+        for (int i = 0; i < 1; i++) {
+            auto *var_msg0_array_i_array_i = var_msg0_array_i->add_vector_value();
+            var_msg0_array_i_array_i->set_type(TYPE_STRING);
+            var_msg0_array_i_array_i->mutable_string_value()->set_message(arg0[i][i].c_str());
+            var_msg0_array_i_array_i->mutable_string_value()->set_length(arg0[i][i].size());
+        }
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::sendVec(
+    const ::android::hardware::hidl_vec<uint8_t>& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_vec<uint8_t>& arg0)>) {
+    cout << "sendVec called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("sendVec"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::sendVec");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_VECTOR);
+    var_msg0->set_vector_size(arg0.size());
+    for (int i = 0; i < (int)arg0.size(); i++) {
+        auto *var_msg0_vector_i = var_msg0->add_vector_value();
+        var_msg0_vector_i->set_type(TYPE_SCALAR);
+        var_msg0_vector_i->set_scalar_type("uint8_t");
+        var_msg0_vector_i->mutable_scalar_value()->set_uint8_t(arg0[i]);
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::sendVecVec(
+    std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_vec<uint8_t>>& arg0)>) {
+    cout << "sendVecVec called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("sendVecVec"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::sendVecVec");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::haveAVectorOfInterfaces(
+    const ::android::hardware::hidl_vec<sp<::android::hardware::tests::foo::V1_0::ISimple>>& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_vec<sp<::android::hardware::tests::foo::V1_0::ISimple>>& arg0)>) {
+    cout << "haveAVectorOfInterfaces called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveAVectorOfInterfaces"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::haveAVectorOfInterfaces");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_VECTOR);
+    var_msg0->set_vector_size(arg0.size());
+    for (int i = 0; i < (int)arg0.size(); i++) {
+        auto *var_msg0_vector_i = var_msg0->add_vector_value();
+        var_msg0_vector_i->set_type(TYPE_HIDL_INTERFACE);
+        var_msg0_vector_i->set_predefined_type("::android::hardware::tests::foo::V1_0::ISimple");
+        if (arg0[i] != nullptr) {
+            arg0[i]->incStrong(arg0[i].get());
+            var_msg0_vector_i->set_hidl_interface_pointer(reinterpret_cast<uintptr_t>(arg0[i].get()));
+        } else {
+            var_msg0_vector_i->set_hidl_interface_pointer(0);
+        }
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::haveAVectorOfGenericInterfaces(
+    const ::android::hardware::hidl_vec<sp<::android::hidl::base::V1_0::IBase>>& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_vec<sp<::android::hidl::base::V1_0::IBase>>& arg0)>) {
+    cout << "haveAVectorOfGenericInterfaces called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveAVectorOfGenericInterfaces"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::haveAVectorOfGenericInterfaces");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_VECTOR);
+    var_msg0->set_vector_size(arg0.size());
+    for (int i = 0; i < (int)arg0.size(); i++) {
+        auto *var_msg0_vector_i = var_msg0->add_vector_value();
+        var_msg0_vector_i->set_type(TYPE_HIDL_INTERFACE);
+        var_msg0_vector_i->set_predefined_type("::android::hidl::base::V1_0::IBase");
+        if (arg0[i] != nullptr) {
+            arg0[i]->incStrong(arg0[i].get());
+            var_msg0_vector_i->set_hidl_interface_pointer(reinterpret_cast<uintptr_t>(arg0[i].get()));
+        } else {
+            var_msg0_vector_i->set_hidl_interface_pointer(0);
+        }
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::echoNullInterface(
+    const sp<::android::hardware::tests::foo::V1_0::IFooCallback>& arg0 __attribute__((__unused__)), std::function<void(bool arg0,const sp<::android::hardware::tests::foo::V1_0::IFooCallback>& arg1)>) {
+    cout << "echoNullInterface called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("echoNullInterface"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::echoNullInterface");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_HIDL_CALLBACK);
+    /* ERROR: TYPE_HIDL_CALLBACK is not supported yet. */
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::createMyHandle(
+    std::function<void(const ::android::hardware::tests::foo::V1_0::IFoo::MyHandle& arg0)>) {
+    cout << "createMyHandle called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("createMyHandle"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::createMyHandle");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::createHandles(
+    uint32_t arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_handle>& arg0)>) {
+    cout << "createHandles called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("createHandles"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::createHandles");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("uint32_t");
+    var_msg0->mutable_scalar_value()->set_uint32_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::closeHandles(
+    ) {
+    cout << "closeHandles called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("closeHandles"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::closeHandles");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::thisIsNew(
+    ) {
+    cout << "thisIsNew called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("thisIsNew"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::thisIsNew");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::expectNullHandle(
+    const ::android::hardware::hidl_handle& arg0 __attribute__((__unused__)),
+    const ::android::hardware::tests::foo::V1_0::Abc& arg1 __attribute__((__unused__)), std::function<void(bool arg0,bool arg1)>) {
+    cout << "expectNullHandle called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("expectNullHandle"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::expectNullHandle");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_HANDLE);
+    /* ERROR: TYPE_HANDLE is not supported yet. */
+    VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+    var_msg1->set_type(TYPE_STRUCT);
+    SetResult__android__hardware__tests__foo__V1_0__Abc(var_msg1, arg1);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_bar_V1_0_IBar::takeAMask(
+    ::android::hardware::tests::foo::V1_0::IFoo::BitField arg0 __attribute__((__unused__)),
+    uint8_t arg1 __attribute__((__unused__)),
+    const ::android::hardware::tests::foo::V1_0::IFoo::MyMask& arg2 __attribute__((__unused__)),
+    uint8_t arg3 __attribute__((__unused__)), std::function<void(::android::hardware::tests::foo::V1_0::IFoo::BitField arg0,uint8_t arg1,uint8_t arg2,uint8_t arg3)>) {
+    cout << "takeAMask called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("takeAMask"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::takeAMask");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_ENUM);
+    SetResult__android__hardware__tests__foo__V1_0__IFoo__BitField(var_msg0, arg0);
+    VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+    var_msg1->set_type(TYPE_MASK);
+    var_msg1->set_scalar_type("uint8_t");
+    var_msg1->mutable_scalar_value()->set_uint8_t(arg1);
+    VariableSpecificationMessage* var_msg2 = callback_message.add_arg();
+    var_msg2->set_type(TYPE_STRUCT);
+    SetResult__android__hardware__tests__foo__V1_0__IFoo__MyMask(var_msg2, arg2);
+    VariableSpecificationMessage* var_msg3 = callback_message.add_arg();
+    var_msg3->set_type(TYPE_MASK);
+    var_msg3->set_scalar_type("uint8_t");
+    var_msg3->mutable_scalar_value()->set_uint8_t(arg3);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<sp<::android::hardware::tests::foo::V1_0::ISimple>> Vts_android_hardware_tests_bar_V1_0_IBar::haveAInterface(
+    const sp<::android::hardware::tests::foo::V1_0::ISimple>& arg0 __attribute__((__unused__))) {
+    cout << "haveAInterface called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveAInterface"));
+    callback_message.set_name("Vts_android_hardware_tests_bar_V1_0_IBar::haveAInterface");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_HIDL_INTERFACE);
+    var_msg0->set_predefined_type("::android::hardware::tests::foo::V1_0::ISimple");
+    if (arg0 != nullptr) {
+        arg0->incStrong(arg0.get());
+        var_msg0->set_hidl_interface_pointer(reinterpret_cast<uintptr_t>(arg0.get()));
+    } else {
+        var_msg0->set_hidl_interface_pointer(0);
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return nullptr;
+}
+
+sp<::android::hardware::tests::bar::V1_0::IBar> VtsFuzzerCreateVts_android_hardware_tests_bar_V1_0_IBar(const string& callback_socket_name) {
+    static sp<::android::hardware::tests::bar::V1_0::IBar> result;
+    result = new Vts_android_hardware_tests_bar_V1_0_IBar(callback_socket_name);
+    return result;
+}
+
 bool FuzzerExtended_android_hardware_tests_bar_V1_0_IBar::Fuzz(
     FunctionSpecificationMessage* /*func_msg*/,
     void** /*result*/, const string& /*callback_socket_name*/) {
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/Bar.vts.h b/compilation_tools/vtsc/test/golden/DRIVER/Bar.vts.h
index 3f9ec6c..65874ba 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/Bar.vts.h
+++ b/compilation_tools/vtsc/test/golden/DRIVER/Bar.vts.h
@@ -13,6 +13,8 @@
 #include <driver_base/DriverBase.h>
 #include <driver_base/DriverCallbackBase.h>
 
+#include <VtsDriverCommUtil.h>
+
 #include <android/hardware/tests/bar/1.0/IBar.h>
 #include <hidl/HidlSupport.h>
 #include <android/hardware/tests/foo/1.0/IFoo.h>
@@ -36,6 +38,118 @@
 void MessageTo__android__hardware__tests__bar__V1_0__IBar__SomethingRelated(const VariableSpecificationMessage& var_msg, ::android::hardware::tests::bar::V1_0::IBar::SomethingRelated* arg);
 bool Verify__android__hardware__tests__bar__V1_0__IBar__SomethingRelated(const VariableSpecificationMessage& expected_result, const VariableSpecificationMessage& actual_result);
 void SetResult__android__hardware__tests__bar__V1_0__IBar__SomethingRelated(VariableSpecificationMessage* result_msg, ::android::hardware::tests::bar::V1_0::IBar::SomethingRelated result_value);
+
+class Vts_android_hardware_tests_bar_V1_0_IBar : public ::android::hardware::tests::bar::V1_0::IBar, public DriverCallbackBase {
+ public:
+    Vts_android_hardware_tests_bar_V1_0_IBar(const string& callback_socket_name)
+        : callback_socket_name_(callback_socket_name) {};
+
+    virtual ~Vts_android_hardware_tests_bar_V1_0_IBar() = default;
+
+    ::android::hardware::Return<void> doThis(
+        float arg0) override;
+
+    ::android::hardware::Return<int32_t> doThatAndReturnSomething(
+        int64_t arg0) override;
+
+    ::android::hardware::Return<double> doQuiteABit(
+        int32_t arg0,
+        int64_t arg1,
+        float arg2,
+        double arg3) override;
+
+    ::android::hardware::Return<void> doSomethingElse(
+        const ::android::hardware::hidl_array<int32_t,15>& arg0, std::function<void(const ::android::hardware::hidl_array<int32_t,32>& arg0)>) override;
+
+    ::android::hardware::Return<void> doStuffAndReturnAString(
+        std::function<void(const ::android::hardware::hidl_string& arg0)>) override;
+
+    ::android::hardware::Return<void> mapThisVector(
+        const ::android::hardware::hidl_vec<int32_t>& arg0, std::function<void(const ::android::hardware::hidl_vec<int32_t>& arg0)>) override;
+
+    ::android::hardware::Return<void> callMe(
+        const sp<::android::hardware::tests::foo::V1_0::IFooCallback>& arg0) override;
+
+    ::android::hardware::Return<::android::hardware::tests::foo::V1_0::IFoo::SomeEnum> useAnEnum(
+        ::android::hardware::tests::foo::V1_0::IFoo::SomeEnum arg0) override;
+
+    ::android::hardware::Return<void> haveAGooberVec(
+        const ::android::hardware::hidl_vec<::android::hardware::tests::foo::V1_0::IFoo::Goober>& arg0) override;
+
+    ::android::hardware::Return<void> haveAGoober(
+        const ::android::hardware::tests::foo::V1_0::IFoo::Goober& arg0) override;
+
+    ::android::hardware::Return<void> haveAGooberArray(
+        const ::android::hardware::hidl_array<::android::hardware::tests::foo::V1_0::IFoo::Goober,20>& arg0) override;
+
+    ::android::hardware::Return<void> haveATypeFromAnotherFile(
+        const ::android::hardware::tests::foo::V1_0::Abc& arg0) override;
+
+    ::android::hardware::Return<void> haveSomeStrings(
+        const ::android::hardware::hidl_array<::android::hardware::hidl_string,3>& arg0, std::function<void(const ::android::hardware::hidl_array<::android::hardware::hidl_string,2>& arg0)>) override;
+
+    ::android::hardware::Return<void> haveAStringVec(
+        const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& arg0, std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& arg0)>) override;
+
+    ::android::hardware::Return<void> transposeMe(
+        const ::android::hardware::hidl_array<float, 3,5>& arg0, std::function<void(const ::android::hardware::hidl_array<float, 5,3>& arg0)>) override;
+
+    ::android::hardware::Return<void> callingDrWho(
+        const ::android::hardware::tests::foo::V1_0::IFoo::MultiDimensional& arg0, std::function<void(const ::android::hardware::tests::foo::V1_0::IFoo::MultiDimensional& arg0)>) override;
+
+    ::android::hardware::Return<void> transpose(
+        const ::android::hardware::tests::foo::V1_0::IFoo::StringMatrix5x3& arg0, std::function<void(const ::android::hardware::tests::foo::V1_0::IFoo::StringMatrix3x5& arg0)>) override;
+
+    ::android::hardware::Return<void> transpose2(
+        const ::android::hardware::hidl_array<::android::hardware::hidl_string, 5,3>& arg0, std::function<void(const ::android::hardware::hidl_array<::android::hardware::hidl_string, 3,5>& arg0)>) override;
+
+    ::android::hardware::Return<void> sendVec(
+        const ::android::hardware::hidl_vec<uint8_t>& arg0, std::function<void(const ::android::hardware::hidl_vec<uint8_t>& arg0)>) override;
+
+    ::android::hardware::Return<void> sendVecVec(
+        std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_vec<uint8_t>>& arg0)>) override;
+
+    ::android::hardware::Return<void> haveAVectorOfInterfaces(
+        const ::android::hardware::hidl_vec<sp<::android::hardware::tests::foo::V1_0::ISimple>>& arg0, std::function<void(const ::android::hardware::hidl_vec<sp<::android::hardware::tests::foo::V1_0::ISimple>>& arg0)>) override;
+
+    ::android::hardware::Return<void> haveAVectorOfGenericInterfaces(
+        const ::android::hardware::hidl_vec<sp<::android::hidl::base::V1_0::IBase>>& arg0, std::function<void(const ::android::hardware::hidl_vec<sp<::android::hidl::base::V1_0::IBase>>& arg0)>) override;
+
+    ::android::hardware::Return<void> echoNullInterface(
+        const sp<::android::hardware::tests::foo::V1_0::IFooCallback>& arg0, std::function<void(bool arg0,const sp<::android::hardware::tests::foo::V1_0::IFooCallback>& arg1)>) override;
+
+    ::android::hardware::Return<void> createMyHandle(
+        std::function<void(const ::android::hardware::tests::foo::V1_0::IFoo::MyHandle& arg0)>) override;
+
+    ::android::hardware::Return<void> createHandles(
+        uint32_t arg0, std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_handle>& arg0)>) override;
+
+    ::android::hardware::Return<void> closeHandles(
+        ) override;
+
+    ::android::hardware::Return<void> thisIsNew(
+        ) override;
+
+    ::android::hardware::Return<void> expectNullHandle(
+        const ::android::hardware::hidl_handle& arg0,
+        const ::android::hardware::tests::foo::V1_0::Abc& arg1, std::function<void(bool arg0,bool arg1)>) override;
+
+    ::android::hardware::Return<void> takeAMask(
+        ::android::hardware::tests::foo::V1_0::IFoo::BitField arg0,
+        uint8_t arg1,
+        const ::android::hardware::tests::foo::V1_0::IFoo::MyMask& arg2,
+        uint8_t arg3, std::function<void(::android::hardware::tests::foo::V1_0::IFoo::BitField arg0,uint8_t arg1,uint8_t arg2,uint8_t arg3)>) override;
+
+    ::android::hardware::Return<sp<::android::hardware::tests::foo::V1_0::ISimple>> haveAInterface(
+        const sp<::android::hardware::tests::foo::V1_0::ISimple>& arg0) override;
+
+
+ private:
+    string callback_socket_name_;
+};
+
+sp<::android::hardware::tests::bar::V1_0::IBar> VtsFuzzerCreateVts_android_hardware_tests_bar_V1_0_IBar(const string& callback_socket_name);
+
 class FuzzerExtended_android_hardware_tests_bar_V1_0_IBar : public DriverBase {
  public:
     FuzzerExtended_android_hardware_tests_bar_V1_0_IBar() : DriverBase(HAL_HIDL), hw_binder_proxy_() {}
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/MemoryTest.driver.cpp b/compilation_tools/vtsc/test/golden/DRIVER/MemoryTest.driver.cpp
index c659db8..38408e6 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/MemoryTest.driver.cpp
+++ b/compilation_tools/vtsc/test/golden/DRIVER/MemoryTest.driver.cpp
@@ -31,6 +31,44 @@
     return true;
 }
 
+
+::android::hardware::Return<void> Vts_android_hardware_tests_memory_V1_0_IMemoryTest::haveSomeMemory(
+    const ::android::hardware::hidl_memory& arg0 __attribute__((__unused__)), std::function<void(const ::android::hardware::hidl_memory& arg0)>) {
+    cout << "haveSomeMemory called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("haveSomeMemory"));
+    callback_message.set_name("Vts_android_hardware_tests_memory_V1_0_IMemoryTest::haveSomeMemory");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_HIDL_MEMORY);
+    /* ERROR: TYPE_HIDL_MEMORY is not supported yet. */
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_memory_V1_0_IMemoryTest::fillMemory(
+    const ::android::hardware::hidl_memory& arg0 __attribute__((__unused__)),
+    uint8_t arg1 __attribute__((__unused__))) {
+    cout << "fillMemory called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("fillMemory"));
+    callback_message.set_name("Vts_android_hardware_tests_memory_V1_0_IMemoryTest::fillMemory");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_HIDL_MEMORY);
+    /* ERROR: TYPE_HIDL_MEMORY is not supported yet. */
+    VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+    var_msg1->set_type(TYPE_SCALAR);
+    var_msg1->set_scalar_type("uint8_t");
+    var_msg1->mutable_scalar_value()->set_uint8_t(arg1);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+sp<::android::hardware::tests::memory::V1_0::IMemoryTest> VtsFuzzerCreateVts_android_hardware_tests_memory_V1_0_IMemoryTest(const string& callback_socket_name) {
+    static sp<::android::hardware::tests::memory::V1_0::IMemoryTest> result;
+    result = new Vts_android_hardware_tests_memory_V1_0_IMemoryTest(callback_socket_name);
+    return result;
+}
+
 bool FuzzerExtended_android_hardware_tests_memory_V1_0_IMemoryTest::Fuzz(
     FunctionSpecificationMessage* /*func_msg*/,
     void** /*result*/, const string& /*callback_socket_name*/) {
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/MemoryTest.vts.h b/compilation_tools/vtsc/test/golden/DRIVER/MemoryTest.vts.h
index 137a224..fe6e0ac 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/MemoryTest.vts.h
+++ b/compilation_tools/vtsc/test/golden/DRIVER/MemoryTest.vts.h
@@ -13,6 +13,8 @@
 #include <driver_base/DriverBase.h>
 #include <driver_base/DriverCallbackBase.h>
 
+#include <VtsDriverCommUtil.h>
+
 #include <android/hardware/tests/memory/1.0/IMemoryTest.h>
 #include <hidl/HidlSupport.h>
 #include <android/hidl/base/1.0/types.h>
@@ -21,6 +23,28 @@
 using namespace android::hardware::tests::memory::V1_0;
 namespace android {
 namespace vts {
+
+class Vts_android_hardware_tests_memory_V1_0_IMemoryTest : public ::android::hardware::tests::memory::V1_0::IMemoryTest, public DriverCallbackBase {
+ public:
+    Vts_android_hardware_tests_memory_V1_0_IMemoryTest(const string& callback_socket_name)
+        : callback_socket_name_(callback_socket_name) {};
+
+    virtual ~Vts_android_hardware_tests_memory_V1_0_IMemoryTest() = default;
+
+    ::android::hardware::Return<void> haveSomeMemory(
+        const ::android::hardware::hidl_memory& arg0, std::function<void(const ::android::hardware::hidl_memory& arg0)>) override;
+
+    ::android::hardware::Return<void> fillMemory(
+        const ::android::hardware::hidl_memory& arg0,
+        uint8_t arg1) override;
+
+
+ private:
+    string callback_socket_name_;
+};
+
+sp<::android::hardware::tests::memory::V1_0::IMemoryTest> VtsFuzzerCreateVts_android_hardware_tests_memory_V1_0_IMemoryTest(const string& callback_socket_name);
+
 class FuzzerExtended_android_hardware_tests_memory_V1_0_IMemoryTest : public DriverBase {
  public:
     FuzzerExtended_android_hardware_tests_memory_V1_0_IMemoryTest() : DriverBase(HAL_HIDL), hw_binder_proxy_() {}
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/Nfc.driver.cpp b/compilation_tools/vtsc/test/golden/DRIVER/Nfc.driver.cpp
index db1ce48..fd31eaf 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/Nfc.driver.cpp
+++ b/compilation_tools/vtsc/test/golden/DRIVER/Nfc.driver.cpp
@@ -33,6 +33,104 @@
     return true;
 }
 
+
+::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> Vts_android_hardware_nfc_V1_0_INfc::open(
+    const sp<::android::hardware::nfc::V1_0::INfcClientCallback>& arg0 __attribute__((__unused__))) {
+    cout << "open called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("open"));
+    callback_message.set_name("Vts_android_hardware_nfc_V1_0_INfc::open");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_HIDL_CALLBACK);
+    /* ERROR: TYPE_HIDL_CALLBACK is not supported yet. */
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast< ::android::hardware::nfc::V1_0::NfcStatus>(Random__android__hardware__nfc__V1_0__NfcStatus());
+}
+
+::android::hardware::Return<uint32_t> Vts_android_hardware_nfc_V1_0_INfc::write(
+    const ::android::hardware::hidl_vec<uint8_t>& arg0 __attribute__((__unused__))) {
+    cout << "write called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("write"));
+    callback_message.set_name("Vts_android_hardware_nfc_V1_0_INfc::write");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_VECTOR);
+    var_msg0->set_vector_size(arg0.size());
+    for (int i = 0; i < (int)arg0.size(); i++) {
+        auto *var_msg0_vector_i = var_msg0->add_vector_value();
+        var_msg0_vector_i->set_type(TYPE_SCALAR);
+        var_msg0_vector_i->set_scalar_type("uint8_t");
+        var_msg0_vector_i->mutable_scalar_value()->set_uint8_t(arg0[i]);
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast<uint32_t>(0);
+}
+
+::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> Vts_android_hardware_nfc_V1_0_INfc::coreInitialized(
+    const ::android::hardware::hidl_vec<uint8_t>& arg0 __attribute__((__unused__))) {
+    cout << "coreInitialized called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("coreInitialized"));
+    callback_message.set_name("Vts_android_hardware_nfc_V1_0_INfc::coreInitialized");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_VECTOR);
+    var_msg0->set_vector_size(arg0.size());
+    for (int i = 0; i < (int)arg0.size(); i++) {
+        auto *var_msg0_vector_i = var_msg0->add_vector_value();
+        var_msg0_vector_i->set_type(TYPE_SCALAR);
+        var_msg0_vector_i->set_scalar_type("uint8_t");
+        var_msg0_vector_i->mutable_scalar_value()->set_uint8_t(arg0[i]);
+    }
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast< ::android::hardware::nfc::V1_0::NfcStatus>(Random__android__hardware__nfc__V1_0__NfcStatus());
+}
+
+::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> Vts_android_hardware_nfc_V1_0_INfc::prediscover(
+    ) {
+    cout << "prediscover called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("prediscover"));
+    callback_message.set_name("Vts_android_hardware_nfc_V1_0_INfc::prediscover");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast< ::android::hardware::nfc::V1_0::NfcStatus>(Random__android__hardware__nfc__V1_0__NfcStatus());
+}
+
+::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> Vts_android_hardware_nfc_V1_0_INfc::close(
+    ) {
+    cout << "close called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("close"));
+    callback_message.set_name("Vts_android_hardware_nfc_V1_0_INfc::close");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast< ::android::hardware::nfc::V1_0::NfcStatus>(Random__android__hardware__nfc__V1_0__NfcStatus());
+}
+
+::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> Vts_android_hardware_nfc_V1_0_INfc::controlGranted(
+    ) {
+    cout << "controlGranted called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("controlGranted"));
+    callback_message.set_name("Vts_android_hardware_nfc_V1_0_INfc::controlGranted");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast< ::android::hardware::nfc::V1_0::NfcStatus>(Random__android__hardware__nfc__V1_0__NfcStatus());
+}
+
+::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> Vts_android_hardware_nfc_V1_0_INfc::powerCycle(
+    ) {
+    cout << "powerCycle called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("powerCycle"));
+    callback_message.set_name("Vts_android_hardware_nfc_V1_0_INfc::powerCycle");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast< ::android::hardware::nfc::V1_0::NfcStatus>(Random__android__hardware__nfc__V1_0__NfcStatus());
+}
+
+sp<::android::hardware::nfc::V1_0::INfc> VtsFuzzerCreateVts_android_hardware_nfc_V1_0_INfc(const string& callback_socket_name) {
+    static sp<::android::hardware::nfc::V1_0::INfc> result;
+    result = new Vts_android_hardware_nfc_V1_0_INfc(callback_socket_name);
+    return result;
+}
+
 bool FuzzerExtended_android_hardware_nfc_V1_0_INfc::Fuzz(
     FunctionSpecificationMessage* /*func_msg*/,
     void** /*result*/, const string& /*callback_socket_name*/) {
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/Nfc.vts.h b/compilation_tools/vtsc/test/golden/DRIVER/Nfc.vts.h
index e26ec7a..499528b 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/Nfc.vts.h
+++ b/compilation_tools/vtsc/test/golden/DRIVER/Nfc.vts.h
@@ -13,6 +13,8 @@
 #include <driver_base/DriverBase.h>
 #include <driver_base/DriverCallbackBase.h>
 
+#include <VtsDriverCommUtil.h>
+
 #include <android/hardware/nfc/1.0/INfc.h>
 #include <hidl/HidlSupport.h>
 #include <android/hardware/nfc/1.0/INfcClientCallback.h>
@@ -25,6 +27,42 @@
 using namespace android::hardware::nfc::V1_0;
 namespace android {
 namespace vts {
+
+class Vts_android_hardware_nfc_V1_0_INfc : public ::android::hardware::nfc::V1_0::INfc, public DriverCallbackBase {
+ public:
+    Vts_android_hardware_nfc_V1_0_INfc(const string& callback_socket_name)
+        : callback_socket_name_(callback_socket_name) {};
+
+    virtual ~Vts_android_hardware_nfc_V1_0_INfc() = default;
+
+    ::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> open(
+        const sp<::android::hardware::nfc::V1_0::INfcClientCallback>& arg0) override;
+
+    ::android::hardware::Return<uint32_t> write(
+        const ::android::hardware::hidl_vec<uint8_t>& arg0) override;
+
+    ::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> coreInitialized(
+        const ::android::hardware::hidl_vec<uint8_t>& arg0) override;
+
+    ::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> prediscover(
+        ) override;
+
+    ::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> close(
+        ) override;
+
+    ::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> controlGranted(
+        ) override;
+
+    ::android::hardware::Return<::android::hardware::nfc::V1_0::NfcStatus> powerCycle(
+        ) override;
+
+
+ private:
+    string callback_socket_name_;
+};
+
+sp<::android::hardware::nfc::V1_0::INfc> VtsFuzzerCreateVts_android_hardware_nfc_V1_0_INfc(const string& callback_socket_name);
+
 class FuzzerExtended_android_hardware_nfc_V1_0_INfc : public DriverBase {
  public:
     FuzzerExtended_android_hardware_nfc_V1_0_INfc() : DriverBase(HAL_HIDL), hw_binder_proxy_() {}
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/NfcClientCallback.driver.cpp b/compilation_tools/vtsc/test/golden/DRIVER/NfcClientCallback.driver.cpp
index a574b74..fd737d0 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/NfcClientCallback.driver.cpp
+++ b/compilation_tools/vtsc/test/golden/DRIVER/NfcClientCallback.driver.cpp
@@ -14,6 +14,24 @@
 using namespace android::hardware::nfc::V1_0;
 namespace android {
 namespace vts {
+bool FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback::GetService(bool get_stub, const char* service_name) {
+    static bool initialized = false;
+    if (!initialized) {
+        cout << "[agent:hal] HIDL getService" << endl;
+        if (service_name) {
+          cout << "  - service name: " << service_name << endl;
+        }
+        hw_binder_proxy_ = ::android::hardware::nfc::V1_0::INfcClientCallback::getService(service_name, get_stub);
+        if (hw_binder_proxy_ == nullptr) {
+            cerr << "getService() returned a null pointer." << endl;
+            return false;
+        }
+        cout << "[agent:hal] hw_binder_proxy_ = " << hw_binder_proxy_.get() << endl;
+        initialized = true;
+    }
+    return true;
+}
+
 
 ::android::hardware::Return<void> Vts_android_hardware_nfc_V1_0_INfcClientCallback::sendEvent(
     ::android::hardware::nfc::V1_0::NfcEvent arg0 __attribute__((__unused__)),
@@ -57,5 +75,105 @@
     return result;
 }
 
+bool FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback::Fuzz(
+    FunctionSpecificationMessage* /*func_msg*/,
+    void** /*result*/, const string& /*callback_socket_name*/) {
+    return true;
+}
+bool FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback::GetAttribute(
+    FunctionSpecificationMessage* /*func_msg*/,
+    void** /*result*/) {
+    cerr << "attribute not found" << endl;
+    return false;
+}
+bool FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback::CallFunction(
+    const FunctionSpecificationMessage& func_msg,
+    const string& callback_socket_name __attribute__((__unused__)),
+    FunctionSpecificationMessage* result_msg) {
+    const char* func_name = func_msg.name().c_str();
+    cout << "Function: " << __func__ << " " << func_name << endl;
+    cout << "Callback socket name: " << callback_socket_name << endl;
+    if (hw_binder_proxy_ == nullptr) {
+        cerr << "hw_binder_proxy_ is null. "<< endl;
+        return false;
+    }
+    if (!strcmp(func_name, "sendEvent")) {
+        ::android::hardware::nfc::V1_0::NfcEvent arg0;
+        arg0 = EnumValue__android__hardware__nfc__V1_0__NfcEvent(func_msg.arg(0).scalar_value());
+        ::android::hardware::nfc::V1_0::NfcStatus arg1;
+        arg1 = EnumValue__android__hardware__nfc__V1_0__NfcStatus(func_msg.arg(1).scalar_value());
+        VtsMeasurement vts_measurement;
+        vts_measurement.Start();
+        cout << "Call an API" << endl;
+        cout << "local_device = " << hw_binder_proxy_.get() << endl;
+        hw_binder_proxy_->sendEvent(arg0, arg1);
+        vector<float>* measured = vts_measurement.Stop();
+        cout << "time " << (*measured)[0] << endl;
+        result_msg->set_name("sendEvent");
+        cout << "called" << endl;
+        return true;
+    }
+    if (!strcmp(func_name, "sendData")) {
+         ::android::hardware::hidl_vec<uint8_t> arg0;
+        arg0.resize(func_msg.arg(0).vector_value_size());
+        for (int i = 0; i <func_msg.arg(0).vector_value_size(); i++) {
+            arg0[i] = func_msg.arg(0).vector_value(i).scalar_value().uint8_t();
+        }
+        VtsMeasurement vts_measurement;
+        vts_measurement.Start();
+        cout << "Call an API" << endl;
+        cout << "local_device = " << hw_binder_proxy_.get() << endl;
+        hw_binder_proxy_->sendData(arg0);
+        vector<float>* measured = vts_measurement.Stop();
+        cout << "time " << (*measured)[0] << endl;
+        result_msg->set_name("sendData");
+        cout << "called" << endl;
+        return true;
+    }
+    if (!strcmp(func_name, "notifySyspropsChanged")) {
+        cout << "Call notifySyspropsChanged" << endl;
+        hw_binder_proxy_->notifySyspropsChanged();
+        result_msg->set_name("notifySyspropsChanged");
+        cout << "called" << endl;
+        return true;
+    }
+    return false;
+}
+
+bool FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback::VerifyResults(const FunctionSpecificationMessage& expected_result __attribute__((__unused__)),
+    const FunctionSpecificationMessage& actual_result __attribute__((__unused__))) {
+    if (!strcmp(actual_result.name().c_str(), "sendEvent")) {
+        if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
+        return true;
+    }
+    if (!strcmp(actual_result.name().c_str(), "sendData")) {
+        if (actual_result.return_type_hidl_size() != expected_result.return_type_hidl_size() ) { return false; }
+        return true;
+    }
+    return false;
+}
+
+extern "C" {
+android::vts::DriverBase* vts_func_4_android_hardware_nfc_V1_0_INfcClientCallback_() {
+    return (android::vts::DriverBase*) new android::vts::FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback();
+}
+
+android::vts::DriverBase* vts_func_4_android_hardware_nfc_V1_0_INfcClientCallback_with_arg(uint64_t hw_binder_proxy) {
+    ::android::hardware::nfc::V1_0::INfcClientCallback* arg = nullptr;
+    if (hw_binder_proxy) {
+        arg = reinterpret_cast<::android::hardware::nfc::V1_0::INfcClientCallback*>(hw_binder_proxy);
+    } else {
+        cout << " Creating DriverBase with null proxy." << endl;
+    }
+    android::vts::DriverBase* result =
+        new android::vts::FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback(
+            arg);
+    if (arg != nullptr) {
+        arg->decStrong(arg);
+    }
+    return result;
+}
+
+}
 }  // namespace vts
 }  // namespace android
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/NfcClientCallback.vts.h b/compilation_tools/vtsc/test/golden/DRIVER/NfcClientCallback.vts.h
index b5c70e5..b8457b1 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/NfcClientCallback.vts.h
+++ b/compilation_tools/vtsc/test/golden/DRIVER/NfcClientCallback.vts.h
@@ -47,8 +47,30 @@
 
 sp<::android::hardware::nfc::V1_0::INfcClientCallback> VtsFuzzerCreateVts_android_hardware_nfc_V1_0_INfcClientCallback(const string& callback_socket_name);
 
+class FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback : public DriverBase {
+ public:
+    FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback() : DriverBase(HAL_HIDL), hw_binder_proxy_() {}
+
+    explicit FuzzerExtended_android_hardware_nfc_V1_0_INfcClientCallback(::android::hardware::nfc::V1_0::INfcClientCallback* hw_binder_proxy) : DriverBase(HAL_HIDL), hw_binder_proxy_(hw_binder_proxy) {}
+    uint64_t GetHidlInterfaceProxy() const {
+        return reinterpret_cast<uintptr_t>(hw_binder_proxy_.get());
+    }
+ protected:
+    bool Fuzz(FunctionSpecificationMessage* func_msg, void** result, const string& callback_socket_name);
+    bool CallFunction(const FunctionSpecificationMessage& func_msg, const string& callback_socket_name, FunctionSpecificationMessage* result_msg);
+    bool VerifyResults(const FunctionSpecificationMessage& expected_result, const FunctionSpecificationMessage& actual_result);
+    bool GetAttribute(FunctionSpecificationMessage* func_msg, void** result);
+    bool GetService(bool get_stub, const char* service_name);
+
+ private:
+    sp<::android::hardware::nfc::V1_0::INfcClientCallback> hw_binder_proxy_;
+};
 
 
+extern "C" {
+extern android::vts::DriverBase* vts_func_4_android_hardware_nfc_V1_0_INfcClientCallback_();
+extern android::vts::DriverBase* vts_func_4_android_hardware_nfc_V1_0_INfcClientCallback_with_arg(uint64_t hw_binder_proxy);
+}
 }  // namespace vts
 }  // namespace android
 #endif
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/TestMsgQ.driver.cpp b/compilation_tools/vtsc/test/golden/DRIVER/TestMsgQ.driver.cpp
index fb8f4c8..076e614 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/TestMsgQ.driver.cpp
+++ b/compilation_tools/vtsc/test/golden/DRIVER/TestMsgQ.driver.cpp
@@ -16,11 +16,11 @@
 ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits EnumValue__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const ScalarDataValueMessage& arg) {
     return (::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits) arg.uint32_t();
 }
-::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits Random__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits() {
+uint32_t Random__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits() {
     uint32_t choice = (uint32_t) rand() / 2;
-    if (choice == (uint32_t) 1) return ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits::FMQ_NOT_EMPTY;
-    if (choice == (uint32_t) 2) return ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits::FMQ_NOT_FULL;
-    return ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits::FMQ_NOT_EMPTY;
+    if (choice == (uint32_t) 1) return static_cast<uint32_t>(::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits::FMQ_NOT_EMPTY);
+    if (choice == (uint32_t) 2) return static_cast<uint32_t>(::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits::FMQ_NOT_FULL);
+    return static_cast<uint32_t>(::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits::FMQ_NOT_EMPTY);
 }
 bool Verify__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const VariableSpecificationMessage& expected_result __attribute__((__unused__)), const VariableSpecificationMessage& actual_result __attribute__((__unused__))){
     if (actual_result.scalar_value().uint32_t() != expected_result.scalar_value().uint32_t()) { return false; }
@@ -51,6 +51,140 @@
     return true;
 }
 
+
+::android::hardware::Return<void> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::configureFmqSyncReadWrite(
+    std::function<void(bool arg0,const ::android::hardware::MQDescriptorSync<uint16_t>& arg1)>) {
+    cout << "configureFmqSyncReadWrite called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("configureFmqSyncReadWrite"));
+    callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::configureFmqSyncReadWrite");
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::getFmqUnsyncWrite(
+    bool arg0 __attribute__((__unused__)), std::function<void(bool arg0,const ::android::hardware::MQDescriptorUnsync<uint16_t>& arg1)>) {
+    cout << "getFmqUnsyncWrite called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("getFmqUnsyncWrite"));
+    callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::getFmqUnsyncWrite");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("bool_t");
+    var_msg0->mutable_scalar_value()->set_bool_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<bool> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestWriteFmqSync(
+    int32_t arg0 __attribute__((__unused__))) {
+    cout << "requestWriteFmqSync called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("requestWriteFmqSync"));
+    callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestWriteFmqSync");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("int32_t");
+    var_msg0->mutable_scalar_value()->set_int32_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast<bool>(0);
+}
+
+::android::hardware::Return<bool> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestReadFmqSync(
+    int32_t arg0 __attribute__((__unused__))) {
+    cout << "requestReadFmqSync called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("requestReadFmqSync"));
+    callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestReadFmqSync");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("int32_t");
+    var_msg0->mutable_scalar_value()->set_int32_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast<bool>(0);
+}
+
+::android::hardware::Return<bool> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestWriteFmqUnsync(
+    int32_t arg0 __attribute__((__unused__))) {
+    cout << "requestWriteFmqUnsync called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("requestWriteFmqUnsync"));
+    callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestWriteFmqUnsync");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("int32_t");
+    var_msg0->mutable_scalar_value()->set_int32_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast<bool>(0);
+}
+
+::android::hardware::Return<bool> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestReadFmqUnsync(
+    int32_t arg0 __attribute__((__unused__))) {
+    cout << "requestReadFmqUnsync called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("requestReadFmqUnsync"));
+    callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestReadFmqUnsync");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("int32_t");
+    var_msg0->mutable_scalar_value()->set_int32_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return static_cast<bool>(0);
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingRead(
+    int32_t arg0 __attribute__((__unused__))) {
+    cout << "requestBlockingRead called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("requestBlockingRead"));
+    callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingRead");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("int32_t");
+    var_msg0->mutable_scalar_value()->set_int32_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingReadDefaultEventFlagBits(
+    int32_t arg0 __attribute__((__unused__))) {
+    cout << "requestBlockingReadDefaultEventFlagBits called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("requestBlockingReadDefaultEventFlagBits"));
+    callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingReadDefaultEventFlagBits");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("int32_t");
+    var_msg0->mutable_scalar_value()->set_int32_t(arg0);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+::android::hardware::Return<void> Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingReadRepeat(
+    int32_t arg0 __attribute__((__unused__)),
+    int32_t arg1 __attribute__((__unused__))) {
+    cout << "requestBlockingReadRepeat called" << endl;
+    AndroidSystemCallbackRequestMessage callback_message;
+    callback_message.set_id(GetCallbackID("requestBlockingReadRepeat"));
+    callback_message.set_name("Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ::requestBlockingReadRepeat");
+    VariableSpecificationMessage* var_msg0 = callback_message.add_arg();
+    var_msg0->set_type(TYPE_SCALAR);
+    var_msg0->set_scalar_type("int32_t");
+    var_msg0->mutable_scalar_value()->set_int32_t(arg0);
+    VariableSpecificationMessage* var_msg1 = callback_message.add_arg();
+    var_msg1->set_type(TYPE_SCALAR);
+    var_msg1->set_scalar_type("int32_t");
+    var_msg1->mutable_scalar_value()->set_int32_t(arg1);
+    RpcCallToAgent(callback_message, callback_socket_name_);
+    return ::android::hardware::Void();
+}
+
+sp<::android::hardware::tests::msgq::V1_0::ITestMsgQ> VtsFuzzerCreateVts_android_hardware_tests_msgq_V1_0_ITestMsgQ(const string& callback_socket_name) {
+    static sp<::android::hardware::tests::msgq::V1_0::ITestMsgQ> result;
+    result = new Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ(callback_socket_name);
+    return result;
+}
+
 bool FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ::Fuzz(
     FunctionSpecificationMessage* /*func_msg*/,
     void** /*result*/, const string& /*callback_socket_name*/) {
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/TestMsgQ.vts.h b/compilation_tools/vtsc/test/golden/DRIVER/TestMsgQ.vts.h
index efb3138..6b8cf3c 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/TestMsgQ.vts.h
+++ b/compilation_tools/vtsc/test/golden/DRIVER/TestMsgQ.vts.h
@@ -13,6 +13,8 @@
 #include <driver_base/DriverBase.h>
 #include <driver_base/DriverCallbackBase.h>
 
+#include <VtsDriverCommUtil.h>
+
 #include <android/hardware/tests/msgq/1.0/ITestMsgQ.h>
 #include <hidl/HidlSupport.h>
 #include <android/hidl/base/1.0/types.h>
@@ -22,9 +24,52 @@
 namespace android {
 namespace vts {
 ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits EnumValue__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const ScalarDataValueMessage& arg);
-::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits Random__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits();
+uint32_t Random__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits();
 bool Verify__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(const VariableSpecificationMessage& expected_result, const VariableSpecificationMessage& actual_result);
 void SetResult__android__hardware__tests__msgq__V1_0__ITestMsgQ__EventFlagBits(VariableSpecificationMessage* result_msg, ::android::hardware::tests::msgq::V1_0::ITestMsgQ::EventFlagBits result_value);
+
+class Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ : public ::android::hardware::tests::msgq::V1_0::ITestMsgQ, public DriverCallbackBase {
+ public:
+    Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ(const string& callback_socket_name)
+        : callback_socket_name_(callback_socket_name) {};
+
+    virtual ~Vts_android_hardware_tests_msgq_V1_0_ITestMsgQ() = default;
+
+    ::android::hardware::Return<void> configureFmqSyncReadWrite(
+        std::function<void(bool arg0,const ::android::hardware::MQDescriptorSync<uint16_t>& arg1)>) override;
+
+    ::android::hardware::Return<void> getFmqUnsyncWrite(
+        bool arg0, std::function<void(bool arg0,const ::android::hardware::MQDescriptorUnsync<uint16_t>& arg1)>) override;
+
+    ::android::hardware::Return<bool> requestWriteFmqSync(
+        int32_t arg0) override;
+
+    ::android::hardware::Return<bool> requestReadFmqSync(
+        int32_t arg0) override;
+
+    ::android::hardware::Return<bool> requestWriteFmqUnsync(
+        int32_t arg0) override;
+
+    ::android::hardware::Return<bool> requestReadFmqUnsync(
+        int32_t arg0) override;
+
+    ::android::hardware::Return<void> requestBlockingRead(
+        int32_t arg0) override;
+
+    ::android::hardware::Return<void> requestBlockingReadDefaultEventFlagBits(
+        int32_t arg0) override;
+
+    ::android::hardware::Return<void> requestBlockingReadRepeat(
+        int32_t arg0,
+        int32_t arg1) override;
+
+
+ private:
+    string callback_socket_name_;
+};
+
+sp<::android::hardware::tests::msgq::V1_0::ITestMsgQ> VtsFuzzerCreateVts_android_hardware_tests_msgq_V1_0_ITestMsgQ(const string& callback_socket_name);
+
 class FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ : public DriverBase {
  public:
     FuzzerExtended_android_hardware_tests_msgq_V1_0_ITestMsgQ() : DriverBase(HAL_HIDL), hw_binder_proxy_() {}
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/types.driver.cpp b/compilation_tools/vtsc/test/golden/DRIVER/types.driver.cpp
index 25ec70b..e9d49da 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/types.driver.cpp
+++ b/compilation_tools/vtsc/test/golden/DRIVER/types.driver.cpp
@@ -15,16 +15,16 @@
 ::android::hardware::nfc::V1_0::NfcEvent EnumValue__android__hardware__nfc__V1_0__NfcEvent(const ScalarDataValueMessage& arg) {
     return (::android::hardware::nfc::V1_0::NfcEvent) arg.uint32_t();
 }
-::android::hardware::nfc::V1_0::NfcEvent Random__android__hardware__nfc__V1_0__NfcEvent() {
+uint32_t Random__android__hardware__nfc__V1_0__NfcEvent() {
     uint32_t choice = (uint32_t) rand() / 7;
-    if (choice == (uint32_t) 0) return ::android::hardware::nfc::V1_0::NfcEvent::OPEN_CPLT;
-    if (choice == (uint32_t) 1) return ::android::hardware::nfc::V1_0::NfcEvent::CLOSE_CPLT;
-    if (choice == (uint32_t) 2) return ::android::hardware::nfc::V1_0::NfcEvent::POST_INIT_CPLT;
-    if (choice == (uint32_t) 3) return ::android::hardware::nfc::V1_0::NfcEvent::PRE_DISCOVER_CPLT;
-    if (choice == (uint32_t) 4) return ::android::hardware::nfc::V1_0::NfcEvent::REQUEST_CONTROL;
-    if (choice == (uint32_t) 5) return ::android::hardware::nfc::V1_0::NfcEvent::RELEASE_CONTROL;
-    if (choice == (uint32_t) 6) return ::android::hardware::nfc::V1_0::NfcEvent::ERROR;
-    return ::android::hardware::nfc::V1_0::NfcEvent::OPEN_CPLT;
+    if (choice == (uint32_t) 0) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::OPEN_CPLT);
+    if (choice == (uint32_t) 1) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::CLOSE_CPLT);
+    if (choice == (uint32_t) 2) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::POST_INIT_CPLT);
+    if (choice == (uint32_t) 3) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::PRE_DISCOVER_CPLT);
+    if (choice == (uint32_t) 4) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::REQUEST_CONTROL);
+    if (choice == (uint32_t) 5) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::RELEASE_CONTROL);
+    if (choice == (uint32_t) 6) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::ERROR);
+    return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcEvent::OPEN_CPLT);
 }
 bool Verify__android__hardware__nfc__V1_0__NfcEvent(const VariableSpecificationMessage& expected_result __attribute__((__unused__)), const VariableSpecificationMessage& actual_result __attribute__((__unused__))){
     if (actual_result.scalar_value().uint32_t() != expected_result.scalar_value().uint32_t()) { return false; }
@@ -40,14 +40,14 @@
 ::android::hardware::nfc::V1_0::NfcStatus EnumValue__android__hardware__nfc__V1_0__NfcStatus(const ScalarDataValueMessage& arg) {
     return (::android::hardware::nfc::V1_0::NfcStatus) arg.uint32_t();
 }
-::android::hardware::nfc::V1_0::NfcStatus Random__android__hardware__nfc__V1_0__NfcStatus() {
+uint32_t Random__android__hardware__nfc__V1_0__NfcStatus() {
     uint32_t choice = (uint32_t) rand() / 5;
-    if (choice == (uint32_t) 0) return ::android::hardware::nfc::V1_0::NfcStatus::OK;
-    if (choice == (uint32_t) 1) return ::android::hardware::nfc::V1_0::NfcStatus::FAILED;
-    if (choice == (uint32_t) 2) return ::android::hardware::nfc::V1_0::NfcStatus::ERR_TRANSPORT;
-    if (choice == (uint32_t) 3) return ::android::hardware::nfc::V1_0::NfcStatus::ERR_CMD_TIMEOUT;
-    if (choice == (uint32_t) 4) return ::android::hardware::nfc::V1_0::NfcStatus::REFUSED;
-    return ::android::hardware::nfc::V1_0::NfcStatus::OK;
+    if (choice == (uint32_t) 0) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::OK);
+    if (choice == (uint32_t) 1) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::FAILED);
+    if (choice == (uint32_t) 2) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::ERR_TRANSPORT);
+    if (choice == (uint32_t) 3) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::ERR_CMD_TIMEOUT);
+    if (choice == (uint32_t) 4) return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::REFUSED);
+    return static_cast<uint32_t>(::android::hardware::nfc::V1_0::NfcStatus::OK);
 }
 bool Verify__android__hardware__nfc__V1_0__NfcStatus(const VariableSpecificationMessage& expected_result __attribute__((__unused__)), const VariableSpecificationMessage& actual_result __attribute__((__unused__))){
     if (actual_result.scalar_value().uint32_t() != expected_result.scalar_value().uint32_t()) { return false; }
diff --git a/compilation_tools/vtsc/test/golden/DRIVER/types.vts.h b/compilation_tools/vtsc/test/golden/DRIVER/types.vts.h
index 2e6d1e7..18593c5 100644
--- a/compilation_tools/vtsc/test/golden/DRIVER/types.vts.h
+++ b/compilation_tools/vtsc/test/golden/DRIVER/types.vts.h
@@ -13,6 +13,8 @@
 #include <driver_base/DriverBase.h>
 #include <driver_base/DriverCallbackBase.h>
 
+#include <VtsDriverCommUtil.h>
+
 #include <android/hardware/nfc/1.0/types.h>
 #include <hidl/HidlSupport.h>
 
@@ -21,11 +23,11 @@
 namespace android {
 namespace vts {
 ::android::hardware::nfc::V1_0::NfcEvent EnumValue__android__hardware__nfc__V1_0__NfcEvent(const ScalarDataValueMessage& arg);
-::android::hardware::nfc::V1_0::NfcEvent Random__android__hardware__nfc__V1_0__NfcEvent();
+uint32_t Random__android__hardware__nfc__V1_0__NfcEvent();
 bool Verify__android__hardware__nfc__V1_0__NfcEvent(const VariableSpecificationMessage& expected_result, const VariableSpecificationMessage& actual_result);
 void SetResult__android__hardware__nfc__V1_0__NfcEvent(VariableSpecificationMessage* result_msg, ::android::hardware::nfc::V1_0::NfcEvent result_value);
 ::android::hardware::nfc::V1_0::NfcStatus EnumValue__android__hardware__nfc__V1_0__NfcStatus(const ScalarDataValueMessage& arg);
-::android::hardware::nfc::V1_0::NfcStatus Random__android__hardware__nfc__V1_0__NfcStatus();
+uint32_t Random__android__hardware__nfc__V1_0__NfcStatus();
 bool Verify__android__hardware__nfc__V1_0__NfcStatus(const VariableSpecificationMessage& expected_result, const VariableSpecificationMessage& actual_result);
 void SetResult__android__hardware__nfc__V1_0__NfcStatus(VariableSpecificationMessage* result_msg, ::android::hardware::nfc::V1_0::NfcStatus result_value);
 
diff --git a/drivers/hal/common/binder/VtsFuzzerBinderService.cpp b/drivers/hal/common/binder/VtsFuzzerBinderService.cpp
index 449ad5d..283ea8d 100644
--- a/drivers/hal/common/binder/VtsFuzzerBinderService.cpp
+++ b/drivers/hal/common/binder/VtsFuzzerBinderService.cpp
@@ -109,7 +109,7 @@
   return res;
 }
 
-const char* BpVtsFuzzer::Call(const string& call_payload) {
+string BpVtsFuzzer::Call(const string& call_payload) {
   Parcel data, reply;
   data.writeInterfaceToken(IVtsFuzzer::getInterfaceDescriptor());
   data.writeCString(call_payload.c_str());
@@ -129,7 +129,7 @@
   }
 
   printf("len(reply) = %zu\n", strlen(res));
-  return res;
+  return {res};
 }
 
 const char* BpVtsFuzzer::GetFunctions() {
diff --git a/drivers/hal/common/include/binder/VtsFuzzerBinderService.h b/drivers/hal/common/include/binder/VtsFuzzerBinderService.h
index 3d0cb88..ad1c7b3 100644
--- a/drivers/hal/common/include/binder/VtsFuzzerBinderService.h
+++ b/drivers/hal/common/include/binder/VtsFuzzerBinderService.h
@@ -57,7 +57,7 @@
   virtual int32_t Status(int32_t type) = 0;
 
   // Requests to call the specified function using the provided arguments.
-  virtual const char* Call(const string& call_payload) = 0;
+  virtual string Call(const string& call_payload) = 0;
 
   virtual const char* GetFunctions() = 0;
 
@@ -73,7 +73,7 @@
   int32_t LoadHal(const string& path, int target_class, int target_type,
                   float target_version, const string& module_name);
   int32_t Status(int32_t type);
-  const char* Call(const string& call_payload);
+  string Call(const string& call_payload);
   const char* GetFunctions();
 };
 
diff --git a/drivers/hal/server/BinderServer.cpp b/drivers/hal/server/BinderServer.cpp
index 2b209e1..629d1fa 100644
--- a/drivers/hal/server/BinderServer.cpp
+++ b/drivers/hal/server/BinderServer.cpp
@@ -100,9 +100,9 @@
     }
     case CALL: {
       const char* arg = data.readCString();
-      const char* result = Call(arg);
+      const string& result = Call(arg);
 
-      ALOGD("BnVtsFuzzer::%s call(%s) = %i", __FUNCTION__, arg, result);
+      ALOGD("BnVtsFuzzer::%s call(%s) = %i", __FUNCTION__, arg, result.c_str());
       if (reply == NULL) {
         ALOGE("reply == NULL");
         abort();
@@ -110,7 +110,7 @@
 #ifdef VTS_FUZZER_BINDER_DEBUG
       alog << reply << endl;
 #endif
-      reply->writeCString(result);
+      reply->writeCString(result.c_str());
       break;
     }
     case GET_FUNCTIONS: {
@@ -159,12 +159,11 @@
     return 0;
   }
 
-  const char* Call(const string& arg) {
+  string Call(const string& arg) {
     printf("VtsFuzzerServer::Call(%s)\n", arg.c_str());
     FunctionCallMessage* call_msg = new FunctionCallMessage();
     google::protobuf::TextFormat::MergeFromString(arg, call_msg);
-    const string& result = driver_manager_->CallFunction(call_msg);
-    return result.c_str();
+    return driver_manager_->CallFunction(call_msg);
   }
 
   const char* GetFunctions() {
diff --git a/drivers/hal/server/SocketServer.cpp b/drivers/hal/server/SocketServer.cpp
index 7d9e8cc..8f7ba20 100644
--- a/drivers/hal/server/SocketServer.cpp
+++ b/drivers/hal/server/SocketServer.cpp
@@ -78,7 +78,7 @@
   return 0;
 }
 
-const char* VtsDriverHalSocketServer::ReadSpecification(
+string VtsDriverHalSocketServer::ReadSpecification(
     const string& name, int target_class, int target_type, float target_version,
     const string& target_package) {
   printf("VtsHalDriverServer::ReadSpecification(%s)\n", name.c_str());
@@ -86,28 +86,27 @@
   driver_manager_->FindComponentSpecification(target_class, target_type,
                                               target_version, "",
                                               target_package, name, &msg);
-  string* result = new string();
-  google::protobuf::TextFormat::PrintToString(msg, result);
-  return result->c_str();
+  string result;
+  google::protobuf::TextFormat::PrintToString(msg, &result);
+  return result;
 }
 
-const char* VtsDriverHalSocketServer::Call(const string& arg) {
+string VtsDriverHalSocketServer::Call(const string& arg) {
   cout << "VtsHalDriverServer::Call(" << arg << ")" << endl;
   FunctionCallMessage* call_msg = new FunctionCallMessage();
   google::protobuf::TextFormat::MergeFromString(arg, call_msg);
   const string& result = driver_manager_->CallFunction(call_msg);
   cout << __func__ << ":" << __LINE__ << " result: " << result.c_str() << endl;
-  return result.c_str();
+  return result;
 }
 
-const char* VtsDriverHalSocketServer::GetAttribute(const string& arg) {
+string VtsDriverHalSocketServer::GetAttribute(const string& arg) {
   cout << "VtsHalDriverServer::GetAttribute(" << arg << ")" << endl;
-  // printf("%s(%s)\n", __func__, arg.c_str());
   FunctionCallMessage* call_msg = new FunctionCallMessage();
   google::protobuf::TextFormat::MergeFromString(arg, call_msg);
   const string& result = driver_manager_->GetAttribute(call_msg);
-  cout << "VtsHalDriverServer::GetAttribute doen" << endl;
-  return result.c_str();
+  cout << "VtsHalDriverServer::GetAttribute done" << endl;
+  return result;
 }
 
 string VtsDriverHalSocketServer::ListFunctions() const {
@@ -176,7 +175,7 @@
       if (command_message.has_driver_caller_uid()) {
         setuid(atoi(command_message.driver_caller_uid().c_str()));
       }
-      const char* result = Call(command_message.arg());
+      const string& result = Call(command_message.arg());
       VtsDriverControlResponseMessage response_message;
       response_message.set_response_code(VTS_DRIVER_RESPONSE_SUCCESS);
       response_message.set_return_message(result);
@@ -184,7 +183,7 @@
       break;
     }
     case VTS_DRIVER_COMMAND_READ_SPECIFICATION: {
-      const char* result = ReadSpecification(
+      const string& result = ReadSpecification(
           command_message.module_name(), command_message.target_class(),
           command_message.target_type(), command_message.target_version(),
           command_message.target_package());
@@ -195,7 +194,7 @@
       break;
     }
     case GET_ATTRIBUTE: {
-      const char* result = GetAttribute(command_message.arg());
+      const string& result = GetAttribute(command_message.arg());
       VtsDriverControlResponseMessage response_message;
       response_message.set_response_code(VTS_DRIVER_RESPONSE_SUCCESS);
       response_message.set_return_message(result);
diff --git a/drivers/hal/server/SocketServer.h b/drivers/hal/server/SocketServer.h
index 676a8f9..9e20a71 100644
--- a/drivers/hal/server/SocketServer.h
+++ b/drivers/hal/server/SocketServer.h
@@ -48,11 +48,11 @@
                   const string& hw_binder_service_name,
                   const string& module_name);
   int32_t Status(int32_t type);
-  const char* ReadSpecification(const string& name, int target_class,
-                                int target_type, float target_version,
-                                const string& target_package);
-  const char* Call(const string& arg);
-  const char* GetAttribute(const string& arg);
+  string ReadSpecification(const string& name, int target_class,
+                           int target_type, float target_version,
+                           const string& target_package);
+  string Call(const string& arg);
+  string GetAttribute(const string& arg);
   string ListFunctions() const;
 
  private:
diff --git a/harnesses/tradefed/src/com/android/compatibility/common/tradefed/result/VtsResultReporter.java b/harnesses/tradefed/src/com/android/compatibility/common/tradefed/result/VtsResultReporter.java
new file mode 100644
index 0000000..d9c7ddd
--- /dev/null
+++ b/harnesses/tradefed/src/com/android/compatibility/common/tradefed/result/VtsResultReporter.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+package com.android.compatibility.common.tradefed.result;
+
+import com.android.tradefed.log.LogUtil.CLog;
+import java.util.Map;
+
+/** Override the result reporter to specify vendor device information in the VTS report. */
+public class VtsResultReporter extends ResultReporter {
+    private static final String BUILD_VENDOR_FINGERPRINT = "build_vendor_fingerprint";
+    private static final String BUILD_VENDOR_MANUFACTURER = "build_vendor_manufacturer";
+    private static final String BUILD_VENDOR_MODEL = "build_vendor_model";
+
+    /** Determine if the property is empty or not. */
+    private static boolean isEmptyProperty(String property) {
+        return (property == null || property.trim().isEmpty() || property.equals("null"));
+    }
+
+    /** Override the vendor fingerprint and manufacturer in the report. */
+    @Override
+    protected void addDeviceBuildInfoToResult() {
+        super.addDeviceBuildInfoToResult();
+        Map<String, String> props = mapBuildInfo();
+        String vendorFingerprint = props.get(BUILD_VENDOR_FINGERPRINT);
+        String vendorManufacturer = props.get(BUILD_VENDOR_MANUFACTURER);
+        String vendorModel = props.get(BUILD_VENDOR_MODEL);
+        if (!isEmptyProperty(vendorFingerprint) && !isEmptyProperty(vendorManufacturer)
+                && !isEmptyProperty(vendorModel)) {
+            addDeviceBuildInfoToResult(vendorFingerprint, vendorManufacturer, vendorModel);
+        } else {
+            CLog.w(String.format(
+                    "Vendor build information missing. Fingerprint: '%s', manufacturer: '%s', model: '%s'",
+                    vendorFingerprint, vendorManufacturer, vendorModel));
+        }
+    }
+}
diff --git a/harnesses/tradefed/src/com/android/compatibility/common/util/ResultHandler.java b/harnesses/tradefed/src/com/android/compatibility/common/util/ResultHandler.java
deleted file mode 100644
index 75dccc5..0000000
--- a/harnesses/tradefed/src/com/android/compatibility/common/util/ResultHandler.java
+++ /dev/null
@@ -1,576 +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.
- */
-package com.android.compatibility.common.util;
-
-import com.android.compatibility.common.util.ChecksumReporter.ChecksumValidationException;
-
-import com.google.common.base.Strings;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlPullParserFactory;
-import org.xmlpull.v1.XmlSerializer;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-/**
- * Handles conversion of results to/from files.
- */
-public class ResultHandler {
-
-    private static final String ENCODING = "UTF-8";
-    private static final String TYPE = "org.kxml2.io.KXmlParser,org.kxml2.io.KXmlSerializer";
-    private static final String NS = null;
-    private static final String RESULT_FILE_VERSION = "5.0";
-    public static final String TEST_RESULT_FILE_NAME = "test_result.xml";
-    public static final String FAILURE_REPORT_NAME = "test_result_failures.html";
-    private static final String FAILURE_XSL_FILE_NAME = "vts_failures.xsl";
-
-    public static final String[] RESULT_RESOURCES = {
-        "vts_result.css",
-        "vts_result.xsd",
-        "vts_result.xsl",
-        "logo.png"
-    };
-
-    // XML constants
-    private static final String ABI_ATTR = "abi";
-    private static final String BUGREPORT_TAG = "BugReport";
-    private static final String BUILD_FINGERPRINT = "build_fingerprint";
-    private static final String BUILD_ID = "build_id";
-    private static final String BUILD_PRODUCT = "build_product";
-    private static final String BUILD_TAG = "Build";
-    private static final String CASE_TAG = "TestCase";
-    private static final String COMMAND_LINE_ARGS = "command_line_args";
-    private static final String DEVICES_ATTR = "devices";
-    private static final String DONE_ATTR = "done";
-    private static final String END_DISPLAY_TIME_ATTR = "end_display";
-    private static final String END_TIME_ATTR = "end";
-    private static final String FAILED_ATTR = "failed";
-    private static final String FAILURE_TAG = "Failure";
-    private static final String HOST_NAME_ATTR = "host_name";
-    private static final String JAVA_VENDOR_ATTR = "java_vendor";
-    private static final String JAVA_VERSION_ATTR = "java_version";
-    private static final String LOGCAT_TAG = "Logcat";
-    private static final String LOG_URL_ATTR = "log_url";
-    private static final String MESSAGE_ATTR = "message";
-    private static final String MODULE_TAG = "Module";
-    private static final String MODULES_DONE_ATTR = "modules_done";
-    private static final String MODULES_TOTAL_ATTR = "modules_total";
-    private static final String NAME_ATTR = "name";
-    private static final String OS_ARCH_ATTR = "os_arch";
-    private static final String OS_NAME_ATTR = "os_name";
-    private static final String OS_VERSION_ATTR = "os_version";
-    private static final String PASS_ATTR = "pass";
-    private static final String REPORT_VERSION_ATTR = "report_version";
-    private static final String REFERENCE_URL_ATTR = "reference_url";
-    private static final String RESULT_ATTR = "result";
-    private static final String RESULT_TAG = "Result";
-    private static final String RUNTIME_ATTR = "runtime";
-    private static final String SCREENSHOT_TAG = "Screenshot";
-    private static final String SKIPPED_ATTR = "skipped";
-    private static final String STACK_TAG = "StackTrace";
-    private static final String START_DISPLAY_TIME_ATTR = "start_display";
-    private static final String START_TIME_ATTR = "start";
-    private static final String SUITE_NAME_ATTR = "suite_name";
-    private static final String SUITE_PLAN_ATTR = "suite_plan";
-    private static final String SUITE_VERSION_ATTR = "suite_version";
-    private static final String SUITE_BUILD_ATTR = "suite_build_number";
-    private static final String SUMMARY_TAG = "Summary";
-    private static final String TEST_TAG = "Test";
-
-
-    /**
-     * Returns IInvocationResults that can be queried for general reporting information, but that
-     * do not store underlying module data. Useful for summarizing invocation history.
-     * @param resultsDir
-     * @param useChecksum
-     */
-    public static List<IInvocationResult> getLightResults(File resultsDir) {
-        List<IInvocationResult> results = new ArrayList<>();
-        List<File> files = getResultDirectories(resultsDir);
-        for (File resultDir : files) {
-            IInvocationResult result = getResultFromDir(resultDir, false);
-            if (result != null) {
-                results.add(new LightInvocationResult(result));
-                result = null; // ensure all references are removed to free memory
-            }
-        }
-        // Sort the table entries on each entry's timestamp.
-        Collections.sort(results,  (result1, result2) -> Long.compare(
-                result1.getStartTime(),
-                result2.getStartTime()));
-        return results;
-    }
-
-    /**
-     * @param resultDir
-     * @return an IInvocationResult for this result, or null upon error
-     */
-    public static IInvocationResult getResultFromDir(File resultDir) {
-        return getResultFromDir(resultDir, false);
-    }
-
-    /**
-     * @param resultDir
-     * @param useChecksum
-     * @return an IInvocationResult for this result, or null upon error
-     */
-    public static IInvocationResult getResultFromDir(File resultDir, Boolean useChecksum) {
-        try {
-            File resultFile = new File(resultDir, TEST_RESULT_FILE_NAME);
-            if (!resultFile.exists()) {
-                return null;
-            }
-            Boolean invocationUseChecksum = useChecksum;
-            IInvocationResult invocation = new InvocationResult();
-            invocation.setRetryDirectory(resultDir);
-            ChecksumReporter checksumReporter = null;
-            if (invocationUseChecksum) {
-                try {
-                    checksumReporter = ChecksumReporter.load(resultDir);
-                    invocation.setRetryChecksumStatus(RetryChecksumStatus.RetryWithChecksum);
-                } catch (ChecksumValidationException e) {
-                    // Unable to read checksum form previous execution
-                    invocation.setRetryChecksumStatus(RetryChecksumStatus.RetryWithoutChecksum);
-                    invocationUseChecksum = false;
-                }
-            }
-            XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
-            XmlPullParser parser = factory.newPullParser();
-            parser.setInput(new FileReader(resultFile));
-
-            parser.nextTag();
-            parser.require(XmlPullParser.START_TAG, NS, RESULT_TAG);
-            invocation.setStartTime(Long.valueOf(
-                    parser.getAttributeValue(NS, START_TIME_ATTR)));
-            invocation.setTestPlan(parser.getAttributeValue(NS, SUITE_PLAN_ATTR));
-            invocation.setCommandLineArgs(parser.getAttributeValue(NS, COMMAND_LINE_ARGS));
-            String deviceList = parser.getAttributeValue(NS, DEVICES_ATTR);
-            for (String device : deviceList.split(",")) {
-                invocation.addDeviceSerial(device);
-            }
-
-            parser.nextTag();
-            parser.require(XmlPullParser.START_TAG, NS, BUILD_TAG);
-            invocation.addInvocationInfo(BUILD_ID, parser.getAttributeValue(NS, BUILD_ID));
-            invocation.addInvocationInfo(BUILD_PRODUCT, parser.getAttributeValue(NS,
-                    BUILD_PRODUCT));
-            invocation.setBuildFingerprint(parser.getAttributeValue(NS, BUILD_FINGERPRINT));
-
-            // TODO(stuartscott): may want to reload these incase the retry was done with
-            // --skip-device-info flag
-            parser.nextTag();
-            parser.require(XmlPullParser.END_TAG, NS, BUILD_TAG);
-            parser.nextTag();
-            parser.require(XmlPullParser.START_TAG, NS, SUMMARY_TAG);
-            parser.nextTag();
-            parser.require(XmlPullParser.END_TAG, NS, SUMMARY_TAG);
-            while (parser.nextTag() == XmlPullParser.START_TAG) {
-                parser.require(XmlPullParser.START_TAG, NS, MODULE_TAG);
-                String name = parser.getAttributeValue(NS, NAME_ATTR);
-                String abi = parser.getAttributeValue(NS, ABI_ATTR);
-                String moduleId = AbiUtils.createId(abi, name);
-                boolean done = Boolean.parseBoolean(parser.getAttributeValue(NS, DONE_ATTR));
-                IModuleResult module = invocation.getOrCreateModule(moduleId);
-                module.initializeDone(done);
-                long runtime = Long.parseLong(parser.getAttributeValue(NS, RUNTIME_ATTR));
-                module.addRuntime(runtime);
-                while (parser.nextTag() == XmlPullParser.START_TAG) {
-                    parser.require(XmlPullParser.START_TAG, NS, CASE_TAG);
-                    String caseName = parser.getAttributeValue(NS, NAME_ATTR);
-                    ICaseResult testCase = module.getOrCreateResult(caseName);
-                    while (parser.nextTag() == XmlPullParser.START_TAG) {
-                        parser.require(XmlPullParser.START_TAG, NS, TEST_TAG);
-                        String testName = parser.getAttributeValue(NS, NAME_ATTR);
-                        ITestResult test = testCase.getOrCreateResult(testName);
-                        String result = parser.getAttributeValue(NS, RESULT_ATTR);
-                        String skipped = parser.getAttributeValue(NS, SKIPPED_ATTR);
-                        if (skipped != null && Boolean.parseBoolean(skipped)) {
-                            // mark test passed and skipped
-                            test.skipped();
-                        } else {
-                            // only apply result status directly if test was not skipped
-                            test.setResultStatus(TestStatus.getStatus(result));
-                        }
-                        test.setRetry(true);
-                        while (parser.nextTag() == XmlPullParser.START_TAG) {
-                            if (parser.getName().equals(FAILURE_TAG)) {
-                                test.setMessage(parser.getAttributeValue(NS, MESSAGE_ATTR));
-                                if (parser.nextTag() == XmlPullParser.START_TAG) {
-                                    parser.require(XmlPullParser.START_TAG, NS, STACK_TAG);
-                                    test.setStackTrace(parser.nextText());
-                                    parser.require(XmlPullParser.END_TAG, NS, STACK_TAG);
-                                    parser.nextTag();
-                                }
-                                parser.require(XmlPullParser.END_TAG, NS, FAILURE_TAG);
-                            } else if (parser.getName().equals(BUGREPORT_TAG)) {
-                                test.setBugReport(parser.nextText());
-                                parser.require(XmlPullParser.END_TAG, NS, BUGREPORT_TAG);
-                            } else if (parser.getName().equals(LOGCAT_TAG)) {
-                                test.setLog(parser.nextText());
-                                parser.require(XmlPullParser.END_TAG, NS, LOGCAT_TAG);
-                            } else if (parser.getName().equals(SCREENSHOT_TAG)) {
-                                test.setScreenshot(parser.nextText());
-                                parser.require(XmlPullParser.END_TAG, NS, SCREENSHOT_TAG);
-                            } else {
-                                test.setReportLog(ReportLog.parse(parser));
-                            }
-                        }
-                        parser.require(XmlPullParser.END_TAG, NS, TEST_TAG);
-                        Boolean checksumMismatch = invocationUseChecksum
-                            && !checksumReporter.containsTestResult(
-                                test, module, invocation.getBuildFingerprint());
-                        if (checksumMismatch) {
-                            test.removeResult();
-                        }
-                    }
-                    parser.require(XmlPullParser.END_TAG, NS, CASE_TAG);
-                }
-                parser.require(XmlPullParser.END_TAG, NS, MODULE_TAG);
-                Boolean checksumMismatch = invocationUseChecksum
-                    && !checksumReporter.containsModuleResult(
-                            module, invocation.getBuildFingerprint());
-                if (checksumMismatch) {
-                    module.initializeDone(false);
-                }
-            }
-            parser.require(XmlPullParser.END_TAG, NS, RESULT_TAG);
-            return invocation;
-        } catch (XmlPullParserException | IOException e) {
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    /**
-     * @param result
-     * @param resultDir
-     * @param startTime
-     * @param referenceUrl A nullable string that can contain a URL to a related data
-     * @param logUrl A nullable string that can contain a URL to related log files
-     * @param commandLineArgs A string containing the arguments to the run command
-     * @return The result file created.
-     * @throws IOException
-     * @throws XmlPullParserException
-     */
-    public static File writeResults(String suiteName, String suiteVersion, String suitePlan,
-            String suiteBuild, IInvocationResult result, File resultDir,
-            long startTime, long endTime, String referenceUrl, String logUrl,
-            String commandLineArgs)
-                    throws IOException, XmlPullParserException {
-        int passed = result.countResults(TestStatus.PASS);
-        int failed = result.countResults(TestStatus.FAIL);
-        File resultFile = new File(resultDir, TEST_RESULT_FILE_NAME);
-        OutputStream stream = new FileOutputStream(resultFile);
-        XmlSerializer serializer = XmlPullParserFactory.newInstance(TYPE, null).newSerializer();
-        serializer.setOutput(stream, ENCODING);
-        serializer.startDocument(ENCODING, false);
-        serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
-        serializer.processingInstruction(
-                "xml-stylesheet type=\"text/xsl\" href=\"vts_result.xsl\"");
-        serializer.startTag(NS, RESULT_TAG);
-        serializer.attribute(NS, START_TIME_ATTR, String.valueOf(startTime));
-        serializer.attribute(NS, END_TIME_ATTR, String.valueOf(endTime));
-        serializer.attribute(NS, START_DISPLAY_TIME_ATTR, toReadableDateString(startTime));
-        serializer.attribute(NS, END_DISPLAY_TIME_ATTR, toReadableDateString(endTime));
-
-        serializer.attribute(NS, SUITE_NAME_ATTR, suiteName);
-        serializer.attribute(NS, SUITE_VERSION_ATTR, suiteVersion);
-        serializer.attribute(NS, SUITE_PLAN_ATTR, suitePlan);
-        serializer.attribute(NS, SUITE_BUILD_ATTR, suiteBuild);
-        serializer.attribute(NS, REPORT_VERSION_ATTR, RESULT_FILE_VERSION);
-        serializer.attribute(NS, COMMAND_LINE_ARGS, nullToEmpty(commandLineArgs));
-
-        if (referenceUrl != null) {
-            serializer.attribute(NS, REFERENCE_URL_ATTR, referenceUrl);
-        }
-
-        if (logUrl != null) {
-            serializer.attribute(NS, LOG_URL_ATTR, logUrl);
-        }
-
-        // Device Info
-        Set<String> devices = result.getDeviceSerials();
-        StringBuilder deviceList = new StringBuilder();
-        boolean first = true;
-        for (String device : devices) {
-            if (first) {
-                first = false;
-            } else {
-                deviceList.append(",");
-            }
-            deviceList.append(device);
-        }
-        serializer.attribute(NS, DEVICES_ATTR, deviceList.toString());
-
-        // Host Info
-        String hostName = "";
-        try {
-            hostName = InetAddress.getLocalHost().getHostName();
-        } catch (UnknownHostException ignored) {}
-        serializer.attribute(NS, HOST_NAME_ATTR, hostName);
-        serializer.attribute(NS, OS_NAME_ATTR, System.getProperty("os.name"));
-        serializer.attribute(NS, OS_VERSION_ATTR, System.getProperty("os.version"));
-        serializer.attribute(NS, OS_ARCH_ATTR, System.getProperty("os.arch"));
-        serializer.attribute(NS, JAVA_VENDOR_ATTR, System.getProperty("java.vendor"));
-        serializer.attribute(NS, JAVA_VERSION_ATTR, System.getProperty("java.version"));
-
-        // Build Info
-        serializer.startTag(NS, BUILD_TAG);
-        for (Entry<String, String> entry : result.getInvocationInfo().entrySet()) {
-            serializer.attribute(NS, entry.getKey(), entry.getValue());
-            if (Strings.isNullOrEmpty(result.getBuildFingerprint()) &&
-                entry.getKey().equals(BUILD_FINGERPRINT)) {
-                result.setBuildFingerprint(entry.getValue());
-            }
-        }
-        serializer.endTag(NS, BUILD_TAG);
-
-        // Summary
-        serializer.startTag(NS, SUMMARY_TAG);
-        serializer.attribute(NS, PASS_ATTR, Integer.toString(passed));
-        serializer.attribute(NS, FAILED_ATTR, Integer.toString(failed));
-        serializer.attribute(NS, MODULES_DONE_ATTR,
-                Integer.toString(result.getModuleCompleteCount()));
-        serializer.attribute(NS, MODULES_TOTAL_ATTR,
-                Integer.toString(result.getModules().size()));
-        serializer.endTag(NS, SUMMARY_TAG);
-
-        // Results
-        for (IModuleResult module : result.getModules()) {
-            serializer.startTag(NS, MODULE_TAG);
-            serializer.attribute(NS, NAME_ATTR, module.getName());
-            serializer.attribute(NS, ABI_ATTR, module.getAbi());
-            serializer.attribute(NS, RUNTIME_ATTR, String.valueOf(module.getRuntime()));
-            serializer.attribute(NS, DONE_ATTR, Boolean.toString(module.isDone()));
-            serializer.attribute(NS, PASS_ATTR,
-                    Integer.toString(module.countResults(TestStatus.PASS)));
-            for (ICaseResult cr : module.getResults()) {
-                serializer.startTag(NS, CASE_TAG);
-                serializer.attribute(NS, NAME_ATTR, cr.getName());
-                for (ITestResult r : cr.getResults()) {
-                    TestStatus status = r.getResultStatus();
-                    if (status == null) {
-                        continue; // test was not executed, don't report
-                    }
-                    serializer.startTag(NS, TEST_TAG);
-                    serializer.attribute(NS, RESULT_ATTR, status.getValue());
-                    serializer.attribute(NS, NAME_ATTR, r.getName());
-                    if (r.isSkipped()) {
-                        serializer.attribute(NS, SKIPPED_ATTR, Boolean.toString(true));
-                    }
-                    String message = r.getMessage();
-                    if (message != null) {
-                        serializer.startTag(NS, FAILURE_TAG);
-                        serializer.attribute(NS, MESSAGE_ATTR, message);
-                        String stackTrace = r.getStackTrace();
-                        if (stackTrace != null) {
-                            serializer.startTag(NS, STACK_TAG);
-                            serializer.text(stackTrace);
-                            serializer.endTag(NS, STACK_TAG);
-                        }
-                        serializer.endTag(NS, FAILURE_TAG);
-                    }
-                    String bugreport = r.getBugReport();
-                    if (bugreport != null) {
-                        serializer.startTag(NS, BUGREPORT_TAG);
-                        serializer.text(bugreport);
-                        serializer.endTag(NS, BUGREPORT_TAG);
-                    }
-                    String logcat = r.getLog();
-                    if (logcat != null) {
-                        serializer.startTag(NS, LOGCAT_TAG);
-                        serializer.text(logcat);
-                        serializer.endTag(NS, LOGCAT_TAG);
-                    }
-                    String screenshot = r.getScreenshot();
-                    if (screenshot != null) {
-                        serializer.startTag(NS, SCREENSHOT_TAG);
-                        serializer.text(screenshot);
-                        serializer.endTag(NS, SCREENSHOT_TAG);
-                    }
-                    ReportLog report = r.getReportLog();
-                    if (report != null) {
-                        ReportLog.serialize(serializer, report);
-                    }
-                    serializer.endTag(NS, TEST_TAG);
-                }
-                serializer.endTag(NS, CASE_TAG);
-            }
-            serializer.endTag(NS, MODULE_TAG);
-        }
-        serializer.endDocument();
-        createChecksum(resultDir, result);
-        return resultFile;
-    }
-
-    /**
-     * Generate html report listing an failed tests
-     */
-    public static File createFailureReport(File inputXml) {
-        File failureReport = new File(inputXml.getParentFile(), FAILURE_REPORT_NAME);
-        try (InputStream xslStream = ResultHandler.class.getResourceAsStream(
-                String.format("/report/%s", FAILURE_XSL_FILE_NAME));
-             OutputStream outputStream = new FileOutputStream(failureReport)) {
-
-            Transformer transformer = TransformerFactory.newInstance().newTransformer(
-                    new StreamSource(xslStream));
-            transformer.transform(new StreamSource(inputXml), new StreamResult(outputStream));
-        } catch (IOException | TransformerException ignored) { }
-        return failureReport;
-    }
-
-    private static void createChecksum(File resultDir, IInvocationResult invocationResult) {
-        RetryChecksumStatus retryStatus = invocationResult.getRetryChecksumStatus();
-        switch (retryStatus) {
-            case NotRetry: case RetryWithChecksum:
-                // Do not disrupt the process if there is a problem generating checksum.
-                ChecksumReporter.tryCreateChecksum(resultDir, invocationResult);
-                break;
-            case RetryWithoutChecksum:
-                // If the previous run has an invalid checksum file,
-                // copy it into current results folder for future troubleshooting
-                File retryDirectory = invocationResult.getRetryDirectory();
-                Path retryChecksum = FileSystems.getDefault().getPath(
-                        retryDirectory.getAbsolutePath(), ChecksumReporter.NAME);
-                if (!retryChecksum.toFile().exists()) {
-                    // if no checksum file, check for a copy from a previous retry
-                    retryChecksum = FileSystems.getDefault().getPath(
-                            retryDirectory.getAbsolutePath(), ChecksumReporter.PREV_NAME);
-                }
-
-                if (retryChecksum.toFile().exists()) {
-                    File checksumCopy = new File(resultDir, ChecksumReporter.PREV_NAME);
-                    try (FileOutputStream stream = new FileOutputStream(checksumCopy)) {
-                        Files.copy(retryChecksum, stream);
-                    } catch (IOException e) {
-                        // Do not disrupt the process if there is a problem copying checksum
-                    }
-                }
-        }
-    }
-
-
-    /**
-     * Find the IInvocationResult for the given sessionId.
-     */
-    public static IInvocationResult findResult(File resultsDir, Integer sessionId)
-            throws FileNotFoundException {
-        return findResult(resultsDir, sessionId, true);
-    }
-
-    /**
-     * Find the IInvocationResult for the given sessionId.
-     */
-    private static IInvocationResult findResult(
-            File resultsDir, Integer sessionId, Boolean useChecksum) throws FileNotFoundException {
-        if (sessionId < 0) {
-            throw new IllegalArgumentException(
-                String.format("Invalid session id [%d] ", sessionId));
-        }
-        File resultDir = getResultDirectory(resultsDir, sessionId);
-        IInvocationResult result = getResultFromDir(resultDir, useChecksum);
-        if (result == null) {
-            throw new RuntimeException(String.format("Could not find session [%d]", sessionId));
-        }
-        return result;
-    }
-
-    /**
-     * Get the result directory for the given sessionId.
-     */
-    public static File getResultDirectory(File resultsDir, Integer sessionId) {
-        if (sessionId < 0) {
-            throw new IllegalArgumentException(
-                String.format("Invalid session id [%d] ", sessionId));
-        }
-        List<File> allResultDirs = getResultDirectories(resultsDir);
-        if (sessionId >= allResultDirs.size()) {
-            throw new IllegalArgumentException(String.format("Invalid session id [%d], results" +
-                    "directory contains only %d results", sessionId, allResultDirs.size()));
-        }
-        return allResultDirs.get(sessionId);
-    }
-
-    /**
-     * Get a list of child directories that contain test invocation results
-     * @param resultsDir the root test result directory
-     * @return
-     */
-    public static List<File> getResultDirectories(File resultsDir) {
-        List<File> directoryList = new ArrayList<>();
-        File[] files = resultsDir.listFiles();
-        if (files == null || files.length == 0) {
-            // No results, just return the empty list
-            return directoryList;
-        }
-        for (File resultDir : files) {
-            if (!resultDir.isDirectory()) {
-                continue;
-            }
-            // Only include if it contain results file
-            File resultFile = new File(resultDir, TEST_RESULT_FILE_NAME);
-            if (!resultFile.exists()) {
-                continue;
-            }
-            directoryList.add(resultDir);
-        }
-        Collections.sort(directoryList, (d1, d2) -> d1.getName().compareTo(d2.getName()));
-        return directoryList;
-    }
-
-    /**
-     * Return the given time as a {@link String} suitable for displaying.
-     * <p/>
-     * Example: Fri Aug 20 15:13:03 PDT 2010
-     *
-     * @param time the epoch time in ms since midnight Jan 1, 1970
-     */
-    static String toReadableDateString(long time) {
-        SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
-        return dateFormat.format(new Date(time));
-    }
-
-    /**
-     * When nullable is null, return an empty string. Otherwise, return the value in nullable.
-     */
-    private static String nullToEmpty(String nullable) {
-        return nullable == null ? "" : nullable;
-    }
-}
\ No newline at end of file
diff --git a/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsDeviceInfoCollector.java b/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsDeviceInfoCollector.java
index f1db241..8369a2d 100644
--- a/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsDeviceInfoCollector.java
+++ b/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsDeviceInfoCollector.java
@@ -61,6 +61,8 @@
         BUILD_KEYS.put("cts:build_reference_fingerprint", "ro.build.reference.fingerprint");
         BUILD_KEYS.put("cts:build_system_fingerprint", "ro.build.fingerprint");
         BUILD_KEYS.put("cts:build_vendor_fingerprint", "ro.vendor.build.fingerprint");
+        BUILD_KEYS.put("cts:build_vendor_manufacturer", "ro.vendor.product.manufacturer");
+        BUILD_KEYS.put("cts:build_vendor_model", "ro.vendor.product.model");
     }
 
     @Override
diff --git a/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsPythonVirtualenvPreparer.java b/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsPythonVirtualenvPreparer.java
index 3af6f29..c339f73 100644
--- a/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsPythonVirtualenvPreparer.java
+++ b/harnesses/tradefed/src/com/android/tradefed/targetprep/VtsPythonVirtualenvPreparer.java
@@ -35,6 +35,11 @@
 
 import java.io.File;
 import java.io.InputStream;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
 import java.io.IOException;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
@@ -102,8 +107,12 @@
     public void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)
             throws DeviceNotAvailableException {
         if (mVenvDir != null) {
-            FileUtil.recursiveDelete(mVenvDir);
-            CLog.i("Deleted the virtual env's temp working dir, %s.", mVenvDir);
+            try {
+                recursiveDelete(mVenvDir.toPath());
+                CLog.i("Deleted the virtual env's temp working dir, %s.", mVenvDir);
+            } catch (IOException exception) {
+                CLog.e("Failed to delete %s: %s", mVenvDir, exception);
+            }
             mVenvDir = null;
         }
     }
@@ -307,6 +316,31 @@
     }
 
     /**
+     * This method recursively deletes a file tree without following symbolic links.
+     *
+     * @param rootPath the path to delete.
+     * @throws IOException if fails to traverse or delete the files.
+     */
+    private static void recursiveDelete(Path rootPath) throws IOException {
+        Files.walkFileTree(rootPath, new SimpleFileVisitor<Path>() {
+            @Override
+            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
+                    throws IOException {
+                Files.delete(file);
+                return FileVisitResult.CONTINUE;
+            }
+            @Override
+            public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
+                if (e != null) {
+                    throw e;
+                }
+                Files.delete(dir);
+                return FileVisitResult.CONTINUE;
+            }
+        });
+    }
+
+    /**
      * This method returns whether the OS is Windows.
      */
     private static boolean isOnWindows() {
diff --git a/harnesses/tradefed/src/com/android/tradefed/testtype/VtsMultiDeviceTest.java b/harnesses/tradefed/src/com/android/tradefed/testtype/VtsMultiDeviceTest.java
index c8ce627..0f220df 100644
--- a/harnesses/tradefed/src/com/android/tradefed/testtype/VtsMultiDeviceTest.java
+++ b/harnesses/tradefed/src/com/android/tradefed/testtype/VtsMultiDeviceTest.java
@@ -184,6 +184,12 @@
                     + "this can override precondition-lshal option.")
     private String mPreconditionVintf = null;
 
+    @Option(name = "precondition-vintf-override",
+            description = "If precondition-lshal is present and precondition-vintf is not, "
+                    + "set precondition-vintf to the value of precondition-lshal. "
+                    + "The test runner will find the HAL in manifest.xml instead of lshal.")
+    private boolean mPreconditionVintfOverride = false;
+
     @Option(name = "use-stdout-logs",
             description = "Flag that determines whether to use std:out to parse output.")
     private boolean mUseStdoutLogs = false;
@@ -788,6 +794,16 @@
             CLog.i("Added %s to the Json object", PRECONDITION_VINTF);
         }
 
+        if (mPreconditionVintfOverride && mPreconditionLshal != null) {
+            if (mPreconditionVintf == null) {
+                jsonObject.put(PRECONDITION_VINTF, mPreconditionLshal);
+                CLog.i("Added %s to the Json object, overriding %s", PRECONDITION_VINTF,
+                        PRECONDITION_LSHAL);
+            } else {
+                CLog.w("Ignored precondition-vintf-override as precondition-vintf is present");
+            }
+        }
+
         if (!mBinaryTestProfilingLibraryPath.isEmpty()) {
             jsonObject.put(BINARY_TEST_PROFILING_LIBRARY_PATH,
                     new JSONArray(mBinaryTestProfilingLibraryPath));
diff --git a/testcases/template/binary_test/binary_test.py b/testcases/template/binary_test/binary_test.py
index 916b4d9..dcc1d14 100644
--- a/testcases/template/binary_test/binary_test.py
+++ b/testcases/template/binary_test/binary_test.py
@@ -196,12 +196,13 @@
         if getattr(self, keys.ConfigKeys.IKEY_BINARY_TEST_DISABLE_FRAMEWORK,
                    False):
             # Stop Android runtime to reduce interference.
+            logging.debug("Stops the Android framework.")
             self._dut.stop()
             stop_requested = True
 
         if getattr(self, keys.ConfigKeys.IKEY_BINARY_TEST_STOP_NATIVE_SERVERS,
                    False):
-            # Stops all (properly configured) native servers.
+            logging.debug("Stops all properly configured native servers.")
             results = self._dut.setProp(self.SYSPROP_VTS_NATIVE_SERVER, "1")
             stop_requested = True
 
@@ -256,6 +257,9 @@
                 else:
                     self.testcases.append(testcase)
 
+        if type(self.testcases) is not list or len(self.testcases) == 0:
+            asserts.fail("No test case is found or generated.")
+
     def PutTag(self, name, tag):
         '''Put tag on name and return the resulting string.
 
@@ -297,12 +301,13 @@
         '''Perform clean-up tasks'''
         if getattr(self, keys.ConfigKeys.IKEY_BINARY_TEST_STOP_NATIVE_SERVERS,
                    False):
-            # Restarts all (properly configured) native servers.
+            logging.debug("Restarts all properly configured native servers.")
             results = self._dut.setProp(self.SYSPROP_VTS_NATIVE_SERVER, "0")
 
         # Restart Android runtime.
         if getattr(self, keys.ConfigKeys.IKEY_BINARY_TEST_DISABLE_FRAMEWORK,
                    False):
+            logging.debug("Starts the Android framework.")
             self._dut.start()
 
         # Retrieve coverage if applicable
diff --git a/testcases/template/gtest_binary_test/gtest_binary_test.py b/testcases/template/gtest_binary_test/gtest_binary_test.py
index 7eb25b3..dfad91a 100644
--- a/testcases/template/gtest_binary_test/gtest_binary_test.py
+++ b/testcases/template/gtest_binary_test/gtest_binary_test.py
@@ -60,7 +60,7 @@
             tag: string, a tag that will be appended to the end of test name
 
         Returns:
-            A list of GtestTestCase objects.
+            A list of GtestTestCase objects on success; an empty list otherwise.
             In non-batch mode, each object respresents a test case in the
             gtest binary located at the provided path. Usually there are more
             than one object returned.
@@ -94,13 +94,13 @@
             args=gtest_list_args)
         cmd = ['chmod 755 %s' % path, list_test_case.GetRunCommand()]
         cmd_results = self.shell.Execute(cmd)
+        test_cases = []
         if any(cmd_results[const.EXIT_CODE]
                ):  # gtest binary doesn't exist or is corrupted
             logging.error(
                 'Failed to list test cases from %s. Command: %s, Result: %s.' %
                 (path, cmd, cmd_results))
-
-        test_cases = []
+            return test_cases
 
         test_suite = ''
         for line in cmd_results[const.STDOUT][1].split('\n'):
diff --git a/tools/build/tasks/list/vts_test_lib_hidl_package_list.mk b/tools/build/tasks/list/vts_test_lib_hidl_package_list.mk
index a7fd5bb..c31d0e6 100644
--- a/tools/build/tasks/list/vts_test_lib_hidl_package_list.mk
+++ b/tools/build/tasks/list/vts_test_lib_hidl_package_list.mk
@@ -140,10 +140,11 @@
   VtsHalBootV1_0TargetTest \
   VtsHalBroadcastradioV1_0TargetTest \
   VtsHalCameraProviderV2_4TargetTest \
+  VtsHalCasV1_0TargetTest \
   VtsHalConfigstoreV1_0TargetTest \
   VtsHalContexthubV1_0TargetTest \
   VtsHalDrmV1_0TargetTest \
-  VtsHalDumpstateV1_0Target \
+  VtsHalDumpstateV1_0TargetTest \
   VtsHalGatekeeperV1_0TargetTest \
   VtsHalGnssV1_0TargetTest \
   VtsHalGraphicsComposerV2_1TargetTest \
diff --git a/tools/build/tasks/vts_package.mk b/tools/build/tasks/vts_package.mk
index f732352..3fc9912 100644
--- a/tools/build/tasks/vts_package.mk
+++ b/tools/build/tasks/vts_package.mk
@@ -130,7 +130,8 @@
   ))
 
 host_additional_deps_copy_pairs := \
-  test/vts/tools/vts-tradefed/etc/vts-tradefed_win.bat:$(VTS_TOOLS_OUT)/vts-tradefed_win.bat
+  test/vts/tools/vts-tradefed/etc/vts-tradefed_win.bat:$(VTS_TOOLS_OUT)/vts-tradefed_win.bat \
+  test/vts/tools/vts-tradefed/CtsDynamicConfig.xml:$(VTS_TESTCASES_OUT)/cts.dynamic
 
 # Packaging rule for host-side Python logic, configs, and data files
 
diff --git a/tools/vts-tradefed/Android.mk b/tools/vts-tradefed/Android.mk
index e281e73..fee304e 100644
--- a/tools/vts-tradefed/Android.mk
+++ b/tools/vts-tradefed/Android.mk
@@ -24,7 +24,7 @@
 LOCAL_SUITE_TARGET_ARCH := $(TARGET_ARCH)
 LOCAL_SUITE_NAME := VTS
 LOCAL_SUITE_FULLNAME := "Vendor Test Suite"
-LOCAL_SUITE_VERSION := 8.0
+LOCAL_SUITE_VERSION := 8.1
 LOCAL_STATIC_JAVA_LIBRARIES := \
     libvts_protos_host \
 
diff --git a/tools/vts-tradefed/CtsDynamicConfig.xml b/tools/vts-tradefed/CtsDynamicConfig.xml
new file mode 100644
index 0000000..ffcf17c
--- /dev/null
+++ b/tools/vts-tradefed/CtsDynamicConfig.xml
@@ -0,0 +1,20 @@
+<!-- Copyright (C) 2015 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.
+-->
+
+<dynamicConfig>
+    <entry key="media_files_url">
+         <value>https://dl.google.com/dl/android/cts/android-cts-media-1.3.zip</value>
+    </entry>
+</dynamicConfig>
diff --git a/tools/vts-tradefed/res/config/plans.md b/tools/vts-tradefed/res/config/plans.md
index 96161dd..85e16d2 100644
--- a/tools/vts-tradefed/res/config/plans.md
+++ b/tools/vts-tradefed/res/config/plans.md
@@ -12,10 +12,9 @@
 
  * __vts__: For all default VTS tests.
  * __vts-fuzz__: For all default VTS fuzz tests.
- * __vts-hidl-hal__: For all default VTS HIDL (Hardware Interface Definition Language) HAL (hardware abstraction layer) module tests.
- * __vts-hal-hidl-profiling__: For all default VTS HIDL HAL performance
-    profiling tests.
- * __vts-hal-hild-replay__: For all default VTS HIDL HAL replay tests.
+ * __vts-hal__: For all default VTS HAL (hardware abstraction layer) module tests.
+ * __vts-hal-profiling__: For all default VTS HAL performance profiling tests.
+ * __vts-hal-replay__: For all default VTS HAL replay tests.
  * __vts-kernel__: For all default VTS kernel tests.
  * __vts-library__: For all default VTS library tests.
  * __vts-performance__: For all default VTS performance tests
@@ -34,8 +33,8 @@
  * __vts-codelab__: For VTS codelab.
  * __vts-codelab-multi-device__: For VTS codelab of multi-device testing.
  * __vts-gce__: For VTS tests which can be run on Google Compute Engine (GCE)
- * __vts-hal-hidl-auto__: For VTS automotive vehicle HAL test.
- * __vts-hal-hidl-tv__: For VTS tv HAL test.
+ * __vts-hal-auto__: For VTS automotive vehicle HAL test.
+ * __vts-hal-tv__: For VTS tv HAL test.
  * __vts-host__: For VTS host-driven tests.
  * __vts-performance-systrace__: For VTS performance tests with systrace
    enabled.
diff --git a/tools/vts-tradefed/res/config/vts-base.xml b/tools/vts-tradefed/res/config/vts-base.xml
index 33855be..506062f 100644
--- a/tools/vts-tradefed/res/config/vts-base.xml
+++ b/tools/vts-tradefed/res/config/vts-base.xml
@@ -14,11 +14,23 @@
      limitations under the License.
 -->
 <configuration description="VTS Main Test Plan">
-  <include name="everything" />
+  <device_recovery class="com.android.tradefed.device.WaitDeviceRecovery" />
+
+  <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:rerun-from-file:true" />
+  <option name="compatibility:test-arg" value="com.android.tradefed.testtype.AndroidJUnitTest:fallback-to-serial-rerun:false" />
+  <logger class="com.android.tradefed.log.FileLogger">
+    <option name="log-level-display" value="WARN" />
+  </logger>
   <option name="compatibility:skip-all-system-status-check" value="true" />
   <option name="max-log-size" value="200" />
   <object type="vts-vendor-config" class="com.android.tradefed.util.VtsVendorConfigFileUtil" />
-  <target_preparer class="com.android.tradefed.targetprep.VtsDeviceInfoCollector" />
-  <target_preparer class="com.android.tradefed.targetprep.VtsTestPlanResultReporter" />
+  <result_reporter class="com.android.compatibility.common.tradefed.result.ConsoleReporter" />
+  <result_reporter class="com.android.compatibility.common.tradefed.result.VtsResultReporter" />
+
   <template-include name="reporters" default="basic-reporters" />
+  <target_preparer class="com.android.tradefed.targetprep.VtsTestPlanResultReporter" />
+  <test class="com.android.compatibility.common.tradefed.testtype.CompatibilityTest" />
+
+  <build_provider class="com.android.compatibility.common.tradefed.build.CompatibilityBuildProvider" />
+  <target_preparer class="com.android.tradefed.targetprep.VtsDeviceInfoCollector" />
 </configuration>
diff --git a/tools/vts-tradefed/res/config/vts-hal-hidl-auto.xml b/tools/vts-tradefed/res/config/vts-hal-auto.xml
similarity index 88%
rename from tools/vts-tradefed/res/config/vts-hal-hidl-auto.xml
rename to tools/vts-tradefed/res/config/vts-hal-auto.xml
index c5315e9..fb45101 100644
--- a/tools/vts-tradefed/res/config/vts-hal-hidl-auto.xml
+++ b/tools/vts-tradefed/res/config/vts-hal-auto.xml
@@ -13,11 +13,11 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="VTS Serving Plan for HIDL HALs - Auto">
+<configuration description="VTS Serving Plan for HALs - Auto">
     <include name="vts-base" />
     <option name="plan" value="vts" />
     <option name="test-tag" value="vts" />
-    <option name="vts-plan-result:plan-name" value="vts-hal-hidl-auto" />
+    <option name="vts-plan-result:plan-name" value="vts-hal-auto" />
 
     <option name="compatibility:include-filter" value="VtsHalBroadcastradioV1_1TargetTest" />
     <option name="compatibility:include-filter" value="VtsHalEvsV1_0Target" />
diff --git a/tools/vts-tradefed/res/config/vts-hal-hidl-profiling-passthrough.xml b/tools/vts-tradefed/res/config/vts-hal-profiling-passthrough.xml
similarity index 64%
rename from tools/vts-tradefed/res/config/vts-hal-hidl-profiling-passthrough.xml
rename to tools/vts-tradefed/res/config/vts-hal-profiling-passthrough.xml
index dd7e347..f15f23a 100644
--- a/tools/vts-tradefed/res/config/vts-hal-hidl-profiling-passthrough.xml
+++ b/tools/vts-tradefed/res/config/vts-hal-profiling-passthrough.xml
@@ -13,50 +13,34 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="VTS HIDL HAL Profiling Plan in passthrough mode">
+<configuration description="VTS HAL Profiling Plan in passthrough mode">
   <include name="vts-base" />
   <option name="plan" value="vts" />
   <option name="test-tag" value="vts-star" />
-  <option name="vts-plan-result:plan-name" value="vts-hal-hidl-profiling-passthrough" />
+  <option name="vts-plan-result:plan-name" value="vts-hal-profiling-passthrough" />
 
   <!--  Set passthrough-mode for all tests -->
   <option name="compatibility:test-arg" value="com.android.tradefed.testtype.VtsMultiDeviceTest:passthrough-mode:true" />
   <!--  Include all profiling tests -->
   <option name="compatibility:include-filter" value="VtsHalAudioV2_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalAudioEffectV2_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalBiometricsFingerprintV2_1TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalBootV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalBroadcastradioV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalBluetoothV1_0TargetProfiling" />
+  <option name="compatibility:include-filter" value="VtsHalBootV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalCameraProviderV2_4TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalConfigstoreV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalContexthubV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalDrmV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalGatekeeperV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalGnssV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalGraphicsComposerV2_1TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalGraphicsMapperV2_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalIrV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalKeymasterV3_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalLightV2_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalMemtrackV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalNeuralnetworksV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalNfcV1_0HostProfiling" />
   <option name="compatibility:include-filter" value="VtsHalNfcV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalPowerV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalPowerV1_1TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalRadioV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalRenderscriptV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalSensorsV1_0HostProfiling" />
   <option name="compatibility:include-filter" value="VtsHalSensorsV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalSoundtriggerV2_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalThermalV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalUsbV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalVibratorV1_0HostProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalVibratorV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalVrV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalWifiV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalWifiV1_1TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalWifiNanV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalWifiSupplicantV1_0TargetProfiling" />
 </configuration>
diff --git a/tools/vts-tradefed/res/config/vts-hal-hidl-profiling-tv.xml b/tools/vts-tradefed/res/config/vts-hal-profiling-tv.xml
similarity index 86%
rename from tools/vts-tradefed/res/config/vts-hal-hidl-profiling-tv.xml
rename to tools/vts-tradefed/res/config/vts-hal-profiling-tv.xml
index d75e928..0a88655 100644
--- a/tools/vts-tradefed/res/config/vts-hal-hidl-profiling-tv.xml
+++ b/tools/vts-tradefed/res/config/vts-hal-profiling-tv.xml
@@ -13,11 +13,11 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="VTS Serving Plan for HIDL HAL Profiling - TV/x86">
+<configuration description="VTS Serving Plan for HAL Profiling - TV/x86">
   <include name="vts-base" />
   <option name="plan" value="vts" />
   <option name="test-tag" value="vts-star" />
-  <option name="vts-plan-result:plan-name" value="vts-hal-hidl-profiling-tv" />
+  <option name="vts-plan-result:plan-name" value="vts-hal-profiling-tv" />
 
   <option name="compatibility:include-filter" value="VtsHalTvCecV1_0HostProfiling" />
   <option name="compatibility:include-filter" value="VtsHalTvInputV1_0HostProfiling" />
diff --git a/tools/vts-tradefed/res/config/vts-hal-hidl-profiling.xml b/tools/vts-tradefed/res/config/vts-hal-profiling.xml
similarity index 94%
rename from tools/vts-tradefed/res/config/vts-hal-hidl-profiling.xml
rename to tools/vts-tradefed/res/config/vts-hal-profiling.xml
index e66dabf..3b529d0 100644
--- a/tools/vts-tradefed/res/config/vts-hal-hidl-profiling.xml
+++ b/tools/vts-tradefed/res/config/vts-hal-profiling.xml
@@ -13,11 +13,11 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="VTS HIDL HAL Profiling Plan">
+<configuration description="VTS HAL Profiling Plan">
   <include name="vts-base" />
   <option name="plan" value="vts" />
   <option name="test-tag" value="vts-star" />
-  <option name="vts-plan-result:plan-name" value="vts-hal-hidl-profiling" />
+  <option name="vts-plan-result:plan-name" value="vts-hal-profiling" />
 
   <option name="compatibility:include-filter" value="VtsHalAudioV2_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalAudioEffectV2_0TargetProfiling" />
@@ -39,7 +39,6 @@
   <option name="compatibility:include-filter" value="VtsHalKeymasterV3_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalLightV2_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalMemtrackV1_0TargetProfiling" />
-  <option name="compatibility:include-filter" value="VtsHalNeuralnetworksV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalNfcV1_0HostProfiling" />
   <option name="compatibility:include-filter" value="VtsHalNfcV1_0TargetProfiling" />
   <option name="compatibility:include-filter" value="VtsHalOemHookV1_0Host" />
diff --git a/tools/vts-tradefed/res/config/vts-hal-hidl-replay.xml b/tools/vts-tradefed/res/config/vts-hal-replay.xml
similarity index 92%
rename from tools/vts-tradefed/res/config/vts-hal-hidl-replay.xml
rename to tools/vts-tradefed/res/config/vts-hal-replay.xml
index 151d4ab..dd9ff9c 100644
--- a/tools/vts-tradefed/res/config/vts-hal-hidl-replay.xml
+++ b/tools/vts-tradefed/res/config/vts-hal-replay.xml
@@ -13,11 +13,11 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="VTS HIDL HAL Replay Test Plan">
+<configuration description="VTS HAL Replay Test Plan">
   <include name="vts-base" />
   <option name="plan" value="vts" />
   <option name="test-tag" value="vts" />
-  <option name="vts-plan-result:plan-name" value="vts-hal-hidl-replay" />
+  <option name="vts-plan-result:plan-name" value="vts-hal-replay" />
 
   <!-- For Hidl Hal replay tests -->
   <option name="compatibility:include-filter" value="VtsHalNfcV1_0TargetReplay" />
diff --git a/tools/vts-tradefed/res/config/vts-hal-hidl-tv.xml b/tools/vts-tradefed/res/config/vts-hal-tv.xml
similarity index 89%
rename from tools/vts-tradefed/res/config/vts-hal-hidl-tv.xml
rename to tools/vts-tradefed/res/config/vts-hal-tv.xml
index b3b361d..88c0e25 100644
--- a/tools/vts-tradefed/res/config/vts-hal-hidl-tv.xml
+++ b/tools/vts-tradefed/res/config/vts-hal-tv.xml
@@ -13,11 +13,11 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="VTS Serving Plan for HIDL HALs - TV/x86">
+<configuration description="VTS Serving Plan for HALs - TV/x86">
   <include name="vts-base" />
   <option name="plan" value="vts" />
   <option name="test-tag" value="vts" />
-  <option name="vts-plan-result:plan-name" value="vts-hal-hidl-tv" />
+  <option name="vts-plan-result:plan-name" value="vts-hal-tv" />
 
   <option name="compatibility:test-arg" value="com.android.tradefed.testtype.VtsMultiDeviceTest:gtest-batch-mode:true" />
   <option name="compatibility:include-filter" value="VtsHalTvCecV1_0Host" />
diff --git a/tools/vts-tradefed/res/config/vts-hal-hidl.xml b/tools/vts-tradefed/res/config/vts-hal.xml
similarity index 94%
rename from tools/vts-tradefed/res/config/vts-hal-hidl.xml
rename to tools/vts-tradefed/res/config/vts-hal.xml
index fa59376..9ad8653 100644
--- a/tools/vts-tradefed/res/config/vts-hal-hidl.xml
+++ b/tools/vts-tradefed/res/config/vts-hal.xml
@@ -13,18 +13,17 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<configuration description="VTS HIDL HAL Test Plan">
+<configuration description="VTS HAL Test Plan">
   <include name="vts-base" />
   <option name="plan" value="vts" />
   <option name="test-tag" value="vts" />
-  <option name="vts-plan-result:plan-name" value="vts-hal-hidl" />
+  <option name="vts-plan-result:plan-name" value="vts-hal" />
 
   <option name="compatibility:test-arg" value="com.android.tradefed.testtype.VtsMultiDeviceTest:gtest-batch-mode:true" />
   <option name="compatibility:include-filter" value="VtsHalBluetoothV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalBootV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalDumpstateV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalIrV1_0Target" />
-  <option name="compatibility:include-filter" value="VtsHalNeuralnetworksV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalNfcV1_0HostBinderize" />
   <option name="compatibility:include-filter" value="VtsHalNfcV1_0HostPassthrough" />
   <option name="compatibility:include-filter" value="VtsHalNfcV1_0Target" />
@@ -44,6 +43,7 @@
   <option name="compatibility:include-filter" value="VtsHalBiometricsFingerprintV2_1Target" />
   <option name="compatibility:include-filter" value="VtsHalBroadcastradioV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalCameraProviderV2_4Target" />
+  <option name="compatibility:include-filter" value="VtsHalCasV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalConfigstoreV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalContexthubV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalDrmV1_0Target" />
@@ -56,6 +56,7 @@
   <option name="compatibility:include-filter" value="VtsHalKeymasterV3_0Target" />
   <option name="compatibility:include-filter" value="VtsHalLightV2_0Target" />
   <option name="compatibility:include-filter" value="VtsHalMemtrackV1_0Target" />
+  <option name="compatibility:include-filter" value="VtsHalMediaOmxStoreV1_0Host" />
   <option name="compatibility:include-filter" value="VtsHalMediaOmxV1_0Host" />
   <option name="compatibility:include-filter" value="VtsHalOemHookV1_0Host" />
   <option name="compatibility:include-filter" value="VtsHalOemLockV1_0Target" />
diff --git a/tools/vts-tradefed/res/config/vts.xml b/tools/vts-tradefed/res/config/vts.xml
index c53a202..ab45798 100644
--- a/tools/vts-tradefed/res/config/vts.xml
+++ b/tools/vts-tradefed/res/config/vts.xml
@@ -19,6 +19,8 @@
   <option name="test-tag" value="vts" />
   <option name="vts-plan-result:plan-name" value="vts" />
 
+  <option name="compatibility:test-arg" value="com.android.tradefed.testtype.VtsMultiDeviceTest:precondition-vintf-override:true" />
+
   <!-- For Treble-specific validations -->
   <option name="compatibility:include-filter" value="VtsTreblePlatformVersionTest" />
   <option name="compatibility:include-filter" value="VtsTrebleVintfTest" />
@@ -28,7 +30,6 @@
   <option name="compatibility:include-filter" value="VtsHalBootV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalDumpstateV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalIrV1_0Target" />
-  <option name="compatibility:include-filter" value="VtsHalNeuralnetworksV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalNfcV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalRadioV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalRadioV1_1Target" />
@@ -45,6 +46,7 @@
   <option name="compatibility:include-filter" value="VtsHalBiometricsFingerprintV2_1Target" />
   <option name="compatibility:include-filter" value="VtsHalBroadcastradioV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalCameraProviderV2_4Target" />
+  <option name="compatibility:include-filter" value="VtsHalCasV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalConfigstoreV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalContexthubV1_0Target" />
   <option name="compatibility:include-filter" value="VtsHalDrmV1_0Target" />
@@ -56,6 +58,7 @@
   <option name="compatibility:include-filter" value="VtsHalKeymasterV3_0Target" />
   <option name="compatibility:include-filter" value="VtsHalLightV2_0Target" />
   <option name="compatibility:include-filter" value="VtsHalMemtrackV1_0Target" />
+  <option name="compatibility:include-filter" value="VtsHalMediaOmxStoreV1_0Host" />
   <option name="compatibility:include-filter" value="VtsHalMediaOmxV1_0Host" />
   <option name="compatibility:include-filter" value="VtsHalOemHookV1_0Host" />
   <option name="compatibility:include-filter" value="VtsHalOemLockV1_0Target" />
diff --git a/tools/vts-tradefed/res/report/vts_failures.xsl b/tools/vts-tradefed/res/report/vts_failures.xsl
deleted file mode 100644
index 286a453..0000000
--- a/tools/vts-tradefed/res/report/vts_failures.xsl
+++ /dev/null
@@ -1,289 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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.
--->
-
-<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-    <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
-
-    <xsl:template match="/">
-
-        <html>
-            <head>
-                <title>Test Report</title>
-                <style type="text/css">
-                    @import "vts_result.css";
-                </style>
-            </head>
-            <body>
-                <div>
-                    <table class="title">
-                        <tr>
-                            <td align="left"><img src="logo.png"/></td>
-                        </tr>
-                    </table>
-                </div>
-
-                <div>
-                    <table class="summary">
-                        <tr>
-                            <th colspan="2">Summary</th>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Suite / Plan</td>
-                            <td>
-                                <xsl:value-of select="Result/@suite_name"/> / <xsl:value-of select="Result/@suite_plan"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Suite / Build</td>
-                            <td>
-                                <xsl:value-of select="Result/@suite_version"/> / <xsl:value-of select="Result/@suite_build_number"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Host Info</td>
-                            <td>
-                                Result/@start
-                                <xsl:value-of select="Result/@host_name"/>
-                                (<xsl:value-of select="Result/@os_name"/> - <xsl:value-of select="Result/@os_version"/>)
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Start time / End Time</td>
-                            <td>
-                                <xsl:value-of select="Result/@start_display"/> /
-                                <xsl:value-of select="Result/@end_display"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Tests Passed</td>
-                            <td>
-                                <xsl:value-of select="Result/Summary/@pass"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Tests Failed</td>
-                            <td>
-                                <xsl:value-of select="Result/Summary/@failed"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Modules Done</td>
-                            <td>
-                                <xsl:value-of select="Result/Summary/@modules_done"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Modules Total</td>
-                            <td>
-                                <xsl:value-of select="Result/Summary/@modules_total"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Fingerprint</td>
-                            <td>
-                                <xsl:value-of select="Result/Build/@build_fingerprint"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Security Patch</td>
-                            <td>
-                                <xsl:value-of select="Result/Build/@build_version_security_patch"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Release (SDK)</td>
-                            <td>
-                                <xsl:value-of select="Result/Build/@build_version_release"/> (<xsl:value-of select="Result/Build/@build_version_sdk"/>)
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">ABIs</td>
-                            <td>
-                                <xsl:value-of select="Result/Build/@build_abis"/>
-                            </td>
-                        </tr>
-                    </table>
-                </div>
-
-                <!-- High level summary of test execution -->
-                <br/>
-                <div>
-                    <table class="testsummary">
-                        <tr>
-                            <th>Module</th>
-                            <th>Passed</th>
-                            <th>Failed</th>
-                            <th>Total Tests</th>
-                            <th>Done</th>
-                        </tr>
-                        <xsl:for-each select="Result/Module">
-                            <tr>
-                                <td>
-                                    <xsl:if test="count(TestCase/Test[@result = 'fail']) &gt; 0">
-                                        <xsl:variable name="href"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></xsl:variable>
-                                        <a href="#{$href}"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></a>
-                                    </xsl:if>
-                                    <xsl:if test="count(TestCase/Test[@result = 'fail']) &lt; 1">
-                                        <xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/>
-                                    </xsl:if>
-                                </td>
-                                <td>
-                                    <xsl:value-of select="@pass"/>
-                                </td>
-                                <td>
-                                    <xsl:value-of select="count(TestCase/Test[@result = 'fail'])"/>
-                                </td>
-                                <td>
-                                    <xsl:value-of select="count(TestCase/Test[@result = 'fail']) + @pass"/>
-                                </td>
-                                <td>
-                                    <xsl:value-of select="@done"/>
-                                </td>
-                            </tr>
-                        </xsl:for-each> <!-- end Module -->
-                    </table>
-                </div>
-
-                <br/>
-                <xsl:call-template name="detailedTestReport">
-                    <xsl:with-param name="resultFilter" select="'fail'" />
-                </xsl:call-template>
-
-                <br/>
-                <xsl:call-template name="incompleteModules" />
-
-            </body>
-        </html>
-    </xsl:template>
-
-    <xsl:template name="detailedTestReport">
-        <xsl:param name="resultFilter" />
-        <div>
-            <xsl:for-each select="Result/Module">
-                <xsl:if test="$resultFilter=''
-                        or count(TestCase/Test[@result=$resultFilter]) &gt; 0">
-
-                    <table class="testdetails">
-                        <tr>
-                            <td class="module" colspan="3">
-                                <xsl:variable name="href"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></xsl:variable>
-                                <a name="{$href}"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></a>
-                            </td>
-                        </tr>
-
-                        <tr>
-                            <th width="30%">Test</th>
-                            <th width="5%">Result</th>
-                            <th>Details</th>
-                        </tr>
-
-                        <xsl:for-each select="TestCase">
-                            <xsl:variable name="TestCase" select="."/>
-                            <!-- test -->
-                            <xsl:for-each select="Test">
-                                <xsl:if test="$resultFilter='' or @result=$resultFilter">
-                                    <tr>
-                                        <td class="testname"> <xsl:value-of select="$TestCase/@name"/>#<xsl:value-of select="@name"/></td>
-
-                                        <!-- test results -->
-                                        <xsl:if test="@result='pass'">
-                                            <td class="pass">
-                                                <div style="text-align: center; margin-left:auto; margin-right:auto;">
-                                                    <xsl:value-of select="@result"/>
-                                                </div>
-                                            </td>
-                                            <td class="failuredetails"/>
-                                        </xsl:if>
-
-                                        <xsl:if test="@result='fail'">
-                                            <td class="failed">
-                                                <div style="text-align: center; margin-left:auto; margin-right:auto;">
-                                                    <xsl:value-of select="@result"/>
-                                                </div>
-                                            </td>
-                                            <td class="failuredetails">
-                                                <div class="details">
-                                                    <xsl:value-of select="Failure/@message"/>
-                                                </div>
-                                            </td>
-                                        </xsl:if>
-
-                                        <xsl:if test="@result='not_executed'">
-                                            <td class="not_executed">
-                                                <div style="text-align: center; margin-left:auto; margin-right:auto;">
-                                                    <xsl:value-of select="@result"/>
-                                                </div>
-                                            </td>
-                                            <td class="failuredetails"></td>
-                                        </xsl:if>
-                                    </tr> <!-- finished with a row -->
-                                </xsl:if>
-                            </xsl:for-each> <!-- end test -->
-                        </xsl:for-each>
-                    </table>
-                </xsl:if>
-            </xsl:for-each> <!-- end test Module -->
-        </div>
-    </xsl:template>
-
-    <xsl:template name="incompleteModules">
-        <xsl:if test="not(Result/Summary/@modules_done = Result/Summary/@modules_total)">
-            <div>
-                <table class="incompletemodules">
-                    <tr>
-                        <th>Incomplete Modules</th>
-                    </tr>
-                    <xsl:for-each select="Result/Module">
-                        <xsl:if test="@done='false'">
-                            <tr>
-                                <td>
-                                    <xsl:variable name="href"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></xsl:variable>
-                                    <a name="{$href}"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></a>
-                                </td>
-                            </tr>
-                        </xsl:if>
-                    </xsl:for-each> <!-- end test Module -->
-                </table>
-            </div>
-        </xsl:if>
-    </xsl:template>
-
-    <!-- Take a delimited string and insert line breaks after a some number of elements. -->
-    <xsl:template name="formatDelimitedString">
-        <xsl:param name="string" />
-        <xsl:param name="numTokensPerRow" select="10" />
-        <xsl:param name="tokenIndex" select="1" />
-        <xsl:if test="$string">
-            <!-- Requires the last element to also have a delimiter after it. -->
-            <xsl:variable name="token" select="substring-before($string, ';')" />
-            <xsl:value-of select="$token" />
-            <xsl:text>&#160;</xsl:text>
-
-            <xsl:if test="$tokenIndex mod $numTokensPerRow = 0">
-                <br />
-            </xsl:if>
-
-            <xsl:call-template name="formatDelimitedString">
-                <xsl:with-param name="string" select="substring-after($string, ';')" />
-                <xsl:with-param name="numTokensPerRow" select="$numTokensPerRow" />
-                <xsl:with-param name="tokenIndex" select="$tokenIndex + 1" />
-            </xsl:call-template>
-        </xsl:if>
-    </xsl:template>
-
-</xsl:stylesheet>
diff --git a/tools/vts-tradefed/res/report/vts_result.css b/tools/vts-tradefed/res/report/vts_result.css
deleted file mode 100644
index 03032ed..0000000
--- a/tools/vts-tradefed/res/report/vts_result.css
+++ /dev/null
@@ -1,183 +0,0 @@
-/* Copyright (C) 2015 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.
-*/
-
-body {
-    font-family:arial,sans-serif;
-    color:#000;
-    font-size:13px;
-    color:#333;
-    padding:10;
-    margin:10;
-}
-
-/* Report logo and device name */
-table.title {
-    padding:5px;
-    border-width: 0px;
-    margin-left:auto;
-    margin-right:auto;
-    vertical-align:middle;
-}
-
-table.summary {
-    background-color: rgb(212, 233, 169);
-    border-collapse:collapse;
-    border: 0px solid #A5C639;
-    margin-left:auto;
-    margin-right:auto;
-}
-
-table.summary th {
-    background-color: #A5C639;
-    font-size: 1.2em;
-    padding: 0.5em;
-}
-
-table.summary td {
-    border-width: 0px 0px 0px 0px;
-    border-color: gray;
-    border-style: inset;
-    font-size: 1em;
-    padding: 0.5em;
-    vertical-align: top;
-}
-
-table.testsummary {
-    background-color: rgb(212, 233, 169);
-    border-collapse:collapse;
-    margin-left:auto;
-    margin-right:auto;
-}
-
-table.testsummary th {
-    background-color: #A5C639;
-    border: 1px outset gray;
-    padding: 0.5em;
-}
-
-table.testsummary td {
-    border: 1px outset #A5C639;
-    padding: 0.5em;
-    text-align: center;
-}
-
-table.testdetails {
-    background-color: rgb(212, 233, 169);
-    border-collapse:collapse;
-    border-width:1;
-    border-color: #A5C639;
-    margin-left:auto;
-    margin-right:auto;
-    margin-bottom: 2em;
-    vertical-align: top;
-    width: 95%;
-}
-
-table.testdetails th {
-    background-color: #A5C639;
-    border-width: 1px;
-    border-color: gray;
-    border-style: outset;
-    height: 2em;
-    padding: 0.2em;
-}
-
-table.testdetails td {
-    border-width: 1px;
-    border-color: #A5C639;
-    border-style: outset;
-    text-align: left;
-    vertical-align: top;
-    padding: 0.2em;
-}
-
-table.testdetails td.module {
-    background-color: white;
-    border: 0px;
-    font-weight: bold;
-}
-
-table.incompletemodules {
-    background-color: rgb(212, 233, 169);
-    border-collapse:collapse;
-    margin-left:auto;
-    margin-right:auto;
-}
-
-table.incompletemodules th {
-    background-color: #A5C639;
-    border: 1px outset gray;
-    padding: 0.5em;
-}
-
-table.incompletemodules td {
-    border: 1px outset #A5C639;
-    padding: 0.5em;
-    text-align: center;
-}
-
-/* Test cell details */
-td.failed {
-    background-color: #FA5858;
-    font-weight:bold;
-    vertical-align: top;
-    text-align: center;
-}
-
-td.failuredetails {
-    text-align: left;
-}
-
-td.pass {
-    text-align: center;
-    margin-left:auto;
-    margin-right:auto;
-}
-
-td.not_executed {
-    background-color: #A5C639;
-    vertical-align: top;
-    text-align: center;
-}
-
-td.testname {
-    border-width: 1px;
-    border-color: #A5C639;
-    border-style: outset;
-    text-align: left;
-    vertical-align: top;
-    padding:1;
-    overflow:hidden;
-}
-
-td.testcase {
-    border-width: 1px;
-    border-color: #A5C639;
-    border-style: outset;
-    text-align: left;
-    vertical-align: top;
-    padding:1;
-    overflow:hidden;
-    font-weight:bold;
-}
-
-div.details {
-    white-space: pre-wrap;       /* css-3 */
-    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
-    white-space: -pre-wrap;      /* Opera 4-6 */
-    white-space: -o-pre-wrap;    /* Opera 7 */
-    word-wrap: break-word;       /* Internet Explorer 5.5+ */
-    overflow:auto;
-}
diff --git a/tools/vts-tradefed/res/report/vts_result.xsd b/tools/vts-tradefed/res/report/vts_result.xsd
deleted file mode 100644
index 95bae85..0000000
--- a/tools/vts-tradefed/res/report/vts_result.xsd
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2015 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.
- -->
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
-           targetNamespace="http://compatibility.android.com/compatibility_result/1.15"
-           xmlns="http://compatibility.android.com/compatibility_result/1.15"
-           elementFormDefault="qualified">
-
-  <xs:element name="Result">
-    <xs:complexType>
-      <xs:sequence>
-        <xs:element name="Summary" type="summaryType"/>
-        <xs:element name="Module" type="moduleType" minOccurs="1" maxOccurs="unbounded"/>
-      </xs:sequence>
-      <xs:attribute name="start" type="xs:string"/>
-      <xs:attribute name="end" type="xs:string"/>
-      <xs:attribute name="plan" type="xs:string"/>
-      <xs:attribute name="suite_name" type="xs:string"/>
-      <xs:attribute name="suite_version" type="xs:string"/>
-    </xs:complexType>
-  </xs:element>
-
-  <xs:complexType name="summaryType">
-    <xs:attribute name="failed" type="xs:integer"/>
-    <xs:attribute name="pass" type="xs:integer"/>
-  </xs:complexType>
-
-  <xs:complexType name="moduleType">
-    <xs:sequence>
-      <xs:element name="Test" type="testType" minOccurs="1" maxOccurs="unbounded" />
-    </xs:sequence>
-    <xs:attribute name="name" type="xs:string" use="required"/>
-    <xs:attribute name="abi" type="xs:string"/>
-  </xs:complexType>
-
-  <xs:simpleType name="unitType">
-    <xs:restriction base="xs:string">
-      <xs:enumeration value="none"/>
-      <xs:enumeration value="ms"/>
-      <xs:enumeration value="fps"/>
-      <xs:enumeration value="ops"/>
-      <xs:enumeration value="kbps"/>
-      <xs:enumeration value="mbps"/>
-      <xs:enumeration value="byte"/>
-      <xs:enumeration value="count"/>
-      <xs:enumeration value="score"/>
-    </xs:restriction>
-  </xs:simpleType>
-
-  <xs:simpleType name="scoreTypeType">
-    <xs:restriction base="xs:string">
-      <xs:enumeration value="higher-better"/>
-      <xs:enumeration value="lower-better"/>
-      <xs:enumeration value="neutral"/>
-      <xs:enumeration value="warning"/>
-    </xs:restriction>
-  </xs:simpleType>
-
-  <xs:complexType name="testType">
-    <xs:sequence>
-      <xs:element name="Failure" minOccurs="0" maxOccurs="1">
-        <xs:complexType>
-          <xs:sequence>
-            <xs:element name="StackTrace" type="xs:string" minOccurs="0" maxOccurs="1"/>
-          </xs:sequence>
-          <xs:attribute name="message" type="xs:string"/>
-        </xs:complexType>
-      </xs:element>
-      <xs:element name="Summary" minOccurs="0" maxOccurs="1">
-        <xs:complexType>
-          <xs:simpleContent>
-            <xs:extension base="xs:decimal">
-              <xs:attribute name="message" type="xs:string" use="required" />
-              <xs:attribute name="scoreType" type="scoreTypeType" use="required" />
-              <xs:attribute name="unit" type="unitType" use="required" />
-              <xs:attribute name="target" type="xs:decimal" />
-            </xs:extension>
-          </xs:simpleContent>
-        </xs:complexType>
-      </xs:element>
-      <xs:element name="Details" minOccurs="0" maxOccurs="1">
-        <xs:complexType>
-          <xs:sequence>
-            <xs:element name="ValueArray" minOccurs="0" maxOccurs="unbounded">
-              <xs:complexType>
-                <xs:sequence>
-                  <xs:element name="Value" type="xs:decimal" minOccurs="0" maxOccurs="unbounded" />
-                </xs:sequence>
-                <xs:attribute name="source" type="xs:string" use="required" />
-                <xs:attribute name="message" type="xs:string" use="required" />
-                <xs:attribute name="scoreType" type="scoreTypeType" use="required" />
-                <xs:attribute name="unit" type="unitType" use="required" />
-              </xs:complexType>
-            </xs:element>
-          </xs:sequence>
-        </xs:complexType>
-      </xs:element>
-    </xs:sequence>
-    <xs:attribute name="name" type="xs:string" use="required"/>
-    <xs:attribute name="result" type="resultType" use="required"/>
-    <xs:attribute name="start" type="xs:string"/>
-    <xs:attribute name="end" type="xs:string"/>
-  </xs:complexType>
-
-  <xs:simpleType name="resultType">
-    <xs:restriction base="xs:string">
-      <xs:enumeration value="pass"/>
-      <xs:enumeration value="fail"/>
-    </xs:restriction>
-  </xs:simpleType>
-</xs:schema>
diff --git a/tools/vts-tradefed/res/report/vts_result.xsl b/tools/vts-tradefed/res/report/vts_result.xsl
deleted file mode 100644
index c4c607f..0000000
--- a/tools/vts-tradefed/res/report/vts_result.xsl
+++ /dev/null
@@ -1,288 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-
-<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-    <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
-
-    <xsl:template match="/">
-
-        <html>
-            <head>
-                <title>Test Report</title>
-                <style type="text/css">
-                    @import "vts_result.css";
-                </style>
-            </head>
-            <body>
-                <div>
-                    <table class="title">
-                        <tr>
-                            <td align="left"><img src="logo.png"/></td>
-                        </tr>
-                    </table>
-                </div>
-
-                <div>
-                    <table class="summary">
-                        <tr>
-                            <th colspan="2">Summary</th>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Suite / Plan</td>
-                            <td>
-                                <xsl:value-of select="Result/@suite_name"/> / <xsl:value-of select="Result/@suite_plan"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Suite / Build</td>
-                            <td>
-                                <xsl:value-of select="Result/@suite_version"/> / <xsl:value-of select="Result/@suite_build_number"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Host Info</td>
-                            <td>
-                                Result/@start
-                                <xsl:value-of select="Result/@host_name"/>
-                                (<xsl:value-of select="Result/@os_name"/> - <xsl:value-of select="Result/@os_version"/>)
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Start time / End Time</td>
-                            <td>
-                                <xsl:value-of select="Result/@start_display"/> /
-                                <xsl:value-of select="Result/@end_display"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Tests Passed</td>
-                            <td>
-                                <xsl:value-of select="Result/Summary/@pass"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Tests Failed</td>
-                            <td>
-                                <xsl:value-of select="Result/Summary/@failed"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Modules Done</td>
-                            <td>
-                                <xsl:value-of select="Result/Summary/@modules_done"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Modules Total</td>
-                            <td>
-                                <xsl:value-of select="Result/Summary/@modules_total"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Fingerprint</td>
-                            <td>
-                                <xsl:value-of select="Result/Build/@build_fingerprint"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Security Patch</td>
-                            <td>
-                                <xsl:value-of select="Result/Build/@build_version_security_patch"/>
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">Release (SDK)</td>
-                            <td>
-                                <xsl:value-of select="Result/Build/@build_version_release"/> (<xsl:value-of select="Result/Build/@build_version_sdk"/>)
-                            </td>
-                        </tr>
-                        <tr>
-                            <td class="rowtitle">ABIs</td>
-                            <td>
-                                <xsl:value-of select="Result/Build/@build_abis"/>
-                            </td>
-                        </tr>
-                    </table>
-                </div>
-
-                <!-- High level summary of test execution -->
-                <br/>
-                <div>
-                    <table class="testsummary">
-                        <tr>
-                            <th>Module</th>
-                            <th>Passed</th>
-                            <th>Failed</th>
-                            <th>Total Tests</th>
-                            <th>Done</th>
-                        </tr>
-                        <xsl:for-each select="Result/Module">
-                            <tr>
-                                <td>
-                                    <xsl:variable name="href"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></xsl:variable>
-                                    <a href="#{$href}"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></a>
-                                </td>
-                                <td>
-                                    <xsl:value-of select="count(TestCase/Test[@result = 'pass'])"/>
-                                </td>
-                                <td>
-                                    <xsl:value-of select="count(TestCase/Test[@result = 'fail'])"/>
-                                </td>
-                                <td>
-                                    <xsl:value-of select="count(TestCase/Test)"/>
-                                </td>
-                                <td>
-                                    <xsl:value-of select="@done"/>
-                                </td>
-                            </tr>
-                        </xsl:for-each> <!-- end Module -->
-                    </table>
-                </div>
-
-                <xsl:call-template name="filteredResultTestReport">
-                    <xsl:with-param name="header" select="'Failed Tests'" />
-                    <xsl:with-param name="resultFilter" select="'fail'" />
-                </xsl:call-template>
-
-                <xsl:call-template name="filteredResultTestReport">
-                    <xsl:with-param name="header" select="'Not Executed Tests'" />
-                    <xsl:with-param name="resultFilter" select="'not_executed'" />
-                </xsl:call-template>
-
-                <br/>
-                <xsl:call-template name="detailedTestReport" />
-
-            </body>
-        </html>
-    </xsl:template>
-
-    <xsl:template name="filteredResultTestReport">
-        <xsl:param name="header" />
-        <xsl:param name="resultFilter" />
-        <xsl:variable name="numMatching" select="count(Result/Module/TestCase/Test[@result=$resultFilter])" />
-        <xsl:if test="$numMatching &gt; 0">
-            <h2 align="center"><xsl:value-of select="$header" /> (<xsl:value-of select="$numMatching"/>)</h2>
-            <xsl:call-template name="detailedTestReport">
-                <xsl:with-param name="resultFilter" select="$resultFilter"/>
-                <xsl:with-param name="fullStackTrace" select="true()"/>
-            </xsl:call-template>
-        </xsl:if>
-    </xsl:template>
-
-    <xsl:template name="detailedTestReport">
-        <xsl:param name="resultFilter" />
-        <xsl:param name="fullStackTrace" />
-        <div>
-            <xsl:for-each select="Result/Module">
-                <xsl:if test="$resultFilter=''
-                        or count(TestCase/Test[@result=$resultFilter]) &gt; 0">
-
-                    <table class="testdetails">
-                        <tr>
-                            <td class="module" colspan="3">
-                                <xsl:variable name="href"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></xsl:variable>
-                                <a name="{$href}"><xsl:value-of select="@abi"/>&#xA0;<xsl:value-of select="@name"/></a>
-                            </td>
-                        </tr>
-
-                        <tr>
-                            <th width="30%">Test</th>
-                            <th width="5%">Result</th>
-                            <th>Details</th>
-                        </tr>
-
-                        <xsl:for-each select="TestCase">
-                            <xsl:variable name="TestCase" select="."/>
-                            <!-- test -->
-                            <xsl:for-each select="Test">
-                                <xsl:if test="$resultFilter='' or @result=$resultFilter">
-                                    <tr>
-                                        <td class="testname"> <xsl:value-of select="$TestCase/@name"/>#<xsl:value-of select="@name"/></td>
-
-                                        <!-- test results -->
-                                        <xsl:if test="@result='pass'">
-                                            <td class="pass">
-                                                <div style="text-align: center; margin-left:auto; margin-right:auto;">
-                                                    <xsl:value-of select="@result"/>
-                                                </div>
-                                            </td>
-                                            <td class="failuredetails"/>
-                                        </xsl:if>
-
-                                        <xsl:if test="@result='fail'">
-                                            <td class="failed">
-                                                <div style="text-align: center; margin-left:auto; margin-right:auto;">
-                                                    <xsl:value-of select="@result"/>
-                                                </div>
-                                            </td>
-                                            <td class="failuredetails">
-                                                <div class="details">
-                                                    <xsl:choose>
-                                                        <xsl:when test="$fullStackTrace=true()">
-                                                            <xsl:value-of select="Failure/StackTrace" />
-                                                        </xsl:when>
-                                                        <xsl:otherwise>
-                                                            <xsl:value-of select="Failure/@message"/>
-                                                        </xsl:otherwise>
-                                                    </xsl:choose>
-                                                </div>
-                                            </td>
-                                        </xsl:if>
-
-                                        <xsl:if test="@result='not_executed'">
-                                            <td class="not_executed">
-                                                <div style="text-align: center; margin-left:auto; margin-right:auto;">
-                                                    <xsl:value-of select="@result"/>
-                                                </div>
-                                            </td>
-                                            <td class="failuredetails"></td>
-                                        </xsl:if>
-                                    </tr> <!-- finished with a row -->
-                                </xsl:if>
-                            </xsl:for-each> <!-- end test -->
-                        </xsl:for-each>
-                    </table>
-                </xsl:if>
-            </xsl:for-each> <!-- end test Module -->
-        </div>
-    </xsl:template>
-
-    <!-- Take a delimited string and insert line breaks after a some number of elements. -->
-    <xsl:template name="formatDelimitedString">
-        <xsl:param name="string" />
-        <xsl:param name="numTokensPerRow" select="10" />
-        <xsl:param name="tokenIndex" select="1" />
-        <xsl:if test="$string">
-            <!-- Requires the last element to also have a delimiter after it. -->
-            <xsl:variable name="token" select="substring-before($string, ';')" />
-            <xsl:value-of select="$token" />
-            <xsl:text>&#160;</xsl:text>
-
-            <xsl:if test="$tokenIndex mod $numTokensPerRow = 0">
-                <br />
-            </xsl:if>
-
-            <xsl:call-template name="formatDelimitedString">
-                <xsl:with-param name="string" select="substring-after($string, ';')" />
-                <xsl:with-param name="numTokensPerRow" select="$numTokensPerRow" />
-                <xsl:with-param name="tokenIndex" select="$tokenIndex + 1" />
-            </xsl:call-template>
-        </xsl:if>
-    </xsl:template>
-
-</xsl:stylesheet>