Apply Grpc Client to current VHal Implementation

Test: tested on Cuttlefish VM

 - Use virtualization HAL implementation, device/google/cuttlefish/shared/auto/device.mk, PRODUCT_PACKAGES:
      remove android.hardware.automotive.vehicle@2.0-service
      add:
        android.hardware.automotive.vehicle@2.0-virtualization-service
        android.hardware.automotive.vehicle@2.0-virtualization-grpc-server

 - configure the server CID and port, add the following device/google/cuttlefish/shared/config/init.vendor.rc:
        setprop ro.vendor.vehiclehal.server.cid 3
        setprop ro.vendor.vehiclehal.server.port 9210
 - Build and Launch cuttlefish VM
        m && acloud create --boot-timeout 3600 -vv --local-instance --local-image
 - VHAL should work as normal, see tests in ag/9693857

Bug: b/141493212

Change-Id: I97df02dd26b89f60d3d87b2c32c4f4f8919b1294
diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp
index 2050038..a94a37e 100644
--- a/automotive/vehicle/2.0/default/Android.bp
+++ b/automotive/vehicle/2.0/default/Android.bp
@@ -82,6 +82,20 @@
     ],
 }
 
+// VHal virtualization utils
+cc_library_static {
+    name: "android.hardware.automotive.vehicle@2.0-virtualization-utils",
+    vendor: true,
+    defaults: ["vhal_v2_0_defaults"],
+    srcs: [
+        "impl/vhal_v2_0/virtualization/Utils.cpp",
+    ],
+    export_include_dirs: ["impl"],
+    shared_libs: [
+        "libbase",
+    ],
+}
+
 cc_test {
     name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests",
     vendor: true,
@@ -133,3 +147,59 @@
         "libqemu_pipe",
     ],
 }
+
+cc_binary {
+    name: "android.hardware.automotive.vehicle@2.0-virtualization-service",
+    defaults: ["vhal_v2_0_defaults"],
+    init_rc: ["android.hardware.automotive.vehicle@2.0-virtualization-service.rc"],
+    vendor: true,
+    relative_install_path: "hw",
+    srcs: [
+        "impl/vhal_v2_0/virtualization/GrpcVehicleClient.cpp",
+        "VirtualizedVehicleService.cpp",
+    ],
+    shared_libs: [
+        "libbase",
+        "libcutils",
+        "libjsoncpp",
+        "libprotobuf-cpp-full",
+        "libgrpc++",
+    ],
+    static_libs: [
+        "android.hardware.automotive.vehicle@2.0-manager-lib",
+        "android.hardware.automotive.vehicle@2.0-default-impl-lib",
+        "android.hardware.automotive.vehicle@2.0-grpc",
+        "android.hardware.automotive.vehicle@2.0-virtualization-utils",
+        "libqemu_pipe",
+    ],
+    cflags: [
+        "-Wno-unused-parameter"
+    ],
+}
+
+cc_binary {
+    name: "android.hardware.automotive.vehicle@2.0-virtualization-grpc-server",
+    init_rc: ["android.hardware.automotive.vehicle@2.0-virtualization-grpc-server.rc"],
+    defaults: ["vhal_v2_0_defaults"],
+    vendor: true,
+    relative_install_path: "hw",
+    srcs: [
+        "impl/vhal_v2_0/virtualization/GrpcVehicleServer.cpp",
+        "VirtualizationGrpcServer.cpp",
+    ],
+    shared_libs: [
+        "libbase",
+        "libjsoncpp",
+        "libprotobuf-cpp-full",
+        "libgrpc++",
+    ],
+    static_libs: [
+        "android.hardware.automotive.vehicle@2.0-manager-lib",
+        "android.hardware.automotive.vehicle@2.0-default-impl-lib",
+        "android.hardware.automotive.vehicle@2.0-grpc",
+        "android.hardware.automotive.vehicle@2.0-virtualization-utils",
+    ],
+    cflags: [
+        "-Wno-unused-parameter"
+    ],
+}