mobicore: allow loading trustlets from the vendor folder
[GitHub/LineageOS/android_hardware_samsung_slsi_exynos7580.git] / mobicore / daemon / Registry / PrivateRegistry.cpp
index 694ed151fc7ae98e7ebb4d178bc26750f40c4f40..ed28389723ede6eccc91b497c96c689c004aa373 100644 (file)
@@ -72,6 +72,7 @@
 
 #define MC_REGISTRY_CONTAINER_PATH "/data/app/mcRegistry"
 #define MC_REGISTRY_DEFAULT_PATH "/system/app/mcRegistry"
+#define MC_REGISTRY_VENDOR_PATH "/vendor/app/mcRegistry"
 #define MC_REGISTRY_FALLBACK_PATH "/data/app/mcRegistry"
 #define AUTH_TOKEN_FILE_NAME "00000000.authtokcont"
 #define ENV_MC_AUTH_TOKEN_PATH "MC_AUTH_TOKEN_PATH"
@@ -138,8 +139,12 @@ string getTlRegistryPath()
     if (doesDirExist(MC_REGISTRY_DEFAULT_PATH)) {
         registryPath = MC_REGISTRY_DEFAULT_PATH;
         LOG_I(" Using MC_REGISTRY_PATH %s", registryPath.c_str());
+    } else if (doesDirExist(MC_REGISTRY_VENDOR_PATH)) {
+        // Second, attempt to use regular registry environment variable.
+        registryPath = MC_REGISTRY_VENDOR_PATH;
+        LOG_I(" Using MC_REGISTRY_VENDOR_PATH %s", registryPath.c_str());
     } else if (doesDirExist(MC_REGISTRY_FALLBACK_PATH)) {
-        // Second, attempt to use fallback registry environment variable.
+        // Third, attempt to use fallback registry environment variable.
         registryPath = MC_REGISTRY_FALLBACK_PATH;
         LOG_I(" Using MC_REGISTRY_FALLBACK_PATH %s", registryPath.c_str());
     }