hikey960: bifrost: Enable renderscript binaries am: a6764b2e0d am: 36cc1282fe
am: 9ad00a6ae6

Change-Id: Ie93f7f162485813bb42fee8d71a6dcbd7d40230d
diff --git a/hikey960/device-hikey960.mk b/hikey960/device-hikey960.mk
index 0a39bb5..319f31a 100644
--- a/hikey960/device-hikey960.mk
+++ b/hikey960/device-hikey960.mk
@@ -48,6 +48,9 @@
 #binary blobs from ARM
 PRODUCT_PACKAGES +=	libGLES_mali.so \
 			vulkan.hikey960.so \
+			libbccArm.so \
+			libRSDriverArm.so \
+			libmalicore.bc \
 			END_USER_LICENCE_AGREEMENT.txt
 PRODUCT_COPY_FILES += \
         $(LOCAL_PATH)/../mali/bifrost/lib/libclcore.bc:vendor/lib/libclcore.bc \
@@ -58,6 +61,10 @@
         $(LOCAL_PATH)/../mali/bifrost/lib64/libLLVM.so:vendor/lib64/libLLVM.so
 
 
+OVERRIDE_RS_DRIVER := libRSDriverArm.so
+PRODUCT_PACKAGES += android.hardware.renderscript@1.0-impl
+PRODUCT_PACKAGES += vndk_package
+
 PRODUCT_PACKAGES += power.hikey960
 
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += sys.usb.controller=ff100000.dwc3
diff --git a/mali/bifrost/Android.mk b/mali/bifrost/Android.mk
index 9fccbe8..a4f6ace 100644
--- a/mali/bifrost/Android.mk
+++ b/mali/bifrost/Android.mk
@@ -22,6 +22,37 @@
 include $(BUILD_PREBUILT)
 
 include $(CLEAR_VARS)
+LOCAL_MODULE := libbccArm.so
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_STRIP_MODULE := false
+LOCAL_SRC_FILES_arm64 := lib64/$(LOCAL_MODULE)
+LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/
+LOCAL_MULTILIB := 64
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libRSDriverArm.so
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_STRIP_MODULE := false
+LOCAL_SRC_FILES_arm := lib/$(LOCAL_MODULE)
+LOCAL_SRC_FILES_arm64 := lib64/$(LOCAL_MODULE)
+LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib/
+LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/
+LOCAL_MULTILIB := both
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libmalicore.bc
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_STRIP_MODULE := false
+LOCAL_SRC_FILES_arm := lib/$(LOCAL_MODULE)
+LOCAL_SRC_FILES_arm64 := lib64/$(LOCAL_MODULE)
+LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib/
+LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64/
+LOCAL_MULTILIB := both
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
 LOCAL_MODULE := vulkan.hikey960.so
 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
 LOCAL_STRIP_MODULE := false
diff --git a/manifest.xml b/manifest.xml
index b90111d..ed91bd2 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -165,4 +165,13 @@
             <instance>default</instance>
         </interface>
     </hal>
+    <hal format="hidl">
+        <name>android.hardware.renderscript</name>
+        <transport arch="32+64">passthrough</transport>
+        <version>1.0</version>
+            <interface>
+            <name>IDevice</name>
+        <instance>default</instance>
+        </interface>
+    </hal>
 </manifest>
diff --git a/sepolicy/app.te b/sepolicy/app.te
new file mode 100644
index 0000000..512230b
--- /dev/null
+++ b/sepolicy/app.te
@@ -0,0 +1 @@
+allow appdomain same_process_hal_file:file { read execute_no_trans };
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index a356e0b..dacdb9f 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -32,3 +32,13 @@
 
 /dev/block/platform/soc/f723d000\.dwmmc0/by-name/cache u:object_r:cache_block_device:s0
 /dev/block/platform/soc/f723d000\.dwmmc0/by-name/userdata u:object_r:userdata_block_device:s0
+
+
+/vendor/lib(64)?/libRSDriverArm\.so u:object_r:same_process_hal_file:s0
+/vendor/lib64/libbccArm\.so u:object_r:same_process_hal_file:s0
+/vendor/lib64/libbcc\.so u:object_r:same_process_hal_file:s0
+/vendor/lib64/libLLVM_android\.so u:object_r:same_process_hal_file:s0
+/vendor/lib(64)?/libclcore\.bc u:object_r:same_process_hal_file:s0
+/vendor/lib(64)?/libmalicore\.bc u:object_r:same_process_hal_file:s0
+/vendor/lib/libclcore_neon\.bc u:object_r:same_process_hal_file:s0
+/vendor/bin/bcc                u:object_r:same_process_hal_file:s0