Snap for 4813226 from f63913ffe26ef2b2b4c37de8a0dfe158e135bb12 to pi-release

Change-Id: I9e2b8ea108b1f0b86076337447429629a3374933
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..db4d39f
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,32 @@
+cc_library_shared {
+    name: "libv4l2_codec2_arcva_factory",
+    vendor_available: true,
+    product_variables: {
+        arc: {
+            srcs: ["C2ArcVideoAcceleratorFactory.cpp"],
+
+            shared_libs: [
+                "libarcbridge",
+                "libarcbridgeservice",
+                "libarcvideobridge",
+                "libbinder",
+                "libchrome",
+                "liblog",
+                "libmojo",
+                "libutils",
+            ],
+
+            // -Wno-unused-parameter is needed for libchrome/base codes
+            cflags: [
+                "-Wall",
+                "-Werror",
+                "-Wno-unused-parameter",
+                "-std=c++14",
+            ],
+        },
+    },
+    clang: true,
+    export_include_dirs: [
+        "include",
+    ],
+}
diff --git a/Android.mk b/Android.mk
index 0ba1e46..bff4409 100644
--- a/Android.mk
+++ b/Android.mk
@@ -6,36 +6,6 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-# Build C2ArcVideoAcceleratorFactory only in cheets build.
-ifneq (,$(findstring cheets_,$(TARGET_PRODUCT)))
-LOCAL_SRC_FILES:= \
-                   C2ArcVideoAcceleratorFactory.cpp \
-
-LOCAL_C_INCLUDES := \
-        $(TOP)/external/gtest/include \
-        $(TOP)/external/libchrome \
-        $(TOP)/external/v4l2_codec2/include \
-
-LOCAL_MODULE:= libv4l2_codec2_arcva_factory
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES += libarcbridge \
-                          libarcbridgeservice \
-                          libarcvideobridge \
-                          libbinder \
-                          libchrome \
-                          liblog \
-                          libmojo \
-                          libutils \
-
-# -Wno-unused-parameter is needed for libchrome/base codes
-LOCAL_CFLAGS := -Werror -Wall -Wno-unused-parameter -std=c++14
-LOCAL_CLANG := true
-
-include $(BUILD_SHARED_LIBRARY)
-include $(CLEAR_VARS)
-endif # ifneq (,$(findstring cheets_,$(TARGET_PRODUCT)))
-
 LOCAL_SRC_FILES:= \
         C2VDAComponent.cpp \
         C2VDAAdaptor.cpp   \
diff --git a/vda/Android.bp b/vda/Android.bp
new file mode 100644
index 0000000..5f84535
--- /dev/null
+++ b/vda/Android.bp
@@ -0,0 +1,53 @@
+cc_library_shared {
+    name: "libv4l2_codec2_vda",
+    srcs: [
+        "bit_reader.cc",
+        "bit_reader_core.cc",
+        "bitstream_buffer.cc",
+        "h264_bit_reader.cc",
+        "h264_decoder.cc",
+        "h264_dpb.cc",
+        "h264_parser.cc",
+        "native_pixmap_handle.cc",
+        "picture.cc",
+        "ranges.cc",
+        "shared_memory_region.cc",
+        "v4l2_device.cc",
+        "v4l2_slice_video_decode_accelerator.cc",
+        "v4l2_video_decode_accelerator.cc",
+        "video_codecs.cc",
+        "video_decode_accelerator.cc",
+        "vp8_bool_decoder.cc",
+        "vp8_decoder.cc",
+        "vp8_parser.cc",
+        "vp8_picture.cc",
+        "vp9_bool_decoder.cc",
+        "vp9_compressed_header_parser.cc",
+        "vp9_decoder.cc",
+        "vp9_parser.cc",
+        "vp9_picture.cc",
+        "vp9_raw_bits_reader.cc",
+        "vp9_uncompressed_header_parser.cc",
+    ],
+
+    shared_libs: ["libchrome"],
+    // -Wno-unused-parameter is needed for libchrome/base codes
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wno-unused-parameter",
+    ],
+    clang: true,
+    sanitize: {
+        misc_undefined: [
+            "unsigned-integer-overflow",
+            "signed-integer-overflow",
+        ],
+    },
+
+    ldflags: [
+        "-Wl",
+        "-Bsymbolic",
+    ],
+    export_include_dirs: ["."],
+}
diff --git a/vda/Android.mk b/vda/Android.mk
deleted file mode 100644
index 12f0ea1..0000000
--- a/vda/Android.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_CPP_EXTENSION:= .cc
-LOCAL_SRC_FILES:= \
-        bit_reader.cc       \
-        bit_reader_core.cc  \
-        bitstream_buffer.cc \
-        h264_bit_reader.cc  \
-        h264_decoder.cc     \
-        h264_dpb.cc         \
-        h264_parser.cc      \
-        native_pixmap_handle.cc \
-        picture.cc          \
-        ranges.cc           \
-        shared_memory_region.cc \
-        v4l2_device.cc      \
-        v4l2_slice_video_decode_accelerator.cc \
-        v4l2_video_decode_accelerator.cc \
-        video_codecs.cc     \
-        video_decode_accelerator.cc \
-        vp8_bool_decoder.cc \
-        vp8_decoder.cc      \
-        vp8_parser.cc       \
-        vp8_picture.cc      \
-        vp9_bool_decoder.cc \
-        vp9_compressed_header_parser.cc \
-        vp9_decoder.cc      \
-        vp9_parser.cc       \
-        vp9_picture.cc      \
-        vp9_raw_bits_reader.cc \
-        vp9_uncompressed_header_parser.cc \
-
-# gtest/include is for included file from libchrome/base/gtest_prod_util.h
-LOCAL_C_INCLUDES += \
-        $(TOP)/external/libchrome \
-        $(TOP)/external/gtest/include \
-
-LOCAL_MODULE:= libv4l2_codec2_vda
-
-LOCAL_SHARED_LIBRARIES := libchrome \
-
-# -Wno-unused-parameter is needed for libchrome/base codes
-LOCAL_CFLAGS += -Werror -Wall -Wno-unused-parameter
-LOCAL_CLANG := true
-LOCAL_SANITIZE := unsigned-integer-overflow signed-integer-overflow
-
-LOCAL_LDFLAGS := -Wl,-Bsymbolic
-
-include $(BUILD_SHARED_LIBRARY)