release-request-a0f7506a-1cd6-4a03-927b-8d29e0c545e6-for-git_oc-mr1-release-4277764 snap-temp-L23600000093606242

Change-Id: I38ac621836d0180ca69cd0bfc06e1f7487a4d414
diff --git a/Android.bp b/Android.bp
index 2c0af01..bbccf13 100644
--- a/Android.bp
+++ b/Android.bp
@@ -17,6 +17,11 @@
 
 cc_library_shared {
     name: "libRSDriver",
+    vendor_available: true,
+    vndk: {
+        enabled: true,
+        support_system_process: true,
+    },
     defaults: ["rs_defaults"],
 
     srcs: [
@@ -55,6 +60,14 @@
         "libbcinfo",
     ],
 
+    static_libs: ["libarect"],
+
+    header_libs: [
+        "libcutils_headers",
+        "libutils_headers",
+        "libnativebase_headers",
+    ],
+
     product_variables: {
         pdk: {
             enabled: false,
@@ -112,6 +125,11 @@
 
 cc_library_shared {
     name: "libRS_internal",
+    vendor_available: true,
+    vndk: {
+        enabled: true,
+        support_system_process: true,
+    },
     defaults: ["rs_defaults"],
 
     srcs: [
@@ -180,6 +198,8 @@
         "libmediandk",
     ],
 
+    static_libs: ["libarect"],
+
     // These runtime modules, including libcompiler_rt.so, are required for
     // RenderScript.
     required: [
@@ -218,6 +238,11 @@
 cc_library_shared {
     name: "libRS",
     defaults: ["rs_defaults"],
+    vendor_available: true,
+    vndk: {
+        enabled: true,
+        support_system_process: true,
+    },
 
     srcs: [
         "rsApiStubs.cpp",
diff --git a/cpp/Android.bp b/cpp/Android.bp
index 853900c..62bb72f 100644
--- a/cpp/Android.bp
+++ b/cpp/Android.bp
@@ -1,9 +1,13 @@
 cc_library_static {
     name: "libRSDispatch",
+    vendor_available: true,
 
     srcs: ["rsDispatch.cpp"],
 
-    include_dirs: ["frameworks/rs"],
+    include_dirs: [
+        "frameworks/rs",
+        "libnativehelper/include_jni",
+    ],
 
     cflags: [
         "-Wno-unused-parameter",
@@ -11,8 +15,9 @@
         "-DRS_COMPATIBILITY_LIB",
     ],
 
+
     sdk_version: "9",
-    shared_libs: ["libdl"],
+    shared_libs: ["libdl", "liblog"],
     // Used in librsjni, which is built as NDK code => no ASan.
     sanitize: {
         never: true,
diff --git a/cpu_ref/Android.bp b/cpu_ref/Android.bp
index 84b2b0b..e929a9c 100644
--- a/cpu_ref/Android.bp
+++ b/cpu_ref/Android.bp
@@ -1,6 +1,11 @@
 cc_library_shared {
     name: "libRSCpuRef",
     defaults: ["libbcc-targets"],
+    vendor_available: true,
+    vndk: {
+        enabled: true,
+        support_system_process: true,
+    },
 
     srcs: [
         "rsCpuCore.cpp",
@@ -97,6 +102,10 @@
         "libblas",
     ],
     static_libs: ["libbnnmlowp"],
+    header_libs: [
+        "libutils_headers",
+        "libhardware_headers",
+    ],
 
     include_dirs: [
         "frameworks/compile/libbcc/include",
diff --git a/cpu_ref/rsCpuExecutable.cpp b/cpu_ref/rsCpuExecutable.cpp
index c42ea0f..9dcc842 100644
--- a/cpu_ref/rsCpuExecutable.cpp
+++ b/cpu_ref/rsCpuExecutable.cpp
@@ -9,11 +9,11 @@
 
 #ifdef RS_COMPATIBILITY_LIB
 #include <stdio.h>
-#include <unistd.h>
 #else
 #include "bcc/Config.h"
 #endif
 
+#include <unistd.h>
 #include <dlfcn.h>
 #include <sys/stat.h>
 
diff --git a/driver/rsdAllocation.cpp b/driver/rsdAllocation.cpp
index 8bdd75b..6b59d1c 100644
--- a/driver/rsdAllocation.cpp
+++ b/driver/rsdAllocation.cpp
@@ -30,6 +30,8 @@
 #include <GLES/glext.h>
 #endif
 
+#include <unistd.h> // for close()
+
 using android::renderscript::Allocation;
 using android::renderscript::Context;
 using android::renderscript::Element;