summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-06-19 15:22:55 (GMT)
committerLinux Build Service Account <lnxbuild@localhost>2018-06-19 15:22:55 (GMT)
commite4a12cbf8b2de77bbb8b60b3404a02fb5f538220 (patch)
treef73067ed47aed51055205bff9e48d3bba0b111f5
parentf09fb2e8705804b48aab18ca4ec023b9c14bd8f1 (diff)
parent36017216cce7d7fdf9c2b2eacc9835fd2d0f6d21 (diff)
downloadandroid_vendor_qcom_opensource_cryptfs_hw-e4a12cbf8b2de77bbb8b60b3404a02fb5f538220.zip
android_vendor_qcom_opensource_cryptfs_hw-e4a12cbf8b2de77bbb8b60b3404a02fb5f538220.tar.gz
android_vendor_qcom_opensource_cryptfs_hw-e4a12cbf8b2de77bbb8b60b3404a02fb5f538220.tar.bz2
Merge 36017216cce7d7fdf9c2b2eacc9835fd2d0f6d21 on remote branchrefs/changes/02/242602/1
Change-Id: Ia34587d3fac131f691182268fd2971edb00c8cd2
-rw-r--r--Android.bp25
-rw-r--r--Android.mk39
-rw-r--r--cryptfs_hw.c7
3 files changed, 29 insertions, 42 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..5698fb3
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,25 @@
+sourceFiles = ["cryptfs_hw.c"]
+
+commonSharedLibraries = [
+ "libcutils",
+ "libutils",
+ "libdl",
+ "libhardware",
+ "liblog",
+]
+
+cc_library_shared {
+ name: "libcryptfs_hw",
+ header_libs: ["qseecom-kernel-headers",
+ "libhardware_headers"],
+ cflags: ["-DCONFIG_HW_DISK_ENCRYPTION"],
+ srcs: sourceFiles,
+ shared_libs: commonSharedLibraries,
+
+ owner: "qti",
+}
+
+cc_library_headers {
+ name: "libcryptfs_hw_headers",
+ export_include_dirs: ["."],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 84e3c38..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-ifeq ($(TARGET_USES_QSSI),true)
-ifeq ($(TARGET_HW_DISK_ENCRYPTION),true)
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-sourceFiles := \
- cryptfs_hw.c
-
-commonSharedLibraries := \
- libcutils \
- libutils \
- libdl \
- libhardware \
- liblog
-
-commonIncludes := \
- hardware/libhardware/include/hardware/ \
- $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include \
-
-LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
-
-LOCAL_C_INCLUDES := $(commonIncludes)
-LOCAL_SRC_FILES := $(sourceFiles)
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE:= libcryptfs_hw
-LOCAL_SHARED_LIBRARIES := $(commonSharedLibraries)
-
-LOCAL_MODULE_OWNER := qti
-
-# USE_ICE_FOR_STORAGE_ENCRYPTION would be true in future if
-# TARGET_USE_EMMC_USE_ICE is set
-ifeq ($(TARGET_USE_UFS_ICE),true)
-LOCAL_CFLAGS += -DUSE_ICE_FOR_STORAGE_ENCRYPTION
-endif
-
-include $(BUILD_SHARED_LIBRARY)
-endif
-endif
diff --git a/cryptfs_hw.c b/cryptfs_hw.c
index 139c0be..859b108 100644
--- a/cryptfs_hw.c
+++ b/cryptfs_hw.c
@@ -34,12 +34,13 @@
#include <fcntl.h>
#include <dirent.h>
#include <dlfcn.h>
+#include <errno.h>
#include <linux/qseecom.h>
+#include <hardware/keymaster_common.h>
+#include <hardware/hardware.h>
#include "cutils/log.h"
#include "cutils/properties.h"
#include "cutils/android_reboot.h"
-#include "keymaster_common.h"
-#include "hardware.h"
#include "cryptfs_hw.h"
/*
@@ -273,7 +274,7 @@ static int is_qseecom_up()
char value[PROPERTY_VALUE_MAX] = {0};
for (; i<CRYPTFS_HW_UP_CHECK_COUNT; i++) {
- property_get("sys.keymaster.loaded", value, "");
+ property_get("vendor.sys.keymaster.loaded", value, "");
if (!strncmp(value, "true", PROPERTY_VALUE_MAX))
return 1;
usleep(100000);