Android.mk: make xtest installed in the vendor partition
and use ta libs in the vendor partition,
so that we could make optee work with Treble enabled builds too
Acked-by: Victor Chong <victor.chong@linaro.org>
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
diff --git a/Android.mk b/Android.mk
index ff3c35c..086f500 100644
--- a/Android.mk
+++ b/Android.mk
@@ -19,8 +19,11 @@
include $(CLEAR_VARS)
LOCAL_MODULE := xtest
+LOCAL_VENDOR_MODULE := true
LOCAL_SHARED_LIBRARIES := libteec
+TA_DIR ?= /vendor/lib/optee_armtz
+
srcs := regression_1000.c
ifeq ($(CFG_GP_SOCKETS),y)
@@ -97,6 +100,10 @@
LOCAL_CFLAGS += -g3
LOCAL_CFLAGS += -Wno-missing-field-initializers -Wno-format-zero-length
+ifneq ($(TA_DIR),)
+LOCAL_CFLAGS += -DTA_DIR=\"$(TA_DIR)\"
+endif
+
## $(OPTEE_BIN) is the path of tee.bin like
## out/target/product/hikey/optee/arm-plat-hikey/core/tee.bin
## it will be generated after build the optee_os with target BUILD_OPTEE_OS
diff --git a/host/xtest/regression_1000.c b/host/xtest/regression_1000.c
index 06773ef..3cbe90c 100644
--- a/host/xtest/regression_1000.c
+++ b/host/xtest/regression_1000.c
@@ -648,7 +648,7 @@
#ifdef CFG_SECSTOR_TA_MGMT_PTA
#ifndef TA_DIR
# ifdef __ANDROID__
-#define TA_DIR "/system/lib/optee_armtz"
+#define TA_DIR "/vendor/lib/optee_armtz"
# else
#define TA_DIR "/lib/optee_armtz"
# endif